From e49ba6230d36056865617149d6923878b060aab3 Mon Sep 17 00:00:00 2001 From: DongYifan Date: Mon, 18 May 2020 15:05:37 +0800 Subject: [PATCH 001/430] 1. Add audio only example for iOS 2. Rename JoinChannel to JoinChannelVideo --- iOS/APIExample.xcodeproj/project.pbxproj | 14 +- iOS/APIExample/Base.lproj/Main.storyboard | 57 +++++- .../Basic-Video-Audio/JoinChannelAudio.swift | 120 +++++++++++++ .../Basic-Video-Audio/JoinChannelVideo.swift | 167 ++++++++++++++++++ iOS/APIExample/ViewController.swift | 3 +- 5 files changed, 347 insertions(+), 14 deletions(-) create mode 100644 iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelAudio.swift create mode 100644 iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift diff --git a/iOS/APIExample.xcodeproj/project.pbxproj b/iOS/APIExample.xcodeproj/project.pbxproj index a25214351..f04bed1c9 100644 --- a/iOS/APIExample.xcodeproj/project.pbxproj +++ b/iOS/APIExample.xcodeproj/project.pbxproj @@ -20,7 +20,7 @@ 03BCEC6B24494FC300ED7177 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 03BCEC6924494F8E00ED7177 /* libc++.tbd */; }; 03BCEC6C24494FCA00ED7177 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 03BCEC6A24494F9700ED7177 /* libresolv.tbd */; }; 03BCEC7124497B7000ED7177 /* RTMPStreaming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC6E24497B6F00ED7177 /* RTMPStreaming.swift */; }; - 03BCEC7224497B7000ED7177 /* JoinChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC7024497B7000ED7177 /* JoinChannel.swift */; }; + 03BCEC7224497B7000ED7177 /* JoinChannelVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */; }; 03BCEC762449EB5000ED7177 /* LogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC752449EB4F00ED7177 /* LogViewController.swift */; }; 03D13BD02448758900B599B3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13BCF2448758900B599B3 /* AppDelegate.swift */; }; 03D13BD42448758900B599B3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13BD32448758900B599B3 /* ViewController.swift */; }; @@ -28,6 +28,7 @@ 03D13BD92448758B00B599B3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03D13BD82448758B00B599B3 /* Assets.xcassets */; }; 03D13BDC2448758B00B599B3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03D13BDA2448758B00B599B3 /* LaunchScreen.storyboard */; }; 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13C0024488F1E00B599B3 /* KeyCenter.swift */; }; + 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */; }; A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7631169245AC15A00BABDE4 /* RTMPInjection.swift */; }; A7847F922458062900469187 /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; A7847F942458089E00469187 /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; @@ -50,7 +51,7 @@ 03BCEC6924494F8E00ED7177 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 03BCEC6A24494F9700ED7177 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; 03BCEC6E24497B6F00ED7177 /* RTMPStreaming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RTMPStreaming.swift; sourceTree = ""; }; - 03BCEC7024497B7000ED7177 /* JoinChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JoinChannel.swift; sourceTree = ""; }; + 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JoinChannelVideo.swift; sourceTree = ""; }; 03BCEC752449EB4F00ED7177 /* LogViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogViewController.swift; sourceTree = ""; }; 03D13BCC2448758900B599B3 /* APIExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APIExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 03D13BCF2448758900B599B3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -62,6 +63,7 @@ 03D13C0024488F1E00B599B3 /* KeyCenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyCenter.swift; sourceTree = ""; }; 07A781F5D5D3783CEC7C8EFA /* Pods_APIExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3EA7D4B4D7C9540659392B7F /* 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 = ""; }; + 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinChannelAudio.swift; sourceTree = ""; }; 846AE4340F81DCC00B6F9543 /* Pods-APIExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample.release.xcconfig"; path = "Target Support Files/Pods-APIExample/Pods-APIExample.release.xcconfig"; sourceTree = ""; }; A7631169245AC15A00BABDE4 /* RTMPInjection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; A7847F912458062900469187 /* StatisticsInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatisticsInfo.swift; sourceTree = ""; }; @@ -134,7 +136,8 @@ 03BCEC6F24497B7000ED7177 /* Basic-Video-Audio */ = { isa = PBXGroup; children = ( - 03BCEC7024497B7000ED7177 /* JoinChannel.swift */, + 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */, + 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */, ); path = "Basic-Video-Audio"; sourceTree = ""; @@ -165,7 +168,7 @@ 03D13BD32448758900B599B3 /* ViewController.swift */, 03BCEC4C244932E000ED7177 /* Examples */, 03D13BFF24488F1E00B599B3 /* Common */, - A7CA48BF2455315A00507435 /* Supporting Files */ + A7CA48BF2455315A00507435 /* Supporting Files */, ); path = APIExample; sourceTree = ""; @@ -327,9 +330,10 @@ buildActionMask = 2147483647; files = ( 03D13BD42448758900B599B3 /* ViewController.swift in Sources */, + 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */, 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */, 03BCEC7124497B7000ED7177 /* RTMPStreaming.swift in Sources */, - 03BCEC7224497B7000ED7177 /* JoinChannel.swift in Sources */, + 03BCEC7224497B7000ED7177 /* JoinChannelVideo.swift in Sources */, A7CA48C624553D3500507435 /* VideoView.swift in Sources */, A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */, 03D13BD02448758900B599B3 /* AppDelegate.swift in Sources */, diff --git a/iOS/APIExample/Base.lproj/Main.storyboard b/iOS/APIExample/Base.lproj/Main.storyboard index c2c2da2d0..9b84963e0 100644 --- a/iOS/APIExample/Base.lproj/Main.storyboard +++ b/iOS/APIExample/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -80,10 +80,51 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -92,7 +133,7 @@ - + @@ -126,8 +167,8 @@ - - + + @@ -315,6 +356,6 @@ - + diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelAudio.swift b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelAudio.swift new file mode 100644 index 000000000..59d50d86a --- /dev/null +++ b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelAudio.swift @@ -0,0 +1,120 @@ +// +// JoinChannelAudioMain.swift +// APIExample +// +// Created by ADMIN on 2020/5/18. +// Copyright © 2020 Agora Corp. All rights reserved. +// + +import UIKit + +import Foundation +import UIKit +import AgoraRtcKit + + +class JoinChannelAudioMain: BaseViewController { + @IBOutlet weak var joinButton: UIButton! + @IBOutlet weak var channelTextField: UITextField! + + var agoraKit: AgoraRtcEngineKit! + + // indicate if current instance has joined channel + var isJoined: Bool = false { + didSet { + channelTextField.isEnabled = !isJoined + joinButton.isHidden = isJoined + } + } + + override func viewDidLoad(){ + super.viewDidLoad() + // set up agora instance when view loaded + agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + // leave channel when exiting the view + if(isJoined) { + agoraKit.leaveChannel { (stats) -> Void in + LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + } + } + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + view.endEditing(true) + } + + /// callback when join button hit + @IBAction func onJoin(){ + guard let channelName = channelTextField.text else {return} + + //hide keyboard + channelTextField.resignFirstResponder() + + // disable video module + agoraKit.disableVideo() + + // Set audio route to speaker + agoraKit.setDefaultAudioRouteToSpeakerphone(true) + + // start joining channel + // 1. Users can only see each other after they join the + // same channel successfully using the same app id. + // 2. If app certificate is turned on at dashboard, token is needed + // when joining channel. The channel name and uid used to calculate + // the token has to match the ones used for channel join + let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in + self.isJoined = true + LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + } + if(result != 0) { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + } + } +} + +/// agora rtc engine delegate events +extension JoinChannelAudioMain: AgoraRtcEngineDelegate { + /// callback when warning occured for agora sdk, warning can usually be ignored, still it's nice to check out + /// what is happening + /// Warning code description can be found at: + /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html + /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html + /// @param warningCode warning code of the problem + func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { + LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + } + + /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand + /// to let user know something wrong is happening + /// Error code description can be found at: + /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + /// @param errorCode error code of the problem + func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { + LogUtils.log(msg: "error: \(errorCode)", level: .error) + self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") + } + + /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event + /// @param uid uid of remote joined user + /// @param elapsed time elapse since current sdk instance join the channel in ms + func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { + LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + } + + /// callback when a remote user is leaving the channel, note audience in live broadcast mode will NOT trigger this event + /// @param uid uid of remote joined user + /// @param reason reason why this user left, note this event may be triggered when the remote user + /// become an audience in live broadcasting profile + func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { + LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) + } +} diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift new file mode 100644 index 000000000..352433c6f --- /dev/null +++ b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift @@ -0,0 +1,167 @@ +// +// JoinChannelVC.swift +// APIExample +// +// Created by 张乾泽 on 2020/4/17. +// Copyright © 2020 Agora Corp. All rights reserved. +// + +import Foundation +import UIKit +import AgoraRtcKit + + +class JoinChannelVideoMain: BaseViewController { + @IBOutlet weak var joinButton: UIButton! + @IBOutlet weak var channelTextField: UITextField! + + var localVideo = VideoView(frame: CGRect.zero) + var remoteVideo = VideoView(frame: CGRect.zero) + + var agoraKit: AgoraRtcEngineKit! + + // indicate if current instance has joined channel + var isJoined: Bool = false { + didSet { + channelTextField.isEnabled = !isJoined + joinButton.isHidden = isJoined + } + } + + override func viewDidLoad(){ + super.viewDidLoad() + // set up agora instance when view loaded + agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + // leave channel when exiting the view + if(isJoined) { + agoraKit.leaveChannel { (stats) -> Void in + LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + } + } + } + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + guard let identifier = segue.identifier else { + return + } + + switch identifier { + case "RenderViewController": + let vc = segue.destination as! RenderViewController + vc.layoutStream(views: [localVideo, remoteVideo]) + default: + break + } + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + view.endEditing(true) + } + + /// callback when join button hit + @IBAction func onJoin(){ + guard let channelName = channelTextField.text else {return} + + //hide keyboard + channelTextField.resignFirstResponder() + + // enable video module and set up video encoding configs + agoraKit.enableVideo() + agoraKit.setVideoEncoderConfiguration(AgoraVideoEncoderConfiguration(size: AgoraVideoDimension640x360, + frameRate: .fps15, + bitrate: AgoraVideoBitrateStandard, + orientationMode: .adaptative)) + + // set up local video to render your local camera preview + let videoCanvas = AgoraRtcVideoCanvas() + videoCanvas.uid = 0 + // the view to be binded + videoCanvas.view = localVideo.videoView + videoCanvas.renderMode = .hidden + agoraKit.setupLocalVideo(videoCanvas) + + // Set audio route to speaker + agoraKit.setDefaultAudioRouteToSpeakerphone(true) + + // start joining channel + // 1. Users can only see each other after they join the + // same channel successfully using the same app id. + // 2. If app certificate is turned on at dashboard, token is needed + // when joining channel. The channel name and uid used to calculate + // the token has to match the ones used for channel join + let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in + self.isJoined = true + LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + } + if(result != 0) { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + } + } +} + +/// agora rtc engine delegate events +extension JoinChannelVideoMain: AgoraRtcEngineDelegate { + /// callback when warning occured for agora sdk, warning can usually be ignored, still it's nice to check out + /// what is happening + /// Warning code description can be found at: + /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html + /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html + /// @param warningCode warning code of the problem + func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { + LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + } + + /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand + /// to let user know something wrong is happening + /// Error code description can be found at: + /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + /// @param errorCode error code of the problem + func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { + LogUtils.log(msg: "error: \(errorCode)", level: .error) + self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") + } + + /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event + /// @param uid uid of remote joined user + /// @param elapsed time elapse since current sdk instance join the channel in ms + func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { + LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + + // Only one remote video view is available for this + // tutorial. Here we check if there exists a surface + // view tagged as this uid. + let videoCanvas = AgoraRtcVideoCanvas() + videoCanvas.uid = uid + // the view to be binded + videoCanvas.view = remoteVideo.videoView + videoCanvas.renderMode = .hidden + agoraKit.setupRemoteVideo(videoCanvas) + } + + /// callback when a remote user is leaving the channel, note audience in live broadcast mode will NOT trigger this event + /// @param uid uid of remote joined user + /// @param reason reason why this user left, note this event may be triggered when the remote user + /// become an audience in live broadcasting profile + func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { + LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) + + // to unlink your view from sdk, so that your view reference will be released + // note the video will stay at its last frame, to completely remove it + // you will need to remove the EAGL sublayer from your binded view + let videoCanvas = AgoraRtcVideoCanvas() + videoCanvas.uid = uid + // the view to be binded + videoCanvas.view = nil + videoCanvas.renderMode = .hidden + agoraKit.setupRemoteVideo(videoCanvas) + } +} diff --git a/iOS/APIExample/ViewController.swift b/iOS/APIExample/ViewController.swift index 99877d770..0247c95fd 100644 --- a/iOS/APIExample/ViewController.swift +++ b/iOS/APIExample/ViewController.swift @@ -21,7 +21,8 @@ struct MenuItem { class ViewController: UIViewController { var menus:[MenuSection] = [ MenuSection(name: "Basic Video/Audio", rows: [ - MenuItem(name: "Join a channel", controller: "JoinChannel") + MenuItem(name: "Join a channel (Video)", controller: "JoinChannelVideo"), + MenuItem(name: "Join a channel (Audio)", controller: "JoinChannelAudio") ]), MenuSection(name: "Live Broadcasting", rows: [ MenuItem(name: "RTMP Streaming", controller: "RTMPStreaming"), From 67a13704de5757c95071fc595897fbc5449cab32 Mon Sep 17 00:00:00 2001 From: DongYifan Date: Mon, 18 May 2020 15:06:35 +0800 Subject: [PATCH 002/430] Remove JoinChannel file --- .../Basic-Video-Audio/JoinChannel.swift | 167 ------------------ 1 file changed, 167 deletions(-) delete mode 100644 iOS/APIExample/Examples/Basic-Video-Audio/JoinChannel.swift diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannel.swift b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannel.swift deleted file mode 100644 index 72d51a1fb..000000000 --- a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannel.swift +++ /dev/null @@ -1,167 +0,0 @@ -// -// JoinChannelVC.swift -// APIExample -// -// Created by 张乾泽 on 2020/4/17. -// Copyright © 2020 Agora Corp. All rights reserved. -// - -import Foundation -import UIKit -import AgoraRtcKit - - -class JoinChannelMain: BaseViewController { - @IBOutlet weak var joinButton: UIButton! - @IBOutlet weak var channelTextField: UITextField! - - var localVideo = VideoView(frame: CGRect.zero) - var remoteVideo = VideoView(frame: CGRect.zero) - - var agoraKit: AgoraRtcEngineKit! - - // indicate if current instance has joined channel - var isJoined: Bool = false { - didSet { - channelTextField.isEnabled = !isJoined - joinButton.isHidden = isJoined - } - } - - override func viewDidLoad(){ - super.viewDidLoad() - // set up agora instance when view loaded - agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) - } - - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - // leave channel when exiting the view - if(isJoined) { - agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) - } - } - } - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - guard let identifier = segue.identifier else { - return - } - - switch identifier { - case "RenderViewController": - let vc = segue.destination as! RenderViewController - vc.layoutStream(views: [localVideo, remoteVideo]) - default: - break - } - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - view.endEditing(true) - } - - /// callback when join button hit - @IBAction func onJoin(){ - guard let channelName = channelTextField.text else {return} - - //hide keyboard - channelTextField.resignFirstResponder() - - // enable video module and set up video encoding configs - agoraKit.enableVideo() - agoraKit.setVideoEncoderConfiguration(AgoraVideoEncoderConfiguration(size: AgoraVideoDimension640x360, - frameRate: .fps15, - bitrate: AgoraVideoBitrateStandard, - orientationMode: .adaptative)) - - // set up local video to render your local camera preview - let videoCanvas = AgoraRtcVideoCanvas() - videoCanvas.uid = 0 - // the view to be binded - videoCanvas.view = localVideo.videoView - videoCanvas.renderMode = .hidden - agoraKit.setupLocalVideo(videoCanvas) - - // Set audio route to speaker - agoraKit.setDefaultAudioRouteToSpeakerphone(true) - - // start joining channel - // 1. Users can only see each other after they join the - // same channel successfully using the same app id. - // 2. If app certificate is turned on at dashboard, token is needed - // when joining channel. The channel name and uid used to calculate - // the token has to match the ones used for channel join - let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in - self.isJoined = true - LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) - } - if(result != 0) { - // Usually happens with invalid parameters - // Error code description can be found at: - // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") - } - } -} - -/// agora rtc engine delegate events -extension JoinChannelMain: AgoraRtcEngineDelegate { - /// callback when warning occured for agora sdk, warning can usually be ignored, still it's nice to check out - /// what is happening - /// Warning code description can be found at: - /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html - /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html - /// @param warningCode warning code of the problem - func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { - LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) - } - - /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand - /// to let user know something wrong is happening - /// Error code description can be found at: - /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - /// @param errorCode error code of the problem - func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { - LogUtils.log(msg: "error: \(errorCode)", level: .error) - self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") - } - - /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event - /// @param uid uid of remote joined user - /// @param elapsed time elapse since current sdk instance join the channel in ms - func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { - LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) - - // Only one remote video view is available for this - // tutorial. Here we check if there exists a surface - // view tagged as this uid. - let videoCanvas = AgoraRtcVideoCanvas() - videoCanvas.uid = uid - // the view to be binded - videoCanvas.view = remoteVideo.videoView - videoCanvas.renderMode = .hidden - agoraKit.setupRemoteVideo(videoCanvas) - } - - /// callback when a remote user is leaving the channel, note audience in live broadcast mode will NOT trigger this event - /// @param uid uid of remote joined user - /// @param reason reason why this user left, note this event may be triggered when the remote user - /// become an audience in live broadcasting profile - func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { - LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) - - // to unlink your view from sdk, so that your view reference will be released - // note the video will stay at its last frame, to completely remove it - // you will need to remove the EAGL sublayer from your binded view - let videoCanvas = AgoraRtcVideoCanvas() - videoCanvas.uid = uid - // the view to be binded - videoCanvas.view = nil - videoCanvas.renderMode = .hidden - agoraKit.setupRemoteVideo(videoCanvas) - } -} From a01e3cfd333479122453f7fbd468be04689c6c50 Mon Sep 17 00:00:00 2001 From: CavanSu <403029552@qq.com> Date: Tue, 19 May 2020 14:28:04 +0800 Subject: [PATCH 003/430] basic video vc --- .../Common/BaseViewController.swift | 18 ++++++++++++- .../Basic-Video-Audio/JoinChannelVideo.swift | 26 +++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/iOS/APIExample/Common/BaseViewController.swift b/iOS/APIExample/Common/BaseViewController.swift index 85fb2a70a..928b32306 100644 --- a/iOS/APIExample/Common/BaseViewController.swift +++ b/iOS/APIExample/Common/BaseViewController.swift @@ -70,8 +70,24 @@ class RenderViewController: UIViewController { } } -class RTCViewController: BaseViewController { +class BasicVideoViewController: BaseViewController { + var renderVC: RenderViewController! + override func viewDidLoad() { super.viewDidLoad() } + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + guard let identifier = segue.identifier else { + return + } + + switch identifier { + case "RenderViewController": + let vc = segue.destination as! RenderViewController + renderVC = vc + default: + break + } + } } diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift index 352433c6f..5c1ae3b1a 100644 --- a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift +++ b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift @@ -10,8 +10,7 @@ import Foundation import UIKit import AgoraRtcKit - -class JoinChannelVideoMain: BaseViewController { +class JoinChannelVideoMain: BasicVideoViewController { @IBOutlet weak var joinButton: UIButton! @IBOutlet weak var channelTextField: UITextField! @@ -30,6 +29,9 @@ class JoinChannelVideoMain: BaseViewController { override func viewDidLoad(){ super.viewDidLoad() + // layout render view + renderVC.layoutStream(views: [localVideo, remoteVideo]) + // set up agora instance when view loaded agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) } @@ -44,20 +46,6 @@ class JoinChannelVideoMain: BaseViewController { } } - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - guard let identifier = segue.identifier else { - return - } - - switch identifier { - case "RenderViewController": - let vc = segue.destination as! RenderViewController - vc.layoutStream(views: [localVideo, remoteVideo]) - default: - break - } - } - override func touchesBegan(_ touches: Set, with event: UIEvent?) { view.endEditing(true) } @@ -72,9 +60,9 @@ class JoinChannelVideoMain: BaseViewController { // enable video module and set up video encoding configs agoraKit.enableVideo() agoraKit.setVideoEncoderConfiguration(AgoraVideoEncoderConfiguration(size: AgoraVideoDimension640x360, - frameRate: .fps15, - bitrate: AgoraVideoBitrateStandard, - orientationMode: .adaptative)) + frameRate: .fps15, + bitrate: AgoraVideoBitrateStandard, + orientationMode: .adaptative)) // set up local video to render your local camera preview let videoCanvas = AgoraRtcVideoCanvas() From a5588b36115690ab9db8ba270bd0e7729966f2f0 Mon Sep 17 00:00:00 2001 From: CavanSu <403029552@qq.com> Date: Fri, 22 May 2020 16:08:02 +0800 Subject: [PATCH 004/430] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..925a3657f --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,20 @@ +# Xcode +# Build, test, and archive an Xcode workspace on macOS. +# Add steps that install certificates, test, sign, and distribute an app, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode + +trigger: +- master + +pool: + vmImage: 'macos-latest' + +steps: +- task: Xcode@5 + inputs: + actions: 'build' + scheme: '' + sdk: 'iphoneos' + configuration: 'Release' + xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' + xcodeVersion: 'default' # Options: 8, 9, 10, default, specifyPath From 21ab125e3fbeb1a5518f6c83db755d62f34bdd7c Mon Sep 17 00:00:00 2001 From: CavanSu <403029552@qq.com> Date: Fri, 22 May 2020 17:53:10 +0800 Subject: [PATCH 005/430] azure pipelines --- azure-pipelines.yml | 18 +++++----- cicd/build-template/build-ios.yml | 41 +++++++++++++++++++++ cicd/build-template/github-release.yml | 3 ++ cicd/scripts/ios_build.sh | 40 +++++++++++++++++++++ cicd/scripts/keycenter.py | 50 ++++++++++++++++++++++++++ iOS/Podfile | 6 ++-- iOS/clear.sh | 11 ++++++ iOS/exportPlist.plist | 15 ++++++++ 8 files changed, 173 insertions(+), 11 deletions(-) create mode 100644 cicd/build-template/build-ios.yml create mode 100644 cicd/build-template/github-release.yml create mode 100755 cicd/scripts/ios_build.sh create mode 100644 cicd/scripts/keycenter.py create mode 100755 iOS/clear.sh create mode 100644 iOS/exportPlist.plist diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 925a3657f..7e8132498 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,16 +5,16 @@ trigger: - master +- dev/* pool: vmImage: 'macos-latest' -steps: -- task: Xcode@5 - inputs: - actions: 'build' - scheme: '' - sdk: 'iphoneos' - configuration: 'Release' - xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' - xcodeVersion: 'default' # Options: 8, 9, 10, default, specifyPath +jobs: +- template: cicd/build-template/build-ios.yml + parameters: + displayName: 'APIExampleiOS' + workingDirectory: 'iOS' + project: 'APIExample' + scheme: 'APIExample' + diff --git a/cicd/build-template/build-ios.yml b/cicd/build-template/build-ios.yml new file mode 100644 index 000000000..07a299958 --- /dev/null +++ b/cicd/build-template/build-ios.yml @@ -0,0 +1,41 @@ +parameters: + displayName: '' + workingDirectory: '' + project: '' + scheme: '' + +jobs: + - job: ${{ parameters.displayName }}Build + displayName: ${{ parameters.displayName }} + + pool: + vmImage: 'macOS-10.14' + + variables: + - group: AgoraKeys + + steps: + - script: cd 'cicd/scripts' && ls && python keycenter.py && ls + env: + AGORA_APP_ID: $(agora.appId) + File_Directory: '../../${{ parameters.workingDirectory }}/${{ parameters.project }}' + + - task: InstallAppleCertificate@2 + inputs: + certSecureFile: 'certificate.p12' + certPwd: $(agora.password) + + - task: InstallAppleProvisioningProfile@1 + inputs: + provProfileSecureFile: 'AgoraAppsDevProfile.mobileprovision' + + - script: cd 'cicd/scripts' && chmod +x ios_build.sh && ./ios_build.sh ../../${{ parameters.workingDirectory }} ${{ parameters.project }} ${{ parameters.scheme }} + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: ${{ parameters.workingDirectory }}/app + ArtifactName: ${{ parameters.displayName }} + + - template: github-release.yml + parameters: + displayName: ${{ parameters.displayName }} diff --git a/cicd/build-template/github-release.yml b/cicd/build-template/github-release.yml new file mode 100644 index 000000000..46e5c7aa9 --- /dev/null +++ b/cicd/build-template/github-release.yml @@ -0,0 +1,3 @@ +parameters: + displayName: '' + diff --git a/cicd/scripts/ios_build.sh b/cicd/scripts/ios_build.sh new file mode 100755 index 000000000..6ba2a543f --- /dev/null +++ b/cicd/scripts/ios_build.sh @@ -0,0 +1,40 @@ +WORKING_PATH=$1 +APP_Project=$2 +APP_TARGET=$3 +MODE=Release + +echo "WORKING_PATH: ${WORKING_PATH}" +echo "APP_TARGET: ${APP_TARGET}" + +cd ${WORKING_PATH} +echo `pwd` + +rm -f *.ipa +rm -rf *.app +rm -f *.zip +rm -rf dSYMs +rm -rf *.dSYM +rm -f *dSYMs.zip +rm -rf *.xcarchive + +Export_Plist_File=exportPlist.plist + +BUILD_DATE=`date +%Y-%m-%d-%H.%M.%S` +ArchivePath=${APP_TARGET}-${BUILD_DATE}.xcarchive + +TARGET_FILE="" +if [ ! -f "Podfile" ];then +TARGET_FILE="${APP_Project}.xcodeproj" +xcodebuild clean -project ${TARGET_FILE} -scheme "${APP_TARGET}" -configuration ${MODE} +xcodebuild -project ${TARGET_FILE} -scheme "${APP_TARGET}" -configuration ${MODE} -archivePath ${ArchivePath} archive +else +pod install +TARGET_FILE="${APP_Project}.xcworkspace" +xcodebuild clean -workspace ${TARGET_FILE} -scheme "${APP_TARGET}" -configuration ${MODE} +xcodebuild -workspace ${TARGET_FILE} -scheme "${APP_TARGET}" -configuration ${MODE} -archivePath ${ArchivePath} archive +fi + +xcodebuild -exportArchive -exportOptionsPlist ${Export_Plist_File} -archivePath ${ArchivePath} -exportPath . + +mkdir app +mv *.ipa app && mv *.xcarchive app diff --git a/cicd/scripts/keycenter.py b/cicd/scripts/keycenter.py new file mode 100644 index 000000000..a91815b6a --- /dev/null +++ b/cicd/scripts/keycenter.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +import re +import os + +def main(): + appId = "" + if "AGORA_APP_ID" in os.environ: + appId = os.environ["AGORA_APP_ID"] + token = "" + + fileDirectory = "" + if "File_Directory" in os.environ: + fileDirectory = os.environ["File_Directory"] + + # KeyCenter.swift + KeyCenterPath = fileDirectory + "/KeyCenter.swift" + print("KeyCenterPath: %s" %KeyCenterPath) + + try: + f = open(KeyCenterPath, 'r+') + content = f.read() + appString = "\"" + appId + "\"" + tokenString = "\"" + token + "\"" + contentNew = re.sub(r'<#Your App Id#>', appString, content) + contentNew = re.sub(r'<#Temp Access Token#>', tokenString, contentNew) + f.seek(0) + f.write(contentNew) + f.truncate() + except IOError: + print("File is not accessible.") + + # KeyCenter.m + KeyCenterPath = fileDirectory + "/KeyCenter.m" + + try: + f = open(KeyCenterPath, 'r+') + content = f.read() + appString = "@\"" + appId + "\"" + tokenString = "@\"" + token + "\"" + contentNew = re.sub(r'<#Your App Id#>', appString, content) + contentNew = re.sub(r'<#Temp Access Token#>', tokenString, contentNew) + f.seek(0) + f.write(contentNew) + f.truncate() + except IOError: + print("File is not accessible.") + +if __name__ == "__main__": + main() diff --git a/iOS/Podfile b/iOS/Podfile index e75786d8c..9ccf992b1 100644 --- a/iOS/Podfile +++ b/iOS/Podfile @@ -6,6 +6,8 @@ target 'APIExample' do use_frameworks! # Pods for APIExample - pod 'AGEVideoLayout' - pod 'AgoraRtcEngine_iOS', '3.0.0' + pod 'AGEVideoLayout', '~> 1.0.2' + pod 'AgoraRtcEngine_iOS', '~> 3.0.0' + + source 'https://github.com/CocoaPods/Specs.git' end diff --git a/iOS/clear.sh b/iOS/clear.sh new file mode 100755 index 000000000..18d57fc51 --- /dev/null +++ b/iOS/clear.sh @@ -0,0 +1,11 @@ +rm -rf *.xcarchive +rm -f *.ipa +rm -rf *.app +rm -f DistributionSummary.plist +rm -f ExportOptions.plist +rm -f Packaging.log +rm -rf app +rm -f app.zip +# rm -f Podfile.lock +# rm -rf Pods +# rm -rf *.xcworkspace \ No newline at end of file diff --git a/iOS/exportPlist.plist b/iOS/exportPlist.plist new file mode 100644 index 000000000..328a75aa7 --- /dev/null +++ b/iOS/exportPlist.plist @@ -0,0 +1,15 @@ + + + + + method + development + compileBitcode + + provisioningProfiles + + io.agora.api.example + AgoraAppsDevProfile + + + From cea9ad0b5ab552d4332c69f5025df14d2bb3a627 Mon Sep 17 00:00:00 2001 From: CavanSu <403029552@qq.com> Date: Fri, 22 May 2020 18:14:33 +0800 Subject: [PATCH 006/430] update script --- cicd/build-template/build-ios.yml | 2 +- cicd/scripts/keycenter.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cicd/build-template/build-ios.yml b/cicd/build-template/build-ios.yml index 07a299958..3fc6a60c2 100644 --- a/cicd/build-template/build-ios.yml +++ b/cicd/build-template/build-ios.yml @@ -18,7 +18,7 @@ jobs: - script: cd 'cicd/scripts' && ls && python keycenter.py && ls env: AGORA_APP_ID: $(agora.appId) - File_Directory: '../../${{ parameters.workingDirectory }}/${{ parameters.project }}' + File_Directory: '../../${{ parameters.workingDirectory }}/${{ parameters.project }}/Common' - task: InstallAppleCertificate@2 inputs: diff --git a/cicd/scripts/keycenter.py b/cicd/scripts/keycenter.py index a91815b6a..f900ddaf1 100644 --- a/cicd/scripts/keycenter.py +++ b/cicd/scripts/keycenter.py @@ -28,7 +28,7 @@ def main(): f.write(contentNew) f.truncate() except IOError: - print("File is not accessible.") + print("Swift File is not accessible.") # KeyCenter.m KeyCenterPath = fileDirectory + "/KeyCenter.m" @@ -44,7 +44,7 @@ def main(): f.write(contentNew) f.truncate() except IOError: - print("File is not accessible.") + print("OC File is not accessible.") if __name__ == "__main__": main() From 1ecfc9072432d201135b40cd83ccaac639ab11c2 Mon Sep 17 00:00:00 2001 From: CavanSu <403029552@qq.com> Date: Wed, 27 May 2020 12:34:58 +0800 Subject: [PATCH 007/430] mac main vc --- .../APIExample_Mac.entitlements | 10 + iOS/APIExample-Mac/AppDelegate.swift | 26 + .../AppIcon.appiconset/Contents.json | 58 ++ .../Assets.xcassets/Contents.json | 6 + iOS/APIExample-Mac/Base.lproj/Main.storyboard | 868 ++++++++++++++++++ iOS/APIExample-Mac/Info.plist | 36 + iOS/APIExample.xcodeproj/project.pbxproj | 139 ++- .../Common/BaseViewController.swift | 12 +- iOS/APIExample/Common/UITypeAlias.swift | 799 ++++++++++++++++ iOS/APIExample/ViewController.swift | 53 +- 10 files changed, 1998 insertions(+), 9 deletions(-) create mode 100644 iOS/APIExample-Mac/APIExample_Mac.entitlements create mode 100644 iOS/APIExample-Mac/AppDelegate.swift create mode 100644 iOS/APIExample-Mac/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 iOS/APIExample-Mac/Assets.xcassets/Contents.json create mode 100644 iOS/APIExample-Mac/Base.lproj/Main.storyboard create mode 100644 iOS/APIExample-Mac/Info.plist create mode 100644 iOS/APIExample/Common/UITypeAlias.swift diff --git a/iOS/APIExample-Mac/APIExample_Mac.entitlements b/iOS/APIExample-Mac/APIExample_Mac.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/iOS/APIExample-Mac/APIExample_Mac.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/iOS/APIExample-Mac/AppDelegate.swift b/iOS/APIExample-Mac/AppDelegate.swift new file mode 100644 index 000000000..3544bb6e9 --- /dev/null +++ b/iOS/APIExample-Mac/AppDelegate.swift @@ -0,0 +1,26 @@ +// +// AppDelegate.swift +// APIExample-Mac +// +// Created by CavanSu on 2020/5/26. +// Copyright © 2020 Agora Corp. All rights reserved. +// + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + +} + diff --git a/iOS/APIExample-Mac/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOS/APIExample-Mac/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/iOS/APIExample-Mac/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOS/APIExample-Mac/Assets.xcassets/Contents.json b/iOS/APIExample-Mac/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/iOS/APIExample-Mac/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOS/APIExample-Mac/Base.lproj/Main.storyboard b/iOS/APIExample-Mac/Base.lproj/Main.storyboard new file mode 100644 index 000000000..fcbaf0d69 --- /dev/null +++ b/iOS/APIExample-Mac/Base.lproj/Main.storyboard @@ -0,0 +1,868 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample-Mac/Info.plist b/iOS/APIExample-Mac/Info.plist new file mode 100644 index 000000000..a544ad3ab --- /dev/null +++ b/iOS/APIExample-Mac/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 Agora Corp. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/iOS/APIExample.xcodeproj/project.pbxproj b/iOS/APIExample.xcodeproj/project.pbxproj index f04bed1c9..519005dc5 100644 --- a/iOS/APIExample.xcodeproj/project.pbxproj +++ b/iOS/APIExample.xcodeproj/project.pbxproj @@ -32,6 +32,12 @@ A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7631169245AC15A00BABDE4 /* RTMPInjection.swift */; }; A7847F922458062900469187 /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; A7847F942458089E00469187 /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; + A7BD7660247CC6920062A6B3 /* UITypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */; }; + A7BD7668247CCAA80062A6B3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BD7667247CCAA80062A6B3 /* AppDelegate.swift */; }; + A7BD766C247CCAAA0062A6B3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7BD766B247CCAAA0062A6B3 /* Assets.xcassets */; }; + A7BD766F247CCAAA0062A6B3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7BD766D247CCAAA0062A6B3 /* Main.storyboard */; }; + A7BD7675247CCAC80062A6B3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13BD32448758900B599B3 /* ViewController.swift */; }; + A7BD7689247E17A30062A6B3 /* UITypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */; }; A7CA48C424553CF700507435 /* Popover.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7CA48C224553CF600507435 /* Popover.storyboard */; }; A7CA48C624553D3500507435 /* VideoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA48C524553D3500507435 /* VideoView.swift */; }; D4046B5D3DE984062E3F6D92 /* Pods_APIExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07A781F5D5D3783CEC7C8EFA /* Pods_APIExample.framework */; }; @@ -68,6 +74,13 @@ A7631169245AC15A00BABDE4 /* RTMPInjection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; A7847F912458062900469187 /* StatisticsInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatisticsInfo.swift; sourceTree = ""; }; A7847F932458089E00469187 /* AgoraExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AgoraExtension.swift; sourceTree = ""; }; + A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITypeAlias.swift; sourceTree = ""; }; + A7BD7665247CCAA80062A6B3 /* APIExample-Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "APIExample-Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + A7BD7667247CCAA80062A6B3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A7BD766B247CCAAA0062A6B3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A7BD766E247CCAAA0062A6B3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A7BD7670247CCAAA0062A6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7BD7671247CCAAA0062A6B3 /* APIExample_Mac.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = APIExample_Mac.entitlements; sourceTree = ""; }; A7CA48C324553CF600507435 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Popover.storyboard; sourceTree = ""; }; A7CA48C524553D3500507435 /* VideoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoView.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -92,6 +105,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A7BD7662247CCAA80062A6B3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -146,6 +166,7 @@ isa = PBXGroup; children = ( 03D13BCE2448758900B599B3 /* APIExample */, + A7BD7666247CCAA80062A6B3 /* APIExample-Mac */, 03D13BCD2448758900B599B3 /* Products */, 03BCEC5624494F3900ED7177 /* Frameworks */, FD17F473C6A05604A44BDDDE /* Pods */, @@ -156,6 +177,7 @@ isa = PBXGroup; children = ( 03D13BCC2448758900B599B3 /* APIExample.app */, + A7BD7665247CCAA80062A6B3 /* APIExample-Mac.app */, ); name = Products; sourceTree = ""; @@ -182,6 +204,7 @@ A7CA48C524553D3500507435 /* VideoView.swift */, 03BCEC4F244938C500ED7177 /* BaseViewController.swift */, 03BCEC752449EB4F00ED7177 /* LogViewController.swift */, + A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */, ); path = Common; sourceTree = ""; @@ -193,6 +216,18 @@ path = Quality; sourceTree = ""; }; + A7BD7666247CCAA80062A6B3 /* APIExample-Mac */ = { + isa = PBXGroup; + children = ( + A7BD7667247CCAA80062A6B3 /* AppDelegate.swift */, + A7BD766B247CCAAA0062A6B3 /* Assets.xcassets */, + A7BD766D247CCAAA0062A6B3 /* Main.storyboard */, + A7BD7670247CCAAA0062A6B3 /* Info.plist */, + A7BD7671247CCAAA0062A6B3 /* APIExample_Mac.entitlements */, + ); + path = "APIExample-Mac"; + sourceTree = ""; + }; A7CA48BF2455315A00507435 /* Supporting Files */ = { isa = PBXGroup; children = ( @@ -235,19 +270,39 @@ productReference = 03D13BCC2448758900B599B3 /* APIExample.app */; productType = "com.apple.product-type.application"; }; + A7BD7664247CCAA80062A6B3 /* APIExample-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7BD7672247CCAAA0062A6B3 /* Build configuration list for PBXNativeTarget "APIExample-Mac" */; + buildPhases = ( + A7BD7661247CCAA80062A6B3 /* Sources */, + A7BD7662247CCAA80062A6B3 /* Frameworks */, + A7BD7663247CCAA80062A6B3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "APIExample-Mac"; + productName = "APIExample-Mac"; + productReference = A7BD7665247CCAA80062A6B3 /* APIExample-Mac.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 03D13BC42448758900B599B3 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1130; + LastSwiftUpdateCheck = 1120; LastUpgradeCheck = 1130; ORGANIZATIONNAME = "Agora Corp"; TargetAttributes = { 03D13BCB2448758900B599B3 = { CreatedOnToolsVersion = 11.3.1; }; + A7BD7664247CCAA80062A6B3 = { + CreatedOnToolsVersion = 11.2.1; + }; }; }; buildConfigurationList = 03D13BC72448758900B599B3 /* Build configuration list for PBXProject "APIExample" */; @@ -264,6 +319,7 @@ projectRoot = ""; targets = ( 03D13BCB2448758900B599B3 /* APIExample */, + A7BD7664247CCAA80062A6B3 /* APIExample-Mac */, ); }; /* End PBXProject section */ @@ -280,6 +336,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A7BD7663247CCAA80062A6B3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7BD766C247CCAAA0062A6B3 /* Assets.xcassets in Resources */, + A7BD766F247CCAAA0062A6B3 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -331,6 +396,7 @@ files = ( 03D13BD42448758900B599B3 /* ViewController.swift in Sources */, 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */, + A7BD7660247CC6920062A6B3 /* UITypeAlias.swift in Sources */, 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */, 03BCEC7124497B7000ED7177 /* RTMPStreaming.swift in Sources */, 03BCEC7224497B7000ED7177 /* JoinChannelVideo.swift in Sources */, @@ -344,6 +410,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A7BD7661247CCAA80062A6B3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7BD7675247CCAC80062A6B3 /* ViewController.swift in Sources */, + A7BD7668247CCAA80062A6B3 /* AppDelegate.swift in Sources */, + A7BD7689247E17A30062A6B3 /* UITypeAlias.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ @@ -363,6 +439,14 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + A7BD766D247CCAAA0062A6B3 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A7BD766E247CCAAA0062A6B3 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; A7CA48C224553CF600507435 /* Popover.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -540,6 +624,50 @@ }; name = Release; }; + A7BD7673247CCAAA0062A6B3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "APIExample-Mac/APIExample_Mac.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = URLGNR2V35; + ENABLE_HARDENED_RUNTIME = YES; + INFOPLIST_FILE = "APIExample-Mac/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = "CavanSu.APIExample-Mac"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + A7BD7674247CCAAA0062A6B3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "APIExample-Mac/APIExample_Mac.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = URLGNR2V35; + ENABLE_HARDENED_RUNTIME = YES; + INFOPLIST_FILE = "APIExample-Mac/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = "CavanSu.APIExample-Mac"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -561,6 +689,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + A7BD7672247CCAAA0062A6B3 /* Build configuration list for PBXNativeTarget "APIExample-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7BD7673247CCAAA0062A6B3 /* Debug */, + A7BD7674247CCAAA0062A6B3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 03D13BC42448758900B599B3 /* Project object */; diff --git a/iOS/APIExample/Common/BaseViewController.swift b/iOS/APIExample/Common/BaseViewController.swift index 928b32306..d1d1f06fd 100644 --- a/iOS/APIExample/Common/BaseViewController.swift +++ b/iOS/APIExample/Common/BaseViewController.swift @@ -10,12 +10,14 @@ import Foundation import UIKit import AGEVideoLayout -class BaseViewController: UIViewController { +class BaseViewController: AGViewController { override func viewDidLoad() { + #if os(iOS) self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Show Log", style: .plain, target: self, action: #selector(showLog)) + #endif LogUtils.removeAll() } @@ -33,13 +35,9 @@ class BaseViewController: UIViewController { } } -class RenderViewController: UIViewController { +class RenderViewController: AGViewController { private var streamViews: [UIView]? - override func viewDidLoad() { - super.viewDidLoad() - } - func layoutStream(views: [UIView]) { self.streamViews = views let container = self.view as! AGEVideoContainer @@ -77,7 +75,7 @@ class BasicVideoViewController: BaseViewController { super.viewDidLoad() } - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + override func prepare(for segue: AGStoryboardSegue, sender: Any?) { guard let identifier = segue.identifier else { return } diff --git a/iOS/APIExample/Common/UITypeAlias.swift b/iOS/APIExample/Common/UITypeAlias.swift new file mode 100644 index 000000000..5686cded0 --- /dev/null +++ b/iOS/APIExample/Common/UITypeAlias.swift @@ -0,0 +1,799 @@ +// +// UITypeAlias.swift +// APIExample +// +// Created by CavanSu on 2020/5/26. +// Copyright © 2020 Agora Corp. All rights reserved. +// + +#if os(iOS) +import UIKit +#else +import Cocoa +#endif + +//MARK: - Color +#if os(iOS) +typealias AGColor = UIColor +#else +typealias AGColor = NSColor +#endif +extension AGColor { + convenience init(hex: Int, alpha: CGFloat = 1) { + func transform(_ input: Int, offset: Int = 0) -> CGFloat { + let value = (input >> offset) & 0xff + return CGFloat(value) / 255 + } + + self.init(red: transform(hex, offset: 16), + green: transform(hex, offset: 8), + blue: transform(hex), + alpha: alpha) + } + + func rgbValue() -> (red: CGFloat, green: CGFloat, blue: CGFloat) { + var red: CGFloat = 0 + var green: CGFloat = 0 + var blue: CGFloat = 0 + + getRed(&red, green: &green, blue: &blue, alpha: nil) + + return (red * 255, green * 255, blue * 255) + } + + convenience init(hex: String, alpha: CGFloat = 1) { + var cString: String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() + + if (cString.hasPrefix("#")) { + let range = cString.index(after: cString.startIndex) ..< cString.endIndex + cString = String(cString[range]) + } + if (cString.hasPrefix("0X")) { + let range = cString.index(cString.startIndex, offsetBy: 2) ..< cString.endIndex + cString = String(cString[range]) + } + + + if (cString.count != 6) { + self.init() + return + } + + let scanner = Scanner(string: cString) + var hexValue: UInt64 = 0 + scanner.scanHexInt64(&hexValue) + self.init(hex: Int(hexValue), alpha: alpha) + } + + static func randomColor() -> AGColor { + let randomHex = Int(arc4random_uniform(0xCCCCCC) + 0x555555) + return AGColor(hex: randomHex) + } +} + +//MARK: - Font +#if os(iOS) +typealias AGFont = UIFont +#else +typealias AGFont = NSFont +#endif + +//MARK: - Image +#if os(iOS) +typealias AGImage = UIImage +#else +typealias AGImage = NSImage +#endif + +// MARK: - Label +#if os(iOS) +typealias AGLabel = UILabel +#else +typealias AGLabel = NSTextField +#endif +extension AGLabel { + var formattedFloatValue: Float { + get { + #if os(iOS) + if let text = text, let value = Double(text) { + return Float(value) + } else { + return 0 + } + #else + return floatValue + #endif + } + set { + #if os(iOS) + text = NSString(format: "%.1f", newValue) as String + #else + stringValue = NSString(format: "%.1f", newValue) as String + #endif + } + } + + var formattedCGFloatValue: CGFloat { + get { + #if os(iOS) + if let text = text, let value = Double(text) { + return CGFloat(value) + } else { + return 0 + } + #else + return CGFloat(floatValue) + #endif + } + set { + #if os(iOS) + text = NSString(format: "%.1f", newValue) as String + #else + stringValue = NSString(format: "%.1f", newValue) as String + #endif + } + } + + var formattedIntValue: Int { + get { + #if os(iOS) + if let text = text, let value = Int(text) { + return value + } else { + return 0 + } + #else + return integerValue + #endif + } + set { + #if os(iOS) + text = "\(newValue)" + #else + stringValue = "\(newValue)" + #endif + } + } + + #if os(macOS) + var text: String? { + get { + return stringValue + } + set { + if let newValue = newValue { + stringValue = newValue + } + } + } + #endif +} + +//MARK: - TextField +#if os(iOS) +typealias AGTextField = UITextField +#else +typealias AGTextField = NSTextField +#endif + +extension AGTextField { + #if os(iOS) + var integerValue: Int { + get { + if let text = text, let value = Int(text) { + return value + } else { + return 0 + } + } + set { + text = "\(newValue)" + } + } + + var formattedIntValue: Int { + get { + return integerValue + } + set { + integerValue = newValue + } + } + + var cgFloatValue: CGFloat { + get { + if let text = text, let value = Double(text) { + return CGFloat(value) + } else { + return 0 + } + } + set { + text = "\(newValue)" + } + } + + var formattedCGFloatValue: CGFloat { + get { + return CGFloat(cgFloatValue) + } + set { + cgFloatValue = newValue + } + } + + var formattedFloatValue: Float { + get { + if let text = text, let value = Double(text) { + return Float(value) + } else { + return 0 + } + } + set { + text = NSString(format: "%.1f", newValue) as String + } + } + + var stringValue: String { + get { + return text! + } + set { + text = newValue + } + } + #endif + var placeholderAGString: String? { + get { + #if os(iOS) + return placeholder + #else + return placeholderString + #endif + } + set { + #if os(iOS) + placeholder = placeholderAGString + #else + placeholderString = placeholderAGString + #endif + } + } +} + +//MARK: - Indicator +#if os(iOS) +typealias AGIndicator = UIActivityIndicatorView +#else +typealias AGIndicator = NSProgressIndicator +#endif + +extension AGIndicator { + + func startAnimation() { + #if os(iOS) + self.startAnimating() + #else + self.startAnimation(nil) + #endif + } + + func stopAnimation() { + #if os(iOS) + self.stopAnimating() + #else + self.stopAnimation(nil) + #endif + } + +} + +//MARK: - View +#if os(iOS) +typealias AGView = UIView +#else +typealias AGView = NSView +#endif +extension AGView { + var cornerRadius: CGFloat? { + get { + #if os(iOS) + return layer.cornerRadius + #else + return layer?.cornerRadius + #endif + } + set { + guard let newValue = newValue else { + return + } + #if os(iOS) + layer.cornerRadius = newValue + #else + wantsLayer = true + layer?.cornerRadius = newValue + #endif + } + } + + var masksToBounds: Bool? { + get { + #if os(iOS) + return layer.masksToBounds + #else + return layer?.masksToBounds + #endif + } + set { + guard let newValue = newValue else { + return + } + #if os(iOS) + layer.masksToBounds = newValue + #else + wantsLayer = true + layer?.masksToBounds = newValue + #endif + } + } + + var borderWidth: CGFloat { + get { + #if os(iOS) + return layer.borderWidth + #else + guard let borderWidth = layer?.borderWidth else { + return 0 + } + return borderWidth + #endif + } + set { + #if os(iOS) + layer.borderWidth = newValue + #else + wantsLayer = true + layer?.borderWidth = newValue + #endif + } + } + + var borderColor: CGColor { + get { + #if os(iOS) + guard let borderColor = layer.borderColor else { + return AGColor.clear.cgColor + } + return borderColor + #else + guard let borderColor = layer?.borderColor else { + return AGColor.clear.cgColor + } + return borderColor + #endif + } + set { + #if os(iOS) + layer.borderColor = newValue + #else + wantsLayer = true + layer?.borderColor = newValue + #endif + } + } + + #if os(macOS) + var backgroundColor: AGColor? { + get { + if let cgColor = layer?.backgroundColor { + return AGColor(cgColor: cgColor) + } else { + return nil + } + } + set { + if let newValue = newValue { + wantsLayer = true + layer?.backgroundColor = newValue.cgColor + } + } + } + + var center: CGPoint { + get { + return CGPoint(x: self.frame.width / 2, y: self.frame.height / 2) + } + set { + self.frame.origin = CGPoint(x: newValue.x - self.frame.width / 2, y: newValue.y - self.frame.height / 2) + } + } + #endif +} + + +#if os(iOS) +typealias AGVisualEffectView = UIVisualEffectView +#else +typealias AGVisualEffectView = NSVisualEffectView +#endif + +//MARK: - ImageView +#if os(iOS) +typealias AGImageView = UIImageView +#else +typealias AGImageView = NSImageView +#endif + +//MARK: - TableView +#if os(iOS) +typealias AGTableView = UITableView +#else +typealias AGTableView = NSTableView +#endif + +//MARK: - TableViewCell +#if os(iOS) +typealias AGTableViewCell = UITableViewCell +#else +typealias AGTableViewCell = NSTableCellView +#endif + +//MARK: - CollectionView +#if os(iOS) +typealias AGCollectionView = UICollectionView +#else +typealias AGCollectionView = NSCollectionView +#endif + +#if os(iOS) +typealias AGCollectionViewFlowLayout = UICollectionViewFlowLayout +#else +typealias AGCollectionViewFlowLayout = NSCollectionViewFlowLayout +#endif + +//MARK: - CollectionViewCell +#if os(iOS) +typealias AGCollectionViewCell = UICollectionViewCell +#else +typealias AGCollectionViewCell = NSCollectionViewItem +#endif + +extension AGCollectionViewCell { + #if os(OSX) + var contentView: AGView { + get { + return view + } + set { + view = newValue + } + } + #endif +} + +//MARK: - Button +#if os(iOS) +typealias AGButton = UIButton +#else +typealias AGButton = NSButton +#endif +extension AGButton { + #if os(iOS) + var image: AGImage? { + get { + return image(for: .normal) + } + set { + setImage(newValue, for: .normal) + } + } + var highlightImage: AGImage? { + get { + return image(for: .highlighted) + } + set { + setImage(newValue, for: .highlighted) + } + } + var title: String? { + get { + return title(for: .normal) + } + set { + setTitle(newValue, for: .normal) + } + } + + #else + var textColor: AGColor { + get { + return AGColor.black + } + set { + let pstyle = NSMutableParagraphStyle() + pstyle.alignment = .left + attributedTitle = NSAttributedString(string: title, attributes: [ NSAttributedString.Key.foregroundColor : newValue, NSAttributedString.Key.paragraphStyle : pstyle ]) + } + } + #endif + + func switchImage(toImage: AGImage) { + #if os(iOS) + UIView.animate(withDuration: 0.15, animations: { + self.isEnabled = false + self.alpha = 0.3 + }) { (_) in + self.image = toImage + self.alpha = 1.0 + self.isEnabled = true + } + #else + NSAnimationContext.runAnimationGroup({ (context) in + context.duration = 0.3 + self.isEnabled = false + self.animator().alphaValue = 0.3 + }) { + self.image = toImage + self.alphaValue = 1.0 + self.isEnabled = true + } + #endif + } +} + +//MARK: - Switch +#if os(iOS) +typealias AGSwitch = UISwitch +#else +typealias AGSwitch = NSButton +#endif +#if os(macOS) +extension AGSwitch { + var isOn: Bool { + get { + return state != .off + } + set { + state = newValue ? .on : .off + } + } +} +#endif + +//MARK: - WebView +#if os(iOS) +typealias AGWebView = UIWebView +#else +import WebKit +typealias AGWebView = WebView +#endif + +#if os(macOS) +extension AGWebView { + func loadRequest(_ request: URLRequest) { + self.mainFrame.load(request) + } +} +#endif + +//MARK: - Slider +#if os(iOS) +typealias AGSlider = UISlider +#else +typealias AGSlider = NSSlider +#endif +extension AGSlider { + #if os(iOS) + var floatValue: Float { + get { + return value + } + set { + setValue(newValue, animated: false) + } + } + var cgFloatValue: CGFloat { + get { + return CGFloat(value) + } + set { + setValue(Float(newValue), animated: false) + } + } + var integerValue: Int { + get { + return Int(value) + } + set { + setValue(Float(newValue), animated: false) + } + } + var doubleValue: Double { + get { + return Double(value) + } + set { + setValue(Float(newValue), animated: false) + } + } + #else + var minimumValue: Float { + get { + return Float(minValue) + } + set { + minValue = Double(newValue) + } + } + var maximumValue: Float { + get { + return Float(maxValue) + } + set { + maxValue = Double(newValue) + } + } + #endif +} + +//MARK: - SegmentedControl +#if os(iOS) +typealias AGPopSheetButton = UIButton +#else +typealias AGPopSheetButton = NSPopUpButton +#endif + +//MARK: - SegmentedControl +#if os(iOS) +typealias AGSegmentedControl = UISegmentedControl +#else +typealias AGSegmentedControl = NSPopUpButton +#endif +#if os(macOS) +extension AGSegmentedControl { + var selectedSegmentIndex: Int { + get { + return indexOfSelectedItem + } + set { + selectItem(at: newValue) + } + } +} +#endif + +//MARK: - StoryboardSegue +#if os(iOS) +typealias AGStoryboardSegue = UIStoryboardSegue +#else +typealias AGStoryboardSegue = NSStoryboardSegue +#endif +extension AGStoryboardSegue { + var identifierString: String? { + get { + #if os(iOS) + return identifier + #else + return identifier + #endif + } + } + + #if os(iOS) + var destinationController: AGViewController? { + get { + return destination + } + } + #endif +} + +//MARK: - Storyboard +#if os(iOS) +typealias AGStoryboard = UIStoryboard +#else +typealias AGStoryboard = NSStoryboard +#endif + +//MARK: - ViewController +#if os(iOS) +typealias AGViewController = UIViewController +#else +typealias AGViewController = NSViewController +#endif +extension AGViewController { + #if os(OSX) + var title: String? { + get { + return self.view.window?.title + } + set { + guard let title = newValue else { + return + } + self.view.window?.title = title + } + } + #endif + + func performAGSegue(withIdentifier identifier: String, sender: Any?) { + #if os(iOS) + performSegue(withIdentifier: identifier, sender: sender) + #else + performSegue(withIdentifier: identifier, sender: sender) + #endif + } + + func dismissVC(_ vc: AGViewController, animated: Bool) { + #if os(iOS) + vc.dismiss(animated: animated, completion: nil) + #else + dismiss(nil) + #endif + } +} + +//MARK: - TableViewController +#if os(iOS) +typealias AGTableViewController = UITableViewController +#else +typealias AGTableViewController = NSViewController +#endif + + +#if os(iOS) +typealias AGBezierPath = UIBezierPath +#else +typealias AGBezierPath = NSBezierPath +#endif + +extension AGBezierPath { + #if os(OSX) + func addLine(to point: CGPoint) { + var points = [point] + self.appendPoints(&points, count: 1) + } + + func addArc(withCenter center: CGPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool) { + self.appendArc(withCenter: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: clockwise) + } + #endif +} + +#if os(iOS) +typealias AGControl = UIControl +#else +typealias AGControl = NSControl +#endif + + +#if os(OSX) +extension String { + func buttonWhiteAttributedTitleString() -> NSAttributedString { + return buttonAttributedTitleStringWithColor(AGColor.white) + } + + func buttonBlueAttributedTitleString() -> NSAttributedString { + return buttonAttributedTitleStringWithColor(AGColor(hex: 0x00a0e9)) + } + + fileprivate func buttonAttributedTitleStringWithColor(_ color: AGColor) -> NSAttributedString { + let attributes = [NSAttributedString.Key.foregroundColor: color, NSAttributedString.Key.font: NSFont.systemFont(ofSize: 13)] + let attributedString = NSMutableAttributedString(string: self) + let range = NSMakeRange(0, attributedString.length) + attributedString.addAttributes(attributes, range: range) + attributedString.setAlignment(.center, range: range) + attributedString.fixAttributes(in: range) + + return attributedString + } +} +#endif + +#if os(iOS) +typealias AGApplication = UIApplication +#else +typealias AGApplication = NSApplication +#endif + diff --git a/iOS/APIExample/ViewController.swift b/iOS/APIExample/ViewController.swift index 0247c95fd..98556516d 100644 --- a/iOS/APIExample/ViewController.swift +++ b/iOS/APIExample/ViewController.swift @@ -6,7 +6,11 @@ // Copyright © 2020 Agora Corp. All rights reserved. // +#if os(iOS) import UIKit +#else +import Cocoa +#endif struct MenuSection { var name: String @@ -18,7 +22,7 @@ struct MenuItem { var controller: String } -class ViewController: UIViewController { +class ViewController: AGViewController { var menus:[MenuSection] = [ MenuSection(name: "Basic Video/Audio", rows: [ MenuItem(name: "Join a channel (Video)", controller: "JoinChannelVideo"), @@ -34,11 +38,20 @@ class ViewController: UIViewController { // ]) ] + #if os(macOS) + @IBOutlet weak var sectionTableView: NSTableView! + @IBOutlet weak var subTableView: NSTableView! + + var sectionSelected = 0 + override func viewDidLoad() { super.viewDidLoad() + sectionTableView.selectRowIndexes(IndexSet(integer: 0), byExtendingSelection: false) } + #endif } +#if os(iOS) extension ViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return menus[section].rows.count @@ -73,3 +86,41 @@ extension ViewController: UITableViewDelegate { self.navigationController?.pushViewController(newViewController, animated: true) } } + +#else +extension ViewController: NSTableViewDelegate, NSTableViewDataSource { + func numberOfRows(in tableView: NSTableView) -> Int { + if tableView == sectionTableView { + return menus.count + } else { + return menus[sectionSelected].rows.count + } + } + + func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool { + if tableView == sectionTableView { + sectionSelected = row + subTableView.reloadData() + } + return true + } + + func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { + if tableView == sectionTableView { + let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "SectionCell"), + owner: nil) as! NSTableCellView + cell.textField?.text = menus[row].name + return cell + } else { + let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "SubCell"), + owner: nil) as! NSTableCellView + cell.textField?.text = menus[sectionSelected].rows[row].name + return cell + } + } + + func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat { + return 36 + } +} +#endif From 6b281e2d0de7b8408db0ccefdb333398666223fe Mon Sep 17 00:00:00 2001 From: DongYifan Date: Wed, 27 May 2020 15:27:15 +0800 Subject: [PATCH 008/430] iOS video metadata sample --- iOS/APIExample.xcodeproj/project.pbxproj | 12 + iOS/APIExample/Base.lproj/Main.storyboard | 69 +++++- .../Advanced-Video/VideoMetadata.swift | 208 ++++++++++++++++++ iOS/APIExample/ViewController.swift | 3 + 4 files changed, 290 insertions(+), 2 deletions(-) create mode 100644 iOS/APIExample/Examples/Advanced-Video/VideoMetadata.swift diff --git a/iOS/APIExample.xcodeproj/project.pbxproj b/iOS/APIExample.xcodeproj/project.pbxproj index f04bed1c9..68271f14f 100644 --- a/iOS/APIExample.xcodeproj/project.pbxproj +++ b/iOS/APIExample.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 03D13BDC2448758B00B599B3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03D13BDA2448758B00B599B3 /* LaunchScreen.storyboard */; }; 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13C0024488F1E00B599B3 /* KeyCenter.swift */; }; 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */; }; + 84E60BE0247E1C6A00AA04AF /* VideoMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BDF247E1C6A00AA04AF /* VideoMetadata.swift */; }; A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7631169245AC15A00BABDE4 /* RTMPInjection.swift */; }; A7847F922458062900469187 /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; A7847F942458089E00469187 /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; @@ -65,6 +66,7 @@ 3EA7D4B4D7C9540659392B7F /* 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 = ""; }; 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinChannelAudio.swift; sourceTree = ""; }; 846AE4340F81DCC00B6F9543 /* Pods-APIExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample.release.xcconfig"; path = "Target Support Files/Pods-APIExample/Pods-APIExample.release.xcconfig"; sourceTree = ""; }; + 84E60BDF247E1C6A00AA04AF /* VideoMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoMetadata.swift; sourceTree = ""; }; A7631169245AC15A00BABDE4 /* RTMPInjection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; A7847F912458062900469187 /* StatisticsInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatisticsInfo.swift; sourceTree = ""; }; A7847F932458089E00469187 /* AgoraExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AgoraExtension.swift; sourceTree = ""; }; @@ -98,6 +100,7 @@ 03BCEC4C244932E000ED7177 /* Examples */ = { isa = PBXGroup; children = ( + 84E60BDE247E1BF400AA04AF /* Advanced-Video */, 03BCEC6F24497B7000ED7177 /* Basic-Video-Audio */, 03BCEC6D24497B6F00ED7177 /* Live-Broadcasting */, A7631168245AB89D00BABDE4 /* Quality */, @@ -186,6 +189,14 @@ path = Common; sourceTree = ""; }; + 84E60BDE247E1BF400AA04AF /* Advanced-Video */ = { + isa = PBXGroup; + children = ( + 84E60BDF247E1C6A00AA04AF /* VideoMetadata.swift */, + ); + path = "Advanced-Video"; + sourceTree = ""; + }; A7631168245AB89D00BABDE4 /* Quality */ = { isa = PBXGroup; children = ( @@ -338,6 +349,7 @@ A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */, 03D13BD02448758900B599B3 /* AppDelegate.swift in Sources */, A7847F922458062900469187 /* StatisticsInfo.swift in Sources */, + 84E60BE0247E1C6A00AA04AF /* VideoMetadata.swift in Sources */, 03BCEC762449EB5000ED7177 /* LogViewController.swift in Sources */, A7847F942458089E00469187 /* AgoraExtension.swift in Sources */, 03BCEC50244938C500ED7177 /* BaseViewController.swift in Sources */, diff --git a/iOS/APIExample/Base.lproj/Main.storyboard b/iOS/APIExample/Base.lproj/Main.storyboard index 9b84963e0..54a836125 100644 --- a/iOS/APIExample/Base.lproj/Main.storyboard +++ b/iOS/APIExample/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - + @@ -121,6 +121,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -356,6 +421,6 @@ - + diff --git a/iOS/APIExample/Examples/Advanced-Video/VideoMetadata.swift b/iOS/APIExample/Examples/Advanced-Video/VideoMetadata.swift new file mode 100644 index 000000000..4c15cadbf --- /dev/null +++ b/iOS/APIExample/Examples/Advanced-Video/VideoMetadata.swift @@ -0,0 +1,208 @@ +// +// VideoMetadata.swift +// APIExample +// +// Created by Dong Yifan on 2020/5/27. +// Copyright © 2020 Agora Corp. All rights reserved. +// +import Foundation +import UIKit +import AgoraRtcKit + +class VideoMetadataMain: BasicVideoViewController { + @IBOutlet weak var joinButton: UIButton! + @IBOutlet weak var channelTextField: UITextField! + @IBOutlet weak var sendMetadataButton: UIButton! + + var localVideo = VideoView(frame: CGRect.zero) + var remoteVideo = VideoView(frame: CGRect.zero) + + var agoraKit: AgoraRtcEngineKit! + + // indicate if current instance has joined channel + var isJoined: Bool = false { + didSet { + channelTextField.isEnabled = !isJoined + joinButton.isHidden = isJoined + sendMetadataButton.isHidden = !isJoined + } + } + + // video metadata to be sent later + var metadata: Data? + // metadata lenght limitation + let MAX_META_LENGTH = 1024 + + override func viewDidLoad(){ + super.viewDidLoad() + + sendMetadataButton.isHidden = true + + // layout render view + renderVC.layoutStream(views: [localVideo, remoteVideo]) + + // set up agora instance when view loaded + agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) + + // register metadata delegate and datasource + agoraKit.setMediaMetadataDataSource(self, with: .video) + agoraKit.setMediaMetadataDelegate(self, with: .video) + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + // leave channel when exiting the view + if(isJoined) { + agoraKit.leaveChannel { (stats) -> Void in + LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + } + } + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + view.endEditing(true) + } + + /// callback when join button hit + @IBAction func onJoin(){ + guard let channelName = channelTextField.text else {return} + + //hide keyboard + channelTextField.resignFirstResponder() + + // enable video module and set up video encoding configs + agoraKit.enableVideo() + agoraKit.setVideoEncoderConfiguration(AgoraVideoEncoderConfiguration(size: AgoraVideoDimension640x360, + frameRate: .fps15, + bitrate: AgoraVideoBitrateStandard, + orientationMode: .adaptative)) + + // set up local video to render your local camera preview + let videoCanvas = AgoraRtcVideoCanvas() + videoCanvas.uid = 0 + // the view to be binded + videoCanvas.view = localVideo.videoView + videoCanvas.renderMode = .hidden + agoraKit.setupLocalVideo(videoCanvas) + + // Set audio route to speaker + agoraKit.setDefaultAudioRouteToSpeakerphone(true) + + // start joining channel + // 1. Users can only see each other after they join the + // same channel successfully using the same app id. + // 2. If app certificate is turned on at dashboard, token is needed + // when joining channel. The channel name and uid used to calculate + // the token has to match the ones used for channel join + let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in + self.isJoined = true + LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + } + if(result != 0) { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + } + } + + /// callback when send metadata button hit + @IBAction func onSendMetadata() { + self.metadata = "\(Date())".data(using: .utf8) + } + +} + +/// agora rtc engine delegate events +extension VideoMetadataMain: AgoraRtcEngineDelegate { + /// callback when warning occured for agora sdk, warning can usually be ignored, still it's nice to check out + /// what is happening + /// Warning code description can be found at: + /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html + /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html + /// @param warningCode warning code of the problem + func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { + LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + } + + /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand + /// to let user know something wrong is happening + /// Error code description can be found at: + /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + /// @param errorCode error code of the problem + func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { + LogUtils.log(msg: "error: \(errorCode)", level: .error) + self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") + } + + /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event + /// @param uid uid of remote joined user + /// @param elapsed time elapse since current sdk instance join the channel in ms + func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { + LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + + // Only one remote video view is available for this + // tutorial. Here we check if there exists a surface + // view tagged as this uid. + let videoCanvas = AgoraRtcVideoCanvas() + videoCanvas.uid = uid + // the view to be binded + videoCanvas.view = remoteVideo.videoView + videoCanvas.renderMode = .hidden + agoraKit.setupRemoteVideo(videoCanvas) + } + + /// callback when a remote user is leaving the channel, note audience in live broadcast mode will NOT trigger this event + /// @param uid uid of remote joined user + /// @param reason reason why this user left, note this event may be triggered when the remote user + /// become an audience in live broadcasting profile + func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { + LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) + + // to unlink your view from sdk, so that your view reference will be released + // note the video will stay at its last frame, to completely remove it + // you will need to remove the EAGL sublayer from your binded view + let videoCanvas = AgoraRtcVideoCanvas() + videoCanvas.uid = uid + // the view to be binded + videoCanvas.view = nil + videoCanvas.renderMode = .hidden + agoraKit.setupRemoteVideo(videoCanvas) + } +} + +/// AgoraMediaMetadataDelegate and AgoraMediaMetadataDataSource +extension VideoMetadataMain : AgoraMediaMetadataDelegate, AgoraMediaMetadataDataSource { + func metadataMaxSize() -> Int { + // the data to send should not exceed this size + return MAX_META_LENGTH + } + + func readyToSendMetadata(atTimestamp timestamp: TimeInterval) -> Data? { + guard let metadata = self.metadata else {return nil} + + // clear self.metadata to nil after any success send to avoid redundancy + self.metadata = nil + + if(metadata.count > MAX_META_LENGTH) { + //if data exceeding limit, return nil to not send anything + print("invalid metadata: length exceeds \(MAX_META_LENGTH)") + return nil + } + + print("metadata sent") + self.metadata = nil + return metadata + } + + func receiveMetadata(_ data: Data, fromUser uid: Int, atTimestamp timestamp: TimeInterval) { + let alert = UIAlertController(title: "Metadata received", message: String(data: data, encoding: .utf8), preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) + DispatchQueue.main.async { + self.present(alert, animated: true, completion: nil) + } + } + +} diff --git a/iOS/APIExample/ViewController.swift b/iOS/APIExample/ViewController.swift index 0247c95fd..0978515ba 100644 --- a/iOS/APIExample/ViewController.swift +++ b/iOS/APIExample/ViewController.swift @@ -28,6 +28,9 @@ class ViewController: UIViewController { MenuItem(name: "RTMP Streaming", controller: "RTMPStreaming"), MenuItem(name: "RTMP Injection", controller: "RTMPInjection") ]), + MenuSection(name: "Anvanced Video", rows: [ + MenuItem(name: "Video metadata", controller: "VideoMetadata") + ]), // MenuSection(name: "Quality Metrics", rows: [ // MenuItem(name: "Lastmile Test", controller: "Lastmile"), // MenuItem(name: "Realtime Stats", controller: "RealtimeStats") From 89aef42cb080ba0543c4107c9eab0cfb8a890310 Mon Sep 17 00:00:00 2001 From: DongYifan Date: Wed, 27 May 2020 16:40:52 +0800 Subject: [PATCH 009/430] reconstruct files to 2 category: Basic and Advanced --- iOS/APIExample.xcodeproj/project.pbxproj | 68 +++++++------------ .../RTMPInjection.swift | 0 .../RTMPStreaming.swift | 0 .../VideoMetadata.swift | 0 .../JoinChannelAudio.swift | 0 .../JoinChannelVideo.swift | 0 iOS/APIExample/ViewController.swift | 8 +-- 7 files changed, 29 insertions(+), 47 deletions(-) rename iOS/APIExample/Examples/{Live-Broadcasting => Advanced}/RTMPInjection.swift (100%) rename iOS/APIExample/Examples/{Live-Broadcasting => Advanced}/RTMPStreaming.swift (100%) rename iOS/APIExample/Examples/{Advanced-Video => Advanced}/VideoMetadata.swift (100%) rename iOS/APIExample/Examples/{Basic-Video-Audio => Basic}/JoinChannelAudio.swift (100%) rename iOS/APIExample/Examples/{Basic-Video-Audio => Basic}/JoinChannelVideo.swift (100%) diff --git a/iOS/APIExample.xcodeproj/project.pbxproj b/iOS/APIExample.xcodeproj/project.pbxproj index 68271f14f..3267be313 100644 --- a/iOS/APIExample.xcodeproj/project.pbxproj +++ b/iOS/APIExample.xcodeproj/project.pbxproj @@ -19,8 +19,6 @@ 03BCEC6824494F7A00ED7177 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03BCEC6724494F7A00ED7177 /* SystemConfiguration.framework */; }; 03BCEC6B24494FC300ED7177 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 03BCEC6924494F8E00ED7177 /* libc++.tbd */; }; 03BCEC6C24494FCA00ED7177 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 03BCEC6A24494F9700ED7177 /* libresolv.tbd */; }; - 03BCEC7124497B7000ED7177 /* RTMPStreaming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC6E24497B6F00ED7177 /* RTMPStreaming.swift */; }; - 03BCEC7224497B7000ED7177 /* JoinChannelVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */; }; 03BCEC762449EB5000ED7177 /* LogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC752449EB4F00ED7177 /* LogViewController.swift */; }; 03D13BD02448758900B599B3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13BCF2448758900B599B3 /* AppDelegate.swift */; }; 03D13BD42448758900B599B3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13BD32448758900B599B3 /* ViewController.swift */; }; @@ -28,9 +26,11 @@ 03D13BD92448758B00B599B3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03D13BD82448758B00B599B3 /* Assets.xcassets */; }; 03D13BDC2448758B00B599B3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03D13BDA2448758B00B599B3 /* LaunchScreen.storyboard */; }; 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13C0024488F1E00B599B3 /* KeyCenter.swift */; }; - 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */; }; - 84E60BE0247E1C6A00AA04AF /* VideoMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BDF247E1C6A00AA04AF /* VideoMetadata.swift */; }; - A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7631169245AC15A00BABDE4 /* RTMPInjection.swift */; }; + 84E60BE8247E5C7300AA04AF /* JoinChannelVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BE6247E5C7300AA04AF /* JoinChannelVideo.swift */; }; + 84E60BE9247E5C7300AA04AF /* JoinChannelAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BE7247E5C7300AA04AF /* JoinChannelAudio.swift */; }; + 84E60BEE247E5C8000AA04AF /* RTMPStreaming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BEB247E5C8000AA04AF /* RTMPStreaming.swift */; }; + 84E60BEF247E5C8000AA04AF /* VideoMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BEC247E5C8000AA04AF /* VideoMetadata.swift */; }; + 84E60BF0247E5C8000AA04AF /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E60BED247E5C8000AA04AF /* RTMPInjection.swift */; }; A7847F922458062900469187 /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; A7847F942458089E00469187 /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; A7CA48C424553CF700507435 /* Popover.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7CA48C224553CF600507435 /* Popover.storyboard */; }; @@ -51,8 +51,6 @@ 03BCEC6724494F7A00ED7177 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 03BCEC6924494F8E00ED7177 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 03BCEC6A24494F9700ED7177 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; - 03BCEC6E24497B6F00ED7177 /* RTMPStreaming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RTMPStreaming.swift; sourceTree = ""; }; - 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JoinChannelVideo.swift; sourceTree = ""; }; 03BCEC752449EB4F00ED7177 /* LogViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogViewController.swift; sourceTree = ""; }; 03D13BCC2448758900B599B3 /* APIExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APIExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 03D13BCF2448758900B599B3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -64,10 +62,12 @@ 03D13C0024488F1E00B599B3 /* KeyCenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyCenter.swift; sourceTree = ""; }; 07A781F5D5D3783CEC7C8EFA /* Pods_APIExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3EA7D4B4D7C9540659392B7F /* 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 = ""; }; - 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinChannelAudio.swift; sourceTree = ""; }; 846AE4340F81DCC00B6F9543 /* Pods-APIExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample.release.xcconfig"; path = "Target Support Files/Pods-APIExample/Pods-APIExample.release.xcconfig"; sourceTree = ""; }; - 84E60BDF247E1C6A00AA04AF /* VideoMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoMetadata.swift; sourceTree = ""; }; - A7631169245AC15A00BABDE4 /* RTMPInjection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; + 84E60BE6247E5C7300AA04AF /* JoinChannelVideo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JoinChannelVideo.swift; sourceTree = ""; }; + 84E60BE7247E5C7300AA04AF /* JoinChannelAudio.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JoinChannelAudio.swift; sourceTree = ""; }; + 84E60BEB247E5C8000AA04AF /* RTMPStreaming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RTMPStreaming.swift; sourceTree = ""; }; + 84E60BEC247E5C8000AA04AF /* VideoMetadata.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoMetadata.swift; sourceTree = ""; }; + 84E60BED247E5C8000AA04AF /* RTMPInjection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; A7847F912458062900469187 /* StatisticsInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatisticsInfo.swift; sourceTree = ""; }; A7847F932458089E00469187 /* AgoraExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AgoraExtension.swift; sourceTree = ""; }; A7CA48C324553CF600507435 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Popover.storyboard; sourceTree = ""; }; @@ -100,10 +100,8 @@ 03BCEC4C244932E000ED7177 /* Examples */ = { isa = PBXGroup; children = ( - 84E60BDE247E1BF400AA04AF /* Advanced-Video */, - 03BCEC6F24497B7000ED7177 /* Basic-Video-Audio */, - 03BCEC6D24497B6F00ED7177 /* Live-Broadcasting */, - A7631168245AB89D00BABDE4 /* Quality */, + 84E60BEA247E5C8000AA04AF /* Advanced */, + 84E60BE5247E5C7300AA04AF /* Basic */, ); path = Examples; sourceTree = ""; @@ -127,24 +125,6 @@ name = Frameworks; sourceTree = ""; }; - 03BCEC6D24497B6F00ED7177 /* Live-Broadcasting */ = { - isa = PBXGroup; - children = ( - 03BCEC6E24497B6F00ED7177 /* RTMPStreaming.swift */, - A7631169245AC15A00BABDE4 /* RTMPInjection.swift */, - ); - path = "Live-Broadcasting"; - sourceTree = ""; - }; - 03BCEC6F24497B7000ED7177 /* Basic-Video-Audio */ = { - isa = PBXGroup; - children = ( - 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */, - 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */, - ); - path = "Basic-Video-Audio"; - sourceTree = ""; - }; 03D13BC32448758900B599B3 = { isa = PBXGroup; children = ( @@ -189,19 +169,23 @@ path = Common; sourceTree = ""; }; - 84E60BDE247E1BF400AA04AF /* Advanced-Video */ = { + 84E60BE5247E5C7300AA04AF /* Basic */ = { isa = PBXGroup; children = ( - 84E60BDF247E1C6A00AA04AF /* VideoMetadata.swift */, + 84E60BE6247E5C7300AA04AF /* JoinChannelVideo.swift */, + 84E60BE7247E5C7300AA04AF /* JoinChannelAudio.swift */, ); - path = "Advanced-Video"; + path = Basic; sourceTree = ""; }; - A7631168245AB89D00BABDE4 /* Quality */ = { + 84E60BEA247E5C8000AA04AF /* Advanced */ = { isa = PBXGroup; children = ( + 84E60BEB247E5C8000AA04AF /* RTMPStreaming.swift */, + 84E60BED247E5C8000AA04AF /* RTMPInjection.swift */, + 84E60BEC247E5C8000AA04AF /* VideoMetadata.swift */, ); - path = Quality; + path = Advanced; sourceTree = ""; }; A7CA48BF2455315A00507435 /* Supporting Files */ = { @@ -341,15 +325,15 @@ buildActionMask = 2147483647; files = ( 03D13BD42448758900B599B3 /* ViewController.swift in Sources */, - 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */, 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */, - 03BCEC7124497B7000ED7177 /* RTMPStreaming.swift in Sources */, - 03BCEC7224497B7000ED7177 /* JoinChannelVideo.swift in Sources */, + 84E60BEE247E5C8000AA04AF /* RTMPStreaming.swift in Sources */, A7CA48C624553D3500507435 /* VideoView.swift in Sources */, - A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */, 03D13BD02448758900B599B3 /* AppDelegate.swift in Sources */, + 84E60BF0247E5C8000AA04AF /* RTMPInjection.swift in Sources */, + 84E60BE8247E5C7300AA04AF /* JoinChannelVideo.swift in Sources */, + 84E60BEF247E5C8000AA04AF /* VideoMetadata.swift in Sources */, A7847F922458062900469187 /* StatisticsInfo.swift in Sources */, - 84E60BE0247E1C6A00AA04AF /* VideoMetadata.swift in Sources */, + 84E60BE9247E5C7300AA04AF /* JoinChannelAudio.swift in Sources */, 03BCEC762449EB5000ED7177 /* LogViewController.swift in Sources */, A7847F942458089E00469187 /* AgoraExtension.swift in Sources */, 03BCEC50244938C500ED7177 /* BaseViewController.swift in Sources */, diff --git a/iOS/APIExample/Examples/Live-Broadcasting/RTMPInjection.swift b/iOS/APIExample/Examples/Advanced/RTMPInjection.swift similarity index 100% rename from iOS/APIExample/Examples/Live-Broadcasting/RTMPInjection.swift rename to iOS/APIExample/Examples/Advanced/RTMPInjection.swift diff --git a/iOS/APIExample/Examples/Live-Broadcasting/RTMPStreaming.swift b/iOS/APIExample/Examples/Advanced/RTMPStreaming.swift similarity index 100% rename from iOS/APIExample/Examples/Live-Broadcasting/RTMPStreaming.swift rename to iOS/APIExample/Examples/Advanced/RTMPStreaming.swift diff --git a/iOS/APIExample/Examples/Advanced-Video/VideoMetadata.swift b/iOS/APIExample/Examples/Advanced/VideoMetadata.swift similarity index 100% rename from iOS/APIExample/Examples/Advanced-Video/VideoMetadata.swift rename to iOS/APIExample/Examples/Advanced/VideoMetadata.swift diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelAudio.swift b/iOS/APIExample/Examples/Basic/JoinChannelAudio.swift similarity index 100% rename from iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelAudio.swift rename to iOS/APIExample/Examples/Basic/JoinChannelAudio.swift diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift b/iOS/APIExample/Examples/Basic/JoinChannelVideo.swift similarity index 100% rename from iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift rename to iOS/APIExample/Examples/Basic/JoinChannelVideo.swift diff --git a/iOS/APIExample/ViewController.swift b/iOS/APIExample/ViewController.swift index 0978515ba..8a54f8c8a 100644 --- a/iOS/APIExample/ViewController.swift +++ b/iOS/APIExample/ViewController.swift @@ -20,15 +20,13 @@ struct MenuItem { class ViewController: UIViewController { var menus:[MenuSection] = [ - MenuSection(name: "Basic Video/Audio", rows: [ + MenuSection(name: "Basic", rows: [ MenuItem(name: "Join a channel (Video)", controller: "JoinChannelVideo"), MenuItem(name: "Join a channel (Audio)", controller: "JoinChannelAudio") ]), - MenuSection(name: "Live Broadcasting", rows: [ + MenuSection(name: "Anvanced", rows: [ MenuItem(name: "RTMP Streaming", controller: "RTMPStreaming"), - MenuItem(name: "RTMP Injection", controller: "RTMPInjection") - ]), - MenuSection(name: "Anvanced Video", rows: [ + MenuItem(name: "RTMP Injection", controller: "RTMPInjection"), MenuItem(name: "Video metadata", controller: "VideoMetadata") ]), // MenuSection(name: "Quality Metrics", rows: [ From 635252c93a9eba75b0c89a4660109cd7ad1f6877 Mon Sep 17 00:00:00 2001 From: DongYifan Date: Wed, 27 May 2020 17:54:21 +0800 Subject: [PATCH 010/430] 1. Fix a issue that "Send metadata" button overlay with textfield on some devices 2. Add comment for readyToSendMetadata and receiveMetadata 3. Replace print with LogUtils.log --- iOS/APIExample/Base.lproj/Main.storyboard | 4 ++-- .../Examples/Advanced/VideoMetadata.swift | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/iOS/APIExample/Base.lproj/Main.storyboard b/iOS/APIExample/Base.lproj/Main.storyboard index 54a836125..7022b6d2e 100644 --- a/iOS/APIExample/Base.lproj/Main.storyboard +++ b/iOS/APIExample/Base.lproj/Main.storyboard @@ -151,7 +151,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample-Mac/Popover.storyboard b/iOS/APIExample-Mac/Popover.storyboard new file mode 100644 index 000000000..36bd4ffda --- /dev/null +++ b/iOS/APIExample-Mac/Popover.storyboard @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample.xcodeproj/project.pbxproj b/iOS/APIExample.xcodeproj/project.pbxproj index 519005dc5..a3b43ae78 100644 --- a/iOS/APIExample.xcodeproj/project.pbxproj +++ b/iOS/APIExample.xcodeproj/project.pbxproj @@ -29,6 +29,14 @@ 03D13BDC2448758B00B599B3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03D13BDA2448758B00B599B3 /* LaunchScreen.storyboard */; }; 03D13C0124488F1F00B599B3 /* KeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13C0024488F1E00B599B3 /* KeyCenter.swift */; }; 8407E0942472320800AC5DE8 /* JoinChannelAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */; }; + A70FE7B42489EEC000C38E3C /* JoinChannelVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC7024497B7000ED7177 /* JoinChannelVideo.swift */; }; + A70FE7B52489EEEA00C38E3C /* VideoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA48C524553D3500507435 /* VideoView.swift */; }; + A70FE7B62489EF3800C38E3C /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; + A70FE7B72489EFC200C38E3C /* KeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D13C0024488F1E00B599B3 /* KeyCenter.swift */; }; + A70FE7B82489F04500C38E3C /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; + A7584AF02480B4FE0088FACB /* Popover.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7584AEF2480B4FE0088FACB /* Popover.storyboard */; }; + A7584B052480C0F80088FACB /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC4F244938C500ED7177 /* BaseViewController.swift */; }; + A7584B062480E18A0088FACB /* LogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BCEC752449EB4F00ED7177 /* LogViewController.swift */; }; A763116A245AC15A00BABDE4 /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7631169245AC15A00BABDE4 /* RTMPInjection.swift */; }; A7847F922458062900469187 /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; A7847F942458089E00469187 /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; @@ -40,6 +48,7 @@ A7BD7689247E17A30062A6B3 /* UITypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */; }; A7CA48C424553CF700507435 /* Popover.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7CA48C224553CF600507435 /* Popover.storyboard */; }; A7CA48C624553D3500507435 /* VideoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA48C524553D3500507435 /* VideoView.swift */; }; + D1CBEEA1D6DD6EA134E4DDE9 /* Pods_APIExample_Mac.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 960FD7C836F90E68E6776106 /* Pods_APIExample_Mac.framework */; }; D4046B5D3DE984062E3F6D92 /* Pods_APIExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07A781F5D5D3783CEC7C8EFA /* Pods_APIExample.framework */; }; /* End PBXBuildFile section */ @@ -68,9 +77,13 @@ 03D13BDD2448758B00B599B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 03D13C0024488F1E00B599B3 /* KeyCenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyCenter.swift; sourceTree = ""; }; 07A781F5D5D3783CEC7C8EFA /* Pods_APIExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3C49960D6F11D44FA9A62337 /* Pods-APIExample-Mac.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample-Mac.debug.xcconfig"; path = "Target Support Files/Pods-APIExample-Mac/Pods-APIExample-Mac.debug.xcconfig"; sourceTree = ""; }; 3EA7D4B4D7C9540659392B7F /* 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 = ""; }; 8407E0932472320800AC5DE8 /* JoinChannelAudio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinChannelAudio.swift; sourceTree = ""; }; 846AE4340F81DCC00B6F9543 /* Pods-APIExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample.release.xcconfig"; path = "Target Support Files/Pods-APIExample/Pods-APIExample.release.xcconfig"; sourceTree = ""; }; + 92FF830485692225436E2D77 /* Pods-APIExample-Mac.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample-Mac.release.xcconfig"; path = "Target Support Files/Pods-APIExample-Mac/Pods-APIExample-Mac.release.xcconfig"; sourceTree = ""; }; + 960FD7C836F90E68E6776106 /* Pods_APIExample_Mac.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIExample_Mac.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A7584AEF2480B4FE0088FACB /* Popover.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Popover.storyboard; sourceTree = ""; }; A7631169245AC15A00BABDE4 /* RTMPInjection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; A7847F912458062900469187 /* StatisticsInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatisticsInfo.swift; sourceTree = ""; }; A7847F932458089E00469187 /* AgoraExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AgoraExtension.swift; sourceTree = ""; }; @@ -80,7 +93,6 @@ A7BD766B247CCAAA0062A6B3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; A7BD766E247CCAAA0062A6B3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; A7BD7670247CCAAA0062A6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A7BD7671247CCAAA0062A6B3 /* APIExample_Mac.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = APIExample_Mac.entitlements; sourceTree = ""; }; A7CA48C324553CF600507435 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Popover.storyboard; sourceTree = ""; }; A7CA48C524553D3500507435 /* VideoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoView.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -109,6 +121,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D1CBEEA1D6DD6EA134E4DDE9 /* Pods_APIExample_Mac.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -140,6 +153,7 @@ 03BCEC5924494F4600ED7177 /* AudioToolbox.framework */, 03BCEC5724494F3A00ED7177 /* Accelerate.framework */, 07A781F5D5D3783CEC7C8EFA /* Pods_APIExample.framework */, + 960FD7C836F90E68E6776106 /* Pods_APIExample_Mac.framework */, ); name = Frameworks; sourceTree = ""; @@ -209,6 +223,16 @@ path = Common; sourceTree = ""; }; + A70FE7B92489F07000C38E3C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + A7BD7667247CCAA80062A6B3 /* AppDelegate.swift */, + A7BD766B247CCAAA0062A6B3 /* Assets.xcassets */, + A7BD7670247CCAAA0062A6B3 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; A7631168245AB89D00BABDE4 /* Quality */ = { isa = PBXGroup; children = ( @@ -219,11 +243,9 @@ A7BD7666247CCAA80062A6B3 /* APIExample-Mac */ = { isa = PBXGroup; children = ( - A7BD7667247CCAA80062A6B3 /* AppDelegate.swift */, - A7BD766B247CCAAA0062A6B3 /* Assets.xcassets */, A7BD766D247CCAAA0062A6B3 /* Main.storyboard */, - A7BD7670247CCAAA0062A6B3 /* Info.plist */, - A7BD7671247CCAAA0062A6B3 /* APIExample_Mac.entitlements */, + A7584AEF2480B4FE0088FACB /* Popover.storyboard */, + A70FE7B92489F07000C38E3C /* Supporting Files */, ); path = "APIExample-Mac"; sourceTree = ""; @@ -244,6 +266,8 @@ children = ( 3EA7D4B4D7C9540659392B7F /* Pods-APIExample.debug.xcconfig */, 846AE4340F81DCC00B6F9543 /* Pods-APIExample.release.xcconfig */, + 3C49960D6F11D44FA9A62337 /* Pods-APIExample-Mac.debug.xcconfig */, + 92FF830485692225436E2D77 /* Pods-APIExample-Mac.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -274,9 +298,11 @@ isa = PBXNativeTarget; buildConfigurationList = A7BD7672247CCAAA0062A6B3 /* Build configuration list for PBXNativeTarget "APIExample-Mac" */; buildPhases = ( + 8966A57798E678D277A97872 /* [CP] Check Pods Manifest.lock */, A7BD7661247CCAA80062A6B3 /* Sources */, A7BD7662247CCAA80062A6B3 /* Frameworks */, A7BD7663247CCAA80062A6B3 /* Resources */, + 6456D1C22C04E72264E1E45E /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -341,6 +367,7 @@ buildActionMask = 2147483647; files = ( A7BD766C247CCAAA0062A6B3 /* Assets.xcassets in Resources */, + A7584AF02480B4FE0088FACB /* Popover.storyboard in Resources */, A7BD766F247CCAAA0062A6B3 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -387,6 +414,45 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 6456D1C22C04E72264E1E45E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-APIExample-Mac/Pods-APIExample-Mac-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-APIExample-Mac/Pods-APIExample-Mac-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-APIExample-Mac/Pods-APIExample-Mac-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 8966A57798E678D277A97872 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-APIExample-Mac-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -415,7 +481,14 @@ buildActionMask = 2147483647; files = ( A7BD7675247CCAC80062A6B3 /* ViewController.swift in Sources */, + A70FE7B52489EEEA00C38E3C /* VideoView.swift in Sources */, + A70FE7B42489EEC000C38E3C /* JoinChannelVideo.swift in Sources */, + A7584B062480E18A0088FACB /* LogViewController.swift in Sources */, + A7584B052480C0F80088FACB /* BaseViewController.swift in Sources */, A7BD7668247CCAA80062A6B3 /* AppDelegate.swift in Sources */, + A70FE7B62489EF3800C38E3C /* StatisticsInfo.swift in Sources */, + A70FE7B72489EFC200C38E3C /* KeyCenter.swift in Sources */, + A70FE7B82489F04500C38E3C /* AgoraExtension.swift in Sources */, A7BD7689247E17A30062A6B3 /* UITypeAlias.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -626,21 +699,23 @@ }; A7BD7673247CCAAA0062A6B3 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 3C49960D6F11D44FA9A62337 /* Pods-APIExample-Mac.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = "APIExample-Mac/APIExample_Mac.entitlements"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = URLGNR2V35; - ENABLE_HARDENED_RUNTIME = YES; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = NO; INFOPLIST_FILE = "APIExample-Mac/Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - PRODUCT_BUNDLE_IDENTIFIER = "CavanSu.APIExample-Mac"; + PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.example-mac"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_VERSION = 5.0; }; @@ -648,21 +723,23 @@ }; A7BD7674247CCAAA0062A6B3 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 92FF830485692225436E2D77 /* Pods-APIExample-Mac.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = "APIExample-Mac/APIExample_Mac.entitlements"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = URLGNR2V35; - ENABLE_HARDENED_RUNTIME = YES; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = NO; INFOPLIST_FILE = "APIExample-Mac/Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - PRODUCT_BUNDLE_IDENTIFIER = "CavanSu.APIExample-Mac"; + PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.example-mac"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_VERSION = 5.0; }; diff --git a/iOS/APIExample/Base.lproj/Main.storyboard b/iOS/APIExample/Base.lproj/Main.storyboard index 9b84963e0..3d4680c89 100644 --- a/iOS/APIExample/Base.lproj/Main.storyboard +++ b/iOS/APIExample/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - + @@ -133,7 +133,7 @@ - + diff --git a/iOS/APIExample/Base.lproj/Popover.storyboard b/iOS/APIExample/Base.lproj/Popover.storyboard index 632ce5c0b..6d2920f57 100644 --- a/iOS/APIExample/Base.lproj/Popover.storyboard +++ b/iOS/APIExample/Base.lproj/Popover.storyboard @@ -1,9 +1,9 @@ - + - + @@ -22,7 +22,7 @@ - + diff --git a/iOS/APIExample/Common/BaseViewController.swift b/iOS/APIExample/Common/BaseViewController.swift index d1d1f06fd..ce663bf28 100644 --- a/iOS/APIExample/Common/BaseViewController.swift +++ b/iOS/APIExample/Common/BaseViewController.swift @@ -6,11 +6,24 @@ // Copyright © 2020 Agora Corp. All rights reserved. // -import Foundation +#if os(iOS) import UIKit +#else +import Cocoa +#endif import AGEVideoLayout +#if os(macOS) +protocol ViewControllerCloseDelegate: NSObjectProtocol { + func viewControllerNeedClose(_ liveVC: AGViewController) +} +#endif + class BaseViewController: AGViewController { + #if os(macOS) + var closeDelegate: ViewControllerCloseDelegate? + #endif + override func viewDidLoad() { #if os(iOS) self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Show Log", @@ -21,6 +34,7 @@ class BaseViewController: AGViewController { LogUtils.removeAll() } + #if os(iOS) @objc func showLog() { let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let newViewController = storyBoard.instantiateViewController(withIdentifier: "LogViewController") @@ -33,12 +47,13 @@ class BaseViewController: AGViewController { alertController.addAction(action) self.present(alertController, animated: true, completion: nil) } + #endif } class RenderViewController: AGViewController { - private var streamViews: [UIView]? + private var streamViews: [AGView]? - func layoutStream(views: [UIView]) { + func layoutStream(views: [AGView]) { self.streamViews = views let container = self.view as! AGEVideoContainer let count = views.count @@ -82,7 +97,7 @@ class BasicVideoViewController: BaseViewController { switch identifier { case "RenderViewController": - let vc = segue.destination as! RenderViewController + let vc = segue.destinationController as! RenderViewController renderVC = vc default: break diff --git a/iOS/APIExample/Common/KeyCenter.swift b/iOS/APIExample/Common/KeyCenter.swift index 0de8c2ad3..1b7de54eb 100644 --- a/iOS/APIExample/Common/KeyCenter.swift +++ b/iOS/APIExample/Common/KeyCenter.swift @@ -7,8 +7,8 @@ // struct KeyCenter { - static let AppId: String = <#Your App Id#> + static let AppId: String = "" // assign token to nil if you have not enabled app certificate - static var Token: String? = <#Temp Access Token#> + static var Token: String? = nil } diff --git a/iOS/APIExample/Common/LogViewController.swift b/iOS/APIExample/Common/LogViewController.swift index 07bf97e08..43eeb9aa7 100644 --- a/iOS/APIExample/Common/LogViewController.swift +++ b/iOS/APIExample/Common/LogViewController.swift @@ -6,8 +6,12 @@ // Copyright © 2020 Agora Corp. All rights reserved. // -import Foundation +#if os(iOS) import UIKit +#else +import Cocoa +#endif +import Foundation enum LogLevel { case info, warning, error @@ -40,10 +44,11 @@ class LogUtils { } } -class LogViewController: UIViewController { +class LogViewController: AGViewController { } +#if os(iOS) extension LogViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return LogUtils.logs.count @@ -65,3 +70,4 @@ extension LogViewController: UITableViewDataSource { return cell! } } +#endif diff --git a/iOS/APIExample/Common/VideoView.swift b/iOS/APIExample/Common/VideoView.swift index e46bc7e97..ac0cad564 100644 --- a/iOS/APIExample/Common/VideoView.swift +++ b/iOS/APIExample/Common/VideoView.swift @@ -6,14 +6,18 @@ // Copyright © 2016 Agora. All rights reserved. // +#if os(iOS) import UIKit +#else +import Cocoa +#endif -class VideoView: UIView { +class VideoView: AGView { - fileprivate(set) var videoView: UIView! + fileprivate(set) var videoView: AGView! - fileprivate var infoView: UIView! - fileprivate var infoLabel: UILabel! + fileprivate var infoView: AGView! + fileprivate var infoLabel: AGLabel! var isVideoMuted = false { didSet { @@ -24,7 +28,7 @@ class VideoView: UIView { override init(frame frameRect: CGRect) { super.init(frame: frameRect) translatesAutoresizingMaskIntoConstraints = false - backgroundColor = UIColor.white + backgroundColor = AGColor.white addVideoView() addInfoView() @@ -43,37 +47,39 @@ extension VideoView { private extension VideoView { func addVideoView() { - videoView = UIView() + videoView = AGView() videoView.translatesAutoresizingMaskIntoConstraints = false - videoView.backgroundColor = UIColor.clear + videoView.backgroundColor = AGColor.clear addSubview(videoView) - let videoViewH = NSLayoutConstraint.constraints(withVisualFormat: "H:|[video]|", options: [], metrics: nil, views: ["video": videoView]) - let videoViewV = NSLayoutConstraint.constraints(withVisualFormat: "V:|[video]|", options: [], metrics: nil, views: ["video": videoView]) + let videoViewH = NSLayoutConstraint.constraints(withVisualFormat: "H:|[video]|", options: [], metrics: nil, views: ["video": videoView!]) + let videoViewV = NSLayoutConstraint.constraints(withVisualFormat: "V:|[video]|", options: [], metrics: nil, views: ["video": videoView!]) NSLayoutConstraint.activate(videoViewH + videoViewV) } func addInfoView() { - infoView = UIView() + infoView = AGView() infoView.translatesAutoresizingMaskIntoConstraints = false - infoView.backgroundColor = UIColor.clear + infoView.backgroundColor = AGColor.clear addSubview(infoView) - let infoViewH = NSLayoutConstraint.constraints(withVisualFormat: "H:|[info]|", options: [], metrics: nil, views: ["info": infoView]) - let infoViewV = NSLayoutConstraint.constraints(withVisualFormat: "V:[info(==140)]|", options: [], metrics: nil, views: ["info": infoView]) + let infoViewH = NSLayoutConstraint.constraints(withVisualFormat: "H:|[info]|", options: [], metrics: nil, views: ["info": infoView!]) + let infoViewV = NSLayoutConstraint.constraints(withVisualFormat: "V:[info(==140)]|", options: [], metrics: nil, views: ["info": infoView!]) NSLayoutConstraint.activate(infoViewH + infoViewV) - func createInfoLabel() -> UILabel { - let label = UILabel() + func createInfoLabel() -> AGLabel { + let label = AGLabel() label.translatesAutoresizingMaskIntoConstraints = false label.text = " " + #if os(iOS) label.shadowOffset = CGSize(width: 0, height: 1) - label.shadowColor = UIColor.black + label.shadowColor = AGColor.black label.numberOfLines = 0 + #endif - label.font = UIFont.systemFont(ofSize: 12) - label.textColor = UIColor.white + label.font = AGFont.systemFont(ofSize: 12) + label.textColor = AGColor.white return label } @@ -84,8 +90,8 @@ private extension VideoView { let top: CGFloat = 20 let left: CGFloat = 10 - let labelV = NSLayoutConstraint.constraints(withVisualFormat: "V:|-(\(top))-[info]", options: [], metrics: nil, views: ["info": infoLabel]) - let labelH = NSLayoutConstraint.constraints(withVisualFormat: "H:|-(\(left))-[info]", options: [], metrics: nil, views: ["info": infoLabel]) + let labelV = NSLayoutConstraint.constraints(withVisualFormat: "V:|-(\(top))-[info]", options: [], metrics: nil, views: ["info": infoLabel!]) + let labelH = NSLayoutConstraint.constraints(withVisualFormat: "H:|-(\(left))-[info]", options: [], metrics: nil, views: ["info": infoLabel!]) NSLayoutConstraint.activate(labelV) NSLayoutConstraint.activate(labelH) } diff --git a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift index 5c1ae3b1a..ff1a0e06e 100644 --- a/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift +++ b/iOS/APIExample/Examples/Basic-Video-Audio/JoinChannelVideo.swift @@ -6,13 +6,17 @@ // Copyright © 2020 Agora Corp. All rights reserved. // -import Foundation +#if os(iOS) import UIKit +#else +import Cocoa +#endif + import AgoraRtcKit class JoinChannelVideoMain: BasicVideoViewController { - @IBOutlet weak var joinButton: UIButton! - @IBOutlet weak var channelTextField: UITextField! + @IBOutlet weak var joinButton: AGButton! + @IBOutlet weak var channelTextField: AGTextField! var localVideo = VideoView(frame: CGRect.zero) var remoteVideo = VideoView(frame: CGRect.zero) @@ -27,7 +31,7 @@ class JoinChannelVideoMain: BasicVideoViewController { } } - override func viewDidLoad(){ + override func viewDidLoad() { super.viewDidLoad() // layout render view renderVC.layoutStream(views: [localVideo, remoteVideo]) @@ -36,6 +40,7 @@ class JoinChannelVideoMain: BasicVideoViewController { agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) } + #if os(iOS) override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // leave channel when exiting the view @@ -50,8 +55,21 @@ class JoinChannelVideoMain: BasicVideoViewController { view.endEditing(true) } + #else + + override func viewWillDisappear() { + super.viewWillDisappear() + // leave channel when exiting the view + if(isJoined) { + agoraKit.leaveChannel { (stats) -> Void in + LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + } + } + } + #endif + /// callback when join button hit - @IBAction func onJoin(){ + @IBAction func doJoinPressed(sender: AGButton) { guard let channelName = channelTextField.text else {return} //hide keyboard @@ -72,8 +90,10 @@ class JoinChannelVideoMain: BasicVideoViewController { videoCanvas.renderMode = .hidden agoraKit.setupLocalVideo(videoCanvas) + #if os(iOS) // Set audio route to speaker agoraKit.setDefaultAudioRouteToSpeakerphone(true) + #endif // start joining channel // 1. Users can only see each other after they join the @@ -90,7 +110,9 @@ class JoinChannelVideoMain: BasicVideoViewController { // Error code description can be found at: // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html + #if os(iOS) self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + #endif } } } @@ -115,7 +137,9 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate { /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { LogUtils.log(msg: "error: \(errorCode)", level: .error) + #if os(iOS) self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") + #endif } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event @@ -153,3 +177,10 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate { agoraKit.setupRemoteVideo(videoCanvas) } } + +extension JoinChannelVideoMain: NSWindowDelegate { + func windowShouldClose(_ sender: NSWindow) -> Bool { + + return false + } +} diff --git a/iOS/APIExample/ViewController.swift b/iOS/APIExample/ViewController.swift index 98556516d..1912620b4 100644 --- a/iOS/APIExample/ViewController.swift +++ b/iOS/APIExample/ViewController.swift @@ -101,6 +101,8 @@ extension ViewController: NSTableViewDelegate, NSTableViewDataSource { if tableView == sectionTableView { sectionSelected = row subTableView.reloadData() + } else { + } return true } diff --git a/iOS/Podfile b/iOS/Podfile index 9ccf992b1..1a053d109 100644 --- a/iOS/Podfile +++ b/iOS/Podfile @@ -2,12 +2,19 @@ # platform :ios, '9.0' target 'APIExample' do - # Comment the next line if you don't want to use dynamic frameworks + source 'https://github.com/CocoaPods/Specs.git' + use_frameworks! - - # Pods for APIExample + pod 'AGEVideoLayout', '~> 1.0.2' pod 'AgoraRtcEngine_iOS', '~> 3.0.0' - +end + +target 'APIExample-Mac' do source 'https://github.com/CocoaPods/Specs.git' + + use_frameworks! + + pod 'AGEVideoLayout', '~> 1.0.2' + pod 'AgoraRtcEngine_macOS', '~> 3.0.1' end From 20307f602ac67143d61a966e0bc6c0d41d67bb7d Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Mon, 8 Jun 2020 17:50:51 +0800 Subject: [PATCH 020/430] Add QuickSwitchChannel samples. --- .../io/agora/api/example/MainActivity.java | 12 +- .../live_broadcasting/QuickSwitchChannel.java | 528 ++++++++++++++++++ .../live_broadcasting/VideoMetadata.java | 2 +- .../layout/fragment_quick_switch_channel.xml | 12 + .../main/res/layout/view_item_quickswitch.xml | 32 ++ .../app/src/main/res/navigation/nav_graph.xml | 8 + .../app/src/main/res/values-zh/strings.xml | 1 + .../src/main/res/values/string_configs.xml | 4 +- .../app/src/main/res/values/strings.xml | 1 + Android/APIExample/build.gradle | 2 + 10 files changed, 595 insertions(+), 7 deletions(-) create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java create mode 100644 Android/APIExample/app/src/main/res/layout/fragment_quick_switch_channel.xml create mode 100644 Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/MainActivity.java b/Android/APIExample/app/src/main/java/io/agora/api/example/MainActivity.java index c8dd40e77..f707aebdc 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/MainActivity.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/MainActivity.java @@ -11,11 +11,13 @@ import io.agora.api.example.annotation.Example; -public class MainActivity extends AppCompatActivity implements MainFragment.OnListFragmentInteractionListener { +public class MainActivity extends AppCompatActivity implements MainFragment.OnListFragmentInteractionListener +{ private AppBarConfiguration appBarConfiguration; @Override - protected void onCreate(Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) + { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); @@ -25,14 +27,16 @@ protected void onCreate(Bundle savedInstanceState) { } @Override - public boolean onSupportNavigateUp() { + public boolean onSupportNavigateUp() + { NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment); return NavigationUI.navigateUp(navController, appBarConfiguration) || super.onSupportNavigateUp(); } @Override - public void onListFragmentInteraction(Example item) { + public void onListFragmentInteraction(Example item) + { Navigation.findNavController(this, R.id.nav_host_fragment).navigate(new ActionOnlyNavDirections(item.actionId())); } } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java new file mode 100644 index 000000000..88f9787fe --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java @@ -0,0 +1,528 @@ +package io.agora.api.example.examples.live_broadcasting; + +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.util.SparseArray; +import android.view.LayoutInflater; +import android.view.SurfaceView; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.viewpager.widget.PagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import java.util.ArrayList; +import java.util.List; + +import io.agora.api.example.R; +import io.agora.api.example.annotation.Example; +import io.agora.api.example.common.BaseFragment; +import io.agora.rtc.Constants; +import io.agora.rtc.IMetadataObserver; +import io.agora.rtc.IRtcEngineEventHandler; +import io.agora.rtc.RtcEngine; +import io.agora.rtc.video.VideoCanvas; +import io.agora.rtc.video.VideoEncoderConfiguration; + +import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; +import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; +import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; +import static io.agora.rtc.video.VideoEncoderConfiguration.STANDARD_BITRATE; +import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; + +/**---------------------------------------Important!!!---------------------------------------------- + * This example demonstrates how viewers can quickly switch channels. The following points need to be noted: + 1: You can only access the channel as an audience{@link QuickSwitchChannel#joinChannel(String)}. + 2: If you want to see a normal remote screen, you need to set up several live rooms in advance and + push the stream as a live one (the name of the live room is in the channels instance; at the same time, + the appid you used to set up the live room should be consistent with this example program).*/ +@Example( + group = "Live BROADCASTING", + name = "Video QuickSwitch", + actionId = R.id.action_mainFragment_to_QuickSwitch +) +public class QuickSwitchChannel extends BaseFragment +{ + private static final String TAG = QuickSwitchChannel.class.getSimpleName(); + private ViewPager viewPager; + private RtcEngine engine; + private int myUid; + private final String[] channels = new String[]{"channel0", "channel1", "channel2"}; + private List channelList = new ArrayList<>(); + private ViewPagerAdapter viewPagerAdapter; + private int currentIndex = 0; + private int lastIndex = -1; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + try + { + /**Creates an RtcEngine instance. + * @param context The context of Android Activity + * @param appId The App ID issued to you by Agora. See + * How to get the App ID + * @param handler IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + engine = RtcEngine.create(context.getApplicationContext(), getString(R.string.agora_app_id), iRtcEngineEventHandler); + } + catch (Exception e) + { + e.printStackTrace(); + getActivity().onBackPressed(); + } + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + { + View view = inflater.inflate(R.layout.fragment_quick_switch_channel, container, false); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) + { + super.onViewCreated(view, savedInstanceState); + viewPager = view.findViewById(R.id.viewPager); + /**Prepare data*/ + for (String channel : channels) + { + channelList.add(channel); + } + viewPagerAdapter = new ViewPagerAdapter(getContext(), channelList); + viewPager.setAdapter(viewPagerAdapter); + viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() + { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) + { + if (positionOffset == 0f && position != currentIndex) + { + viewPager.post(new Runnable() + { + @Override + public void run() + { + Log.i(TAG, "Will switch channel to " + channelList.get(position)); + + currentIndex = position; + if (lastIndex >= 0) + { + viewPagerAdapter.removeSurfaceViewByIndex(lastIndex); + } + + /**Since v2.9.0. + * Switches to a different channel. + * This method allows the audience of a Live-broadcast channel to switch to a different channel. + * After the user successfully switches to another channel, the onLeaveChannel + * and onJoinChannelSuccess callbacks are triggered to indicate that the + * user has left the original channel and joined a new one. + * @param token The token for authentication: + * In situations not requiring high security: You can use + * the temporary token generated at Console. For details, + * see Get a temporary token. + * In situations requiring high security: Set it as the token + * generated at your server. For details, see Get a token. + * @param channelName Unique channel name for the AgoraRTC session in the + * string format. The string length must be less than + * 64 bytes. Supported character scopes are: + * All lowercase English letters: a to z. + * All uppercase English letters: A to Z. + * All numeric characters: 0 to 9. + * The space character. + * Punctuation characters and other symbols, including: + * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", + * ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", + * "_", " {", "}", "|", "~", ",". + * @return + * 0: Success. + * < 0: Failure. + * PS: + * Important!!!This method applies to the audience role in a + * Live-broadcast channel only.*/ + int code = engine.switchChannel(null, channelList.get(position)); + + lastIndex = currentIndex; + } + }); + } + } + @Override + public void onPageSelected(int position) + {} + @Override + public void onPageScrollStateChanged(int state) + {} + }); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) + { + super.onActivityCreated(savedInstanceState); + joinChannel(channelList.get(0)); + } + + @Override + public void onDestroy() + { + super.onDestroy(); + /**leaveChannel and Destroy the RtcEngine instance*/ + if (engine != null) + { + engine.leaveChannel(); + } + handler.post(RtcEngine::destroy); + engine = null; + } + + private final void joinChannel(String channelId) + { + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + + // Set audio route to speaker + engine.setDefaultAudioRoutetoSpeakerphone(true); + /** Sets the channel profile of the Agora RtcEngine. + CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile. + Use this profile in one-on-one calls or group calls, where all users can talk freely. + CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast + channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; + an audience can only receive streams.*/ + engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); + /**In the demo, the default is to enter as the broadcaster.*/ + engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_AUDIENCE); + // Enable video module + engine.enableVideo(); + // Setup video encoding configs + engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( + VD_640x360, + FRAME_RATE_FPS_15, + STANDARD_BITRATE, + ORIENTATION_MODE_ADAPTIVE + )); + + /**Allows a user to join a channel. + * if you do not specify the uid, we will generate the uid for you. + * If your account has enabled token mechanism through the console, you must fill in the + * corresponding token here. In general, it is not recommended to open the token mechanism in the test phase.*/ + int res = engine.joinChannel(null, channelId, "Extra Optional Data", 0); + if (res != 0) + { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + showAlert(RtcEngine.getErrorDescription(Math.abs(res))); + return; + } + } + + /** + * IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events. + */ + private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() + { + /**Reports a warning during SDK runtime. + * Warning code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_warn_code.html*/ + @Override + public void onWarning(int warn) + { + Log.w(TAG, String.format("onWarning code %d message %s", warn, RtcEngine.getErrorDescription(warn))); + } + + /**Reports an error during SDK runtime. + * Error code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html*/ + @Override + public void onError(int err) + { + Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + } + + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics. + * PS: + * Important! Because the channel is entered by the role of an audience, this callback will + * only be received when the broadcaster exits the channel.*/ + @Override + public void onLeaveChannel(RtcStats stats) + { + super.onLeaveChannel(stats); + Log.i(TAG, String.format("local user %d leaveChannel!", myUid)); + showLongToast(String.format("local user %d leaveChannel!", myUid)); + } + + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) + { + Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + myUid = uid; + } + + /**Since v2.9.0. + * This callback indicates the state change of the remote audio stream. + * PS: This callback does not work properly when the number of users (in the Communication profile) or + * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the user whose audio state changes. + * @param state State of the remote audio + * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due + * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), + * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). + * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. + * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, + * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). + * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). + * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to + * REMOTE_AUDIO_REASON_INTERNAL(0). + * @param reason The reason of the remote audio state change. + * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio + * stream or disables the audio module. + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio + * stream or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or + * disables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream + * or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method + * until the SDK triggers this callback.*/ + @Override + public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteAudioStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Since v2.9.0. + * Occurs when the remote video state changes. + * PS: This callback does not work properly when the number of users (in the Communication + * profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video: + * REMOTE_VIDEO_STATE_STOPPED(0): The remote video is in the default state, probably due + * to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5), + * or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7). + * REMOTE_VIDEO_STATE_STARTING(1): The first remote video packet is received. + * REMOTE_VIDEO_STATE_DECODING(2): The remote video stream is decoded and plays normally, + * probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6), + * or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9). + * REMOTE_VIDEO_STATE_FROZEN(3): The remote video is frozen, probably due to + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8). + * REMOTE_VIDEO_STATE_FAILED(4): The remote video fails to start, probably due to + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0). + * @param reason The reason of the remote video state change: + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0): Internal reasons. + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3): The local user stops receiving the remote + * video stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote + * video stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5): The remote user stops sending the video + * stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the video + * stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8): The remote media stream falls back to the + * audio-only stream due to poor network conditions. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9): The remote media stream switches + * back to the video stream after the network conditions improve. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method until + * the SDK triggers this callback.*/ + @Override + public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteVideoStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered. + * PS: + * Important! Because the channel is entered by the role of an audience, this callback will + * only be received when the broadcaster exits the channel.*/ + @Override + public void onUserJoined(int uid, int elapsed) + { + super.onUserJoined(uid, elapsed); + Log.i(TAG, "onUserJoined->" + uid); + showLongToast(String.format("user %d joined!", uid)); + /**Check if the context is correct*/ + Context context = getContext(); + if (context == null) return; + handler.post(() -> + { + if(uid != myUid) + { + SurfaceView surfaceV = RtcEngine.CreateRendererView(getContext().getApplicationContext()); + engine.setupRemoteVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, uid)); + viewPagerAdapter.setSurfaceView(currentIndex, uid, surfaceV); + } + }); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience. + * PS: + * Important! Because the channel is entered by the role of an audience, this callback will + * only be received when the broadcaster exits the channel.*/ + @Override + public void onUserOffline(int uid, int reason) + { + Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); + showLongToast(String.format("user %d offline! reason:%d", uid, reason)); + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + viewPagerAdapter.removeSurfaceView(uid); + } + }; + + public class ViewPagerAdapter extends PagerAdapter + { + private SparseArray viewList = new SparseArray<>(); + private Context context; + private List roomNameList = new ArrayList<>(); + + public ViewPagerAdapter(Context context, List roomNameList) + { + this.context = context; + this.roomNameList = roomNameList; + } + + @Override + public Object instantiateItem(ViewGroup collection, int position) + { + ViewGroup layout = viewList.get(position); + if (layout == null) + { + LayoutInflater inflater = LayoutInflater.from(context); + layout = (ViewGroup) inflater.inflate(R.layout.view_item_quickswitch, collection, false); + viewList.put(position, layout); + } + + collection.addView(layout); + + return layout; + } + + @Override + public void destroyItem(ViewGroup collection, int position, Object view) + { + collection.removeView((View) view); + } + + @Override + public int getCount() + { + return roomNameList.size(); + } + + private void setSurfaceView(int position, final int uid, final SurfaceView view) + { + final ViewGroup viewGroup = viewList.get(position); + if (viewGroup != null) + { + ViewGroup surfaceContainer = viewGroup.findViewById(R.id.fl_remote); + surfaceContainer.removeAllViews(); + view.setZOrderMediaOverlay(true); + surfaceContainer.addView(view, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + + TextView uidTextView = viewGroup.findViewById(R.id.channelUid); + uidTextView.setText(String.format("uid: %d", uid)); + + viewGroup.setTag(uid); + } + } + + private void removeSurfaceView(int uid) + { + for (int i = 0; i < viewList.size(); i++) + { + ViewGroup viewGroup = viewList.get(i); + + if (viewGroup.getTag() != null && ((Integer) viewGroup.getTag()) == uid) + { + removeSurfaceView(viewGroup); + } + } + } + + private void removeSurfaceViewByIndex(int index) + { + ViewGroup viewGroup = viewList.get(index); + if (viewGroup != null) + { + removeSurfaceView(viewGroup); + } + } + + private void removeSurfaceView(ViewGroup viewGroup) + { + ViewGroup surfaceContainer = viewGroup.findViewById(R.id.fl_remote); + surfaceContainer.removeAllViews(); + + TextView uidTextView = viewGroup.findViewById(R.id.channelUid); + uidTextView.setText(""); + } + + @Override + public boolean isViewFromObject(@NonNull View view, @NonNull Object object) + { + return view == object; + } + + @Override + public CharSequence getPageTitle(int position) + { + return ""; + } + } +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java index cca88c9d0..611ff6d9c 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java @@ -238,7 +238,7 @@ private void joinChannel(String channelId) } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ - int res = engine.joinChannel(getString(R.string.agora_access_token), channelId, "Extra Optional Data", 0); + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); if (res != 0) { // Usually happens with invalid parameters diff --git a/Android/APIExample/app/src/main/res/layout/fragment_quick_switch_channel.xml b/Android/APIExample/app/src/main/res/layout/fragment_quick_switch_channel.xml new file mode 100644 index 000000000..1edd7385c --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/fragment_quick_switch_channel.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml b/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml new file mode 100644 index 000000000..ed096b566 --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml index 0df7537a7..87426c498 100755 --- a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml +++ b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml @@ -24,6 +24,9 @@ + + diff --git a/Android/APIExample/app/src/main/res/values-zh/strings.xml b/Android/APIExample/app/src/main/res/values-zh/strings.xml index 11490f460..1c46dc60a 100644 --- a/Android/APIExample/app/src/main/res/values-zh/strings.xml +++ b/Android/APIExample/app/src/main/res/values-zh/strings.xml @@ -16,4 +16,5 @@ 打开麦克风 关闭麦克风 发送元数据 + 请确保你已经按照QuickSwitchChannel类中的注释所说的那样建立频道,否则你将看到一片空白。 \ No newline at end of file diff --git a/Android/APIExample/app/src/main/res/values/string_configs.xml b/Android/APIExample/app/src/main/res/values/string_configs.xml index 4939350f7..9a2fc7bf2 100644 --- a/Android/APIExample/app/src/main/res/values/string_configs.xml +++ b/Android/APIExample/app/src/main/res/values/string_configs.xml @@ -1,5 +1,5 @@ - <#YOUR APP ID#> - <#YOUR ACCESS TOKEN#> + + diff --git a/Android/APIExample/app/src/main/res/values/strings.xml b/Android/APIExample/app/src/main/res/values/strings.xml index 21de556de..78e11f422 100644 --- a/Android/APIExample/app/src/main/res/values/strings.xml +++ b/Android/APIExample/app/src/main/res/values/strings.xml @@ -15,4 +15,5 @@ OpenMicrophone CloseMicrophone Send Metadata + Make sure you have set up the channel as the comments in the QuickSwitchChannel class say, or you will see a blank. diff --git a/Android/APIExample/build.gradle b/Android/APIExample/build.gradle index fbdd40ede..88aeb3892 100644 --- a/Android/APIExample/build.gradle +++ b/Android/APIExample/build.gradle @@ -2,6 +2,7 @@ buildscript { repositories { + mavenCentral() google() jcenter() @@ -18,6 +19,7 @@ buildscript { allprojects { repositories { + mavenCentral() google() jcenter() } From 8aa1ec405994c70f3379874107ba6f1af8d633c7 Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Tue, 9 Jun 2020 12:08:26 +0800 Subject: [PATCH 021/430] =?UTF-8?q?1=EF=BC=9Afix=20bug.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live_broadcasting/QuickSwitchChannel.java | 38 +++++++++++++++---- .../live_broadcasting/VideoMetadata.java | 37 ++++++++++++------ .../src/main/res/values/string_configs.xml | 4 +- 3 files changed, 59 insertions(+), 20 deletions(-) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java index 88f9787fe..361895542 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java @@ -18,6 +18,9 @@ import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; +import com.yanzhenjie.permission.AndPermission; +import com.yanzhenjie.permission.runtime.Permission; + import java.util.ArrayList; import java.util.List; @@ -38,7 +41,7 @@ import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; /**---------------------------------------Important!!!---------------------------------------------- - * This example demonstrates how viewers can quickly switch channels. The following points need to be noted: + * This example demonstrates how audience can quickly switch channels. The following points need to be noted: 1: You can only access the channel as an audience{@link QuickSwitchChannel#joinChannel(String)}. 2: If you want to see a normal remote screen, you need to set up several live rooms in advance and push the stream as a live one (the name of the live room is in the channels instance; at the same time, @@ -176,7 +179,21 @@ public void onPageScrollStateChanged(int state) public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - joinChannel(channelList.get(0)); + // Check permission + if (AndPermission.hasPermissions(this, Permission.Group.STORAGE, Permission.Group.MICROPHONE, Permission.Group.CAMERA)) + { + joinChannel(channelList.get(0)); + return; + } + // Request permission + AndPermission.with(this).runtime().permission( + Permission.READ_EXTERNAL_STORAGE, + Permission.WRITE_EXTERNAL_STORAGE + ).onGranted(permissions -> + { + // Permissions Granted + joinChannel(channelList.get(0)); + }).start(); } @Override @@ -417,11 +434,18 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); - viewPagerAdapter.removeSurfaceView(uid); + handler.post(new Runnable() + { + @Override + public void run() + { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + viewPagerAdapter.removeSurfaceView(uid); + } + }); } }; diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java index 611ff6d9c..6be59109e 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java @@ -54,9 +54,13 @@ public class VideoMetadata extends BaseFragment implements View.OnClickListener private RtcEngine engine; private int myUid; private boolean joined = false; - /**Maximum length of meta data*/ + /** + * Maximum length of meta data + */ private int MAX_META_SIZE = 1024; - /**Meta data to be sent*/ + /** + * Meta data to be sent + */ private byte[] metadata; @Nullable @@ -172,7 +176,7 @@ public void onClick(View v) join.setText(getString(R.string.join)); } } - else if(v.getId() == R.id.btn_send) + else if (v.getId() == R.id.btn_send) { /**Click once, the metadata is sent once. * {@link VideoMetadata#iMetadataObserver}. @@ -252,7 +256,9 @@ private void joinChannel(String channelId) join.setEnabled(false); } - /**By implementing this interface, metadata can be sent and received with video frames.*/ + /** + * By implementing this interface, metadata can be sent and received with video frames. + */ private final IMetadataObserver iMetadataObserver = new IMetadataObserver() { /**Returns the maximum data size of Metadata*/ @@ -271,13 +277,15 @@ public int getMaxMetadataSize() public byte[] onReadyToSendMetadata(long timeStampMs) { /**Check if the metadata is empty.*/ - if(metadata == null) - {return null;} + if (metadata == null) + { + return null; + } Log.i(TAG, "There is metadata to send!"); /**Recycle metadata objects.*/ byte[] toBeSend = metadata; metadata = null; - if(toBeSend.length > MAX_META_SIZE) + if (toBeSend.length > MAX_META_SIZE) { Log.e(TAG, String.format("Metadata exceeding max length %d!", MAX_META_SIZE)); return null; @@ -492,10 +500,17 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() + { + @Override + public void run() + { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/res/values/string_configs.xml b/Android/APIExample/app/src/main/res/values/string_configs.xml index 9a2fc7bf2..4939350f7 100644 --- a/Android/APIExample/app/src/main/res/values/string_configs.xml +++ b/Android/APIExample/app/src/main/res/values/string_configs.xml @@ -1,5 +1,5 @@ - - + <#YOUR APP ID#> + <#YOUR ACCESS TOKEN#> From 1071d43fc5a43c328746915c79bea89c7bbbcc8d Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Fri, 12 Jun 2020 18:47:56 +0800 Subject: [PATCH 022/430] 1:Modify package name. 2:Added example of CustomAudioRecord section. --- .../app/src/main/AndroidManifest.xml | 2 + .../examples/advanced/AudioRecordService.java | 173 +++++++++ .../examples/advanced/CustomAudioRecord.java | 331 ++++++++++++++++++ .../QuickSwitchChannel.java | 7 +- .../RTMPInjection.java | 4 +- .../RTMPStreaming.java | 4 +- .../VideoMetadata.java | 8 +- .../JoinChannelAudio.java | 4 +- .../JoinChannelVideo.java | 4 +- .../layout/fragment_custom_audiorecord.xml | 42 +++ .../res/layout/fragment_joinchannel_audio.xml | 2 +- .../res/layout/fragment_joinchannel_video.xml | 2 +- .../res/layout/fragment_rtmp_injection.xml | 2 +- .../res/layout/fragment_rtmp_streaming.xml | 2 +- .../app/src/main/res/navigation/nav_graph.xml | 20 +- 15 files changed, 578 insertions(+), 29 deletions(-) create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java create mode 100755 Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/{live_broadcasting => advanced}/QuickSwitchChannel.java (99%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/{live_broadcasting => advanced}/RTMPInjection.java (99%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/{live_broadcasting => advanced}/RTMPStreaming.java (99%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/{live_broadcasting => advanced}/VideoMetadata.java (99%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/{basic_video_audio => basic}/JoinChannelAudio.java (99%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/{basic_video_audio => basic}/JoinChannelVideo.java (99%) create mode 100644 Android/APIExample/app/src/main/res/layout/fragment_custom_audiorecord.xml diff --git a/Android/APIExample/app/src/main/AndroidManifest.xml b/Android/APIExample/app/src/main/AndroidManifest.xml index 2ccfefc25..f5e353d12 100644 --- a/Android/APIExample/app/src/main/AndroidManifest.xml +++ b/Android/APIExample/app/src/main/AndroidManifest.xml @@ -25,6 +25,8 @@ + \ No newline at end of file diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java new file mode 100644 index 000000000..2c3cfb253 --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java @@ -0,0 +1,173 @@ +package io.agora.api.example.examples.advanced; + +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.app.Service; +import android.content.Intent; +import android.media.AudioFormat; +import android.media.AudioRecord; +import android.media.MediaRecorder; +import android.os.Build; +import android.os.IBinder; +import android.util.Log; + +import androidx.annotation.Nullable; +import androidx.core.app.NotificationCompat; + +import io.agora.api.example.MainActivity; + +public class AudioRecordService extends Service +{ + private static final String TAG = AudioRecordService.class.getSimpleName(); + + private RecordThread thread; + private volatile boolean stopped; + + @Nullable + @Override + public IBinder onBind(Intent intent) + { + return null; + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) + { + startForeground(); + startRecording(); + return Service.START_STICKY; + } + + private void startForeground() + { + createNotificationChannel(); + Intent notificationIntent = new Intent(this, MainActivity.class); + PendingIntent pendingIntent = PendingIntent.getActivity(this, + 0, notificationIntent, 0); + + Notification notification = new NotificationCompat.Builder(this, TAG) + .setContentTitle(TAG) + .setContentIntent(pendingIntent) + .build(); + + startForeground(1, notification); + } + + private void createNotificationChannel() + { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + { + NotificationChannel serviceChannel = new NotificationChannel( + TAG, TAG, NotificationManager.IMPORTANCE_DEFAULT + ); + + NotificationManager manager = getSystemService(NotificationManager.class); + manager.createNotificationChannel(serviceChannel); + } + } + + private void startRecording() + { + thread = new RecordThread(); + thread.start(); + } + + private void stopRecording() + { + stopped = true; + } + + @Override + public void onDestroy() + { + stopRecording(); + super.onDestroy(); + } + + class RecordThread extends Thread + { + private AudioRecord audioRecord; + public static final int DEFAULT_SAMPLE_RATE = 16000; + /**1 corresponds to AudioFormat.CHANNEL_IN_MONO; + * 2 corresponds to AudioFormat.CHANNEL_IN_STEREO*/ + public static final int DEFAULT_CHANNEL_COUNT = 1, DEFAULT_CHANNEL_CONFIG = AudioFormat.CHANNEL_IN_MONO; + private byte[] buffer; + + RecordThread() + { + int bufferSize = AudioRecord.getMinBufferSize(DEFAULT_SAMPLE_RATE, DEFAULT_CHANNEL_CONFIG, + AudioFormat.ENCODING_PCM_16BIT); + audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, DEFAULT_SAMPLE_RATE, DEFAULT_CHANNEL_COUNT, + AudioFormat.ENCODING_PCM_16BIT, bufferSize); + buffer = new byte[bufferSize]; + } + + @Override + public void run() + { + try + { + audioRecord.startRecording(); + while (!stopped) + { + int result = audioRecord.read(buffer, 0, buffer.length); + if (result >= 0) + { + /**Pushes the external audio frame to the Agora SDK for encoding. + * @param data External audio data to be pushed. + * @param timeStamp Timestamp of the external audio frame. It is mandatory. + * You can use this parameter for the following purposes: + * 1:Restore the order of the captured audio frame. + * 2:Synchronize audio and video frames in video-related + * scenarios, including scenarios where external video sources are used. + * @return + * 0: Success. + * < 0: Failure.*/ + CustomAudioRecord.engine.pushExternalAudioFrame( + buffer, System.currentTimeMillis()); + } + else + { + logRecordError(result); + } + Log.e(TAG, "数据大小:" + result); + } + release(); + } + catch (Exception e) + {e.printStackTrace();} + } + + private void logRecordError(int error) + { + String message = ""; + switch (error) + { + case AudioRecord.ERROR: + message = "generic operation failure"; + break; + case AudioRecord.ERROR_BAD_VALUE: + message = "failure due to the use of an invalid value"; + break; + case AudioRecord.ERROR_DEAD_OBJECT: + message = "object is no longer valid and needs to be recreated"; + break; + case AudioRecord.ERROR_INVALID_OPERATION: + message = "failure due to the improper use of method"; + break; + } + Log.e(TAG, message); + } + + private void release() + { + if (audioRecord != null) + { + audioRecord.stop(); + buffer = null; + } + } + } +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java new file mode 100755 index 000000000..9abbd5bd1 --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java @@ -0,0 +1,331 @@ +package io.agora.api.example.examples.advanced; + +import android.content.Context; +import android.content.Intent; +import android.media.AudioFormat; +import android.media.AudioRecord; +import android.media.MediaRecorder; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.yanzhenjie.permission.AndPermission; +import com.yanzhenjie.permission.runtime.Permission; + +import io.agora.api.example.R; +import io.agora.api.example.annotation.Example; +import io.agora.api.example.common.BaseFragment; +import io.agora.rtc.Constants; +import io.agora.rtc.IRtcEngineEventHandler; +import io.agora.rtc.RtcEngine; + +import static io.agora.api.example.examples.advanced.AudioRecordService.RecordThread.DEFAULT_CHANNEL_COUNT; +import static io.agora.api.example.examples.advanced.AudioRecordService.RecordThread.DEFAULT_SAMPLE_RATE; + +/**This demo demonstrates how to make a one-to-one voice call*/ +@Example( + group = "ADVANCED", + name = "CustomAudioRecord", + actionId = R.id.action_mainFragment_to_CustomAudioRecord +) +public class CustomAudioRecord extends BaseFragment implements View.OnClickListener +{ + private static final String TAG = CustomAudioRecord.class.getSimpleName(); + private EditText et_channel; + private Button mute, join; + private int myUid; + private boolean joined = false; + public static RtcEngine engine; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + handler = new Handler(); + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + { + View view = inflater.inflate(R.layout.fragment_custom_audiorecord, container, false); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) + { + super.onViewCreated(view, savedInstanceState); + join = view.findViewById(R.id.btn_join); + et_channel = view.findViewById(R.id.et_channel); + view.findViewById(R.id.btn_join).setOnClickListener(this); + mute = view.findViewById(R.id.btn_mute); + mute.setOnClickListener(this); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) + { + super.onActivityCreated(savedInstanceState); + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + try + { + /**Creates an RtcEngine instance. + * @param context The context of Android Activity + * @param appId The App ID issued to you by Agora. See + * How to get the App ID + * @param handler IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + engine = RtcEngine.create(getContext().getApplicationContext(), getString(R.string.agora_app_id), + iRtcEngineEventHandler); + } + catch (Exception e) + { + e.printStackTrace(); + getActivity().onBackPressed(); + } + } + + @Override + public void onDestroy() + { + super.onDestroy(); + stopAudioRecord(); + /**leaveChannel and Destroy the RtcEngine instance*/ + if(engine != null) + { + engine.leaveChannel(); + } + handler.post(RtcEngine::destroy); + engine = null; + } + + @Override + public void onClick(View v) + { + if (v.getId() == R.id.btn_join) + { + if (!joined) + { + // call when join button hit + String channelId = et_channel.getText().toString(); + // Check permission + if (AndPermission.hasPermissions(this, Permission.Group.STORAGE, Permission.Group.MICROPHONE, Permission.Group.CAMERA)) + { + joinChannel(channelId); + return; + } + // Request permission + AndPermission.with(this).runtime().permission( + Permission.Group.STORAGE, + Permission.Group.MICROPHONE + ).onGranted(permissions -> + { + // Permissions Granted + joinChannel(channelId); + }).start(); + } + else + { + joined = false; + stopAudioRecord(); + /**After joining a channel, the user must call the leaveChannel method to end the + * call before joining another channel. This method returns 0 if the user leaves the + * channel and releases all resources related to the call. This method call is + * asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. + * A successful leaveChannel method call triggers the following callbacks: + * 1:The local client: onLeaveChannel. + * 2:The remote client: onUserOffline, if the user leaving the channel is in the + * Communication channel, or is a BROADCASTER in the Live Broadcast profile. + * @returns 0: Success. + * < 0: Failure. + * PS: + * 1:If you call the destroy method immediately after calling the leaveChannel + * method, the leaveChannel process interrupts, and the SDK does not trigger + * the onLeaveChannel callback. + * 2:If you call the leaveChannel method during CDN live streaming, the SDK + * triggers the removeInjectStreamUrl method.*/ + engine.leaveChannel(); + join.setText(getString(R.string.join)); + mute.setText(getString(R.string.closemicrophone)); + mute.setEnabled(false); + } + } + else if (v.getId() == R.id.btn_mute) + { + mute.setActivated(!mute.isActivated()); + mute.setText(getString(mute.isActivated() ? R.string.openmicrophone : R.string.closemicrophone)); + /**Turn off / on the microphone, stop / start local audio collection and push streaming.*/ + engine.muteLocalAudioStream(mute.isActivated()); + } + } + + /** + * @param channelId Specify the channel name that you want to join. + * Users that input the same channel name join the same channel.*/ + private void joinChannel(String channelId) + { + /** Sets the channel profile of the Agora RtcEngine. + CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile. + Use this profile in one-on-one calls or group calls, where all users can talk freely. + CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast + channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; + an audience can only receive streams.*/ + engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); + /**In the demo, the default is to enter as the anchor.*/ + engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_BROADCASTER); + /**Sets the external audio source. + * @param enabled Sets whether to enable/disable the external audio source: + * true: Enable the external audio source. + * false: (Default) Disable the external audio source. + * @param sampleRate Sets the sample rate (Hz) of the external audio source, which can be + * set as 8000, 16000, 32000, 44100, or 48000 Hz. + * @param channels Sets the number of channels of the external audio source: + * 1: Mono. + * 2: Stereo. + * @return + * 0: Success. + * < 0: Failure. + * PS: Ensure that you call this method before the joinChannel method.*/ + engine.setExternalAudioSource(true, DEFAULT_SAMPLE_RATE, DEFAULT_CHANNEL_COUNT); + /**Please configure accessToken in the string_config file. + * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see + * https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token + * A token generated at the server. This applies to scenarios with high-security requirements. For details, see + * https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/ + String accessToken = getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) + { + showAlert("token is null!"); + return; + } + /** Allows a user to join a channel. + if you do not specify the uid, we will generate the uid for you*/ + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); + if (res != 0) + { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + showAlert(RtcEngine.getErrorDescription(Math.abs(res))); + return; + } + // Prevent repeated entry + join.setEnabled(false); + } + + private void startAudioRecord() + { + Intent intent = new Intent(getContext(), AudioRecordService.class); + getActivity().startService(intent); + } + + private void stopAudioRecord() + { + Intent intent = new Intent(getContext(), AudioRecordService.class); + getActivity().stopService(intent); + } + + /**IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() + { + /**Reports a warning during SDK runtime. + * Warning code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_warn_code.html*/ + @Override + public void onWarning(int warn) + { + Log.w(TAG, String.format("onWarning code %d message %s", warn, RtcEngine.getErrorDescription(warn))); + } + + /**Reports an error during SDK runtime. + * Error code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html*/ + @Override + public void onError(int err) + { + Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + } + + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) + { + Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + myUid = uid; + joined = true; + handler.post(new Runnable() + { + @Override + public void run() + { + mute.setEnabled(true); + join.setEnabled(true); + join.setText(getString(R.string.leave)); + } + }); + startAudioRecord(); + } + + /**Since v2.9.0. + * This callback indicates the state change of the remote audio stream. + * PS: This callback does not work properly when the number of users (in the Communication profile) or + * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the user whose audio state changes. + * @param state State of the remote audio + * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due + * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), + * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). + * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. + * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, + * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). + * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). + * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to + * REMOTE_AUDIO_REASON_INTERNAL(0). + * @param reason The reason of the remote audio state change. + * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio + * stream or disables the audio module. + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio + * stream or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or + * disables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream + * or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method + * until the SDK triggers this callback.*/ + @Override + public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteAudioStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + }; +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java similarity index 99% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java index 361895542..ee0424ec5 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/QuickSwitchChannel.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java @@ -1,15 +1,13 @@ -package io.agora.api.example.examples.live_broadcasting; +package io.agora.api.example.examples.advanced; import android.content.Context; import android.os.Bundle; -import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.SurfaceView; import android.view.View; import android.view.ViewGroup; -import android.widget.FrameLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -28,7 +26,6 @@ import io.agora.api.example.annotation.Example; import io.agora.api.example.common.BaseFragment; import io.agora.rtc.Constants; -import io.agora.rtc.IMetadataObserver; import io.agora.rtc.IRtcEngineEventHandler; import io.agora.rtc.RtcEngine; import io.agora.rtc.video.VideoCanvas; @@ -47,7 +44,7 @@ push the stream as a live one (the name of the live room is in the channels instance; at the same time, the appid you used to set up the live room should be consistent with this example program).*/ @Example( - group = "Live BROADCASTING", + group = "ADVANCED", name = "Video QuickSwitch", actionId = R.id.action_mainFragment_to_QuickSwitch ) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/RTMPInjection.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java similarity index 99% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/RTMPInjection.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java index 2c19dbace..afb897c90 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/RTMPInjection.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.live_broadcasting; +package io.agora.api.example.examples.advanced; import android.content.Context; import android.os.Bundle; @@ -42,7 +42,7 @@ * otherwise unexpected errors will occur. */ @Example( - group = "Live BROADCASTING", + group = "ADVANCED", name = "RTMP Injection", actionId = R.id.action_mainFragment_to_RTMPInjection ) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/RTMPStreaming.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java similarity index 99% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/RTMPStreaming.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java index 4a64ce9b0..6148f6711 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/RTMPStreaming.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.live_broadcasting; +package io.agora.api.example.examples.advanced; import android.content.Context; import android.os.Bundle; @@ -40,7 +40,7 @@ * Users who push and pull streams cannot be in one channel, * otherwise unexpected errors will occur.*/ @Example( - group = "Live BROADCASTING", + group = "ADVANCED", name = "RTMP Streaming", actionId = R.id.action_mainFragment_to_RTMPStreaming ) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java similarity index 99% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java index 6be59109e..ce83906a5 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/live_broadcasting/VideoMetadata.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java @@ -1,8 +1,7 @@ -package io.agora.api.example.examples.live_broadcasting; +package io.agora.api.example.examples.advanced; import android.content.Context; import android.os.Bundle; -import android.os.Handler; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -12,12 +11,9 @@ import android.widget.Button; import android.widget.EditText; import android.widget.FrameLayout; -import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; -import androidx.fragment.app.Fragment; import com.yanzhenjie.permission.AndPermission; import com.yanzhenjie.permission.runtime.Permission; @@ -41,7 +37,7 @@ import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; @Example( - group = "Live BROADCASTING", + group = "ADVANCED", name = "Video Metadata", actionId = R.id.action_mainFragment_to_VideoMetadata ) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic_video_audio/JoinChannelAudio.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java similarity index 99% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic_video_audio/JoinChannelAudio.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java index 167609361..d9fc57ed3 100755 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic_video_audio/JoinChannelAudio.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.basic_video_audio; +package io.agora.api.example.examples.basic; import android.content.Context; import android.os.Bundle; @@ -26,7 +26,7 @@ /**This demo demonstrates how to make a one-to-one voice call*/ @Example( - group = "BASIC VIDEO/AUDIO", + group = "BASIC", name = "JoinChannelAudio", actionId = R.id.action_mainFragment_to_joinChannelAudio ) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic_video_audio/JoinChannelVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java similarity index 99% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic_video_audio/JoinChannelVideo.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java index 227fe0fd7..637331493 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic_video_audio/JoinChannelVideo.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.basic_video_audio; +package io.agora.api.example.examples.basic; import android.content.Context; import android.os.Bundle; @@ -35,7 +35,7 @@ /**This demo demonstrates how to make a one-to-one video call*/ @Example( - group = "BASIC VIDEO/AUDIO", + group = "BASIC", name = "JoinChannelVideo", actionId = R.id.action_mainFragment_to_joinChannelVideo ) diff --git a/Android/APIExample/app/src/main/res/layout/fragment_custom_audiorecord.xml b/Android/APIExample/app/src/main/res/layout/fragment_custom_audiorecord.xml new file mode 100644 index 000000000..0c11720f9 --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/fragment_custom_audiorecord.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + diff --git a/Android/APIExample/app/src/main/res/layout/fragment_joinchannel_audio.xml b/Android/APIExample/app/src/main/res/layout/fragment_joinchannel_audio.xml index 8aed13070..f4150e305 100755 --- a/Android/APIExample/app/src/main/res/layout/fragment_joinchannel_audio.xml +++ b/Android/APIExample/app/src/main/res/layout/fragment_joinchannel_audio.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".examples.basic_video_audio.JoinChannelAudio"> + tools:context=".examples.basic.JoinChannelAudio"> + tools:context=".examples.basic.JoinChannelVideo"> + tools:context=".examples.advanced.RTMPInjection"> + tools:context=".examples.advanced.RTMPStreaming"> + + From 8612b85064058f3d6ad57f46bc7b6512309e6cbe Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Mon, 15 Jun 2020 13:59:38 +0800 Subject: [PATCH 023/430] 1:Specification notes. 2:fix bugs. --- .../app/src/main/AndroidManifest.xml | 2 +- .../api/example/common/BaseFragment.java | 3 +- .../examples/advanced/QuickSwitchChannel.java | 54 ++++++- .../examples/advanced/RTMPInjection.java | 5 +- .../examples/advanced/RTMPStreaming.java | 5 +- .../examples/advanced/VideoMetadata.java | 7 +- .../{ => custom}/AudioRecordService.java | 4 +- .../{ => custom}/CustomAudioRecord.java | 14 +- .../examples/basic/JoinChannelAudio.java | 5 +- .../examples/basic/JoinChannelVideo.java | 5 +- .../agora/api/example/utils/ClassUtils.java | 151 ++++++++++++------ .../example/utils/DefaultPoolExecutor.java | 53 +++--- .../example/utils/DefaultThreadFactory.java | 19 ++- .../main/res/layout/view_item_quickswitch.xml | 6 +- .../app/src/main/res/navigation/nav_graph.xml | 2 +- .../app/src/main/res/values-zh/strings.xml | 2 + .../src/main/res/values/string_configs.xml | 4 +- .../app/src/main/res/values/strings.xml | 2 + 18 files changed, 230 insertions(+), 113 deletions(-) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/{ => custom}/AudioRecordService.java (98%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/{ => custom}/CustomAudioRecord.java (97%) diff --git a/Android/APIExample/app/src/main/AndroidManifest.xml b/Android/APIExample/app/src/main/AndroidManifest.xml index f5e353d12..f7287b9d5 100644 --- a/Android/APIExample/app/src/main/AndroidManifest.xml +++ b/Android/APIExample/app/src/main/AndroidManifest.xml @@ -25,7 +25,7 @@ - diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/common/BaseFragment.java b/Android/APIExample/app/src/main/java/io/agora/api/example/common/BaseFragment.java index 77e65fd75..1050a99de 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/common/BaseFragment.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/common/BaseFragment.java @@ -3,6 +3,7 @@ import android.content.Context; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.widget.Toast; import androidx.annotation.Nullable; @@ -17,7 +18,7 @@ public class BaseFragment extends Fragment public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - handler = new Handler(); + handler = new Handler(Looper.getMainLooper()); } protected void showAlert(String message) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java index ee0424ec5..0a818a103 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java @@ -2,6 +2,7 @@ import android.content.Context; import android.os.Bundle; +import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import android.view.LayoutInflater; @@ -31,6 +32,9 @@ import io.agora.rtc.video.VideoCanvas; import io.agora.rtc.video.VideoEncoderConfiguration; +import static io.agora.rtc.Constants.REMOTE_VIDEO_STATE_DECODING; +import static io.agora.rtc.Constants.REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE; +import static io.agora.rtc.Constants.REMOTE_VIDEO_STATE_STOPPED; import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; @@ -41,8 +45,8 @@ * This example demonstrates how audience can quickly switch channels. The following points need to be noted: 1: You can only access the channel as an audience{@link QuickSwitchChannel#joinChannel(String)}. 2: If you want to see a normal remote screen, you need to set up several live rooms in advance and - push the stream as a live one (the name of the live room is in the channels instance; at the same time, - the appid you used to set up the live room should be consistent with this example program).*/ + push the stream as a live one (the name of the live room is in the channels instance{"channel0", "channel1", "channel2"}; + at the same time, the appid you used to set up the live room should be consistent with this example program).*/ @Example( group = "ADVANCED", name = "Video QuickSwitch", @@ -59,6 +63,19 @@ public class QuickSwitchChannel extends BaseFragment private ViewPagerAdapter viewPagerAdapter; private int currentIndex = 0; private int lastIndex = -1; + private boolean noBroadcaster = true; + private Runnable runnable = new Runnable() + { + @Override + public void run() + { + if(noBroadcaster) + { + /**There is no broadcaster in the current channel*/ + showAlert(getString(R.string.nobroadcaster)); + } + } + }; @Override public void onCreate(@Nullable Bundle savedInstanceState) @@ -170,6 +187,8 @@ public void onPageSelected(int position) public void onPageScrollStateChanged(int state) {} }); + /**Swipe left and right to switch channel tips*/ + showAlert(getString(R.string.swiptips)); } @Override @@ -236,11 +255,22 @@ private final void joinChannel(String channelId) ORIENTATION_MODE_ADAPTIVE )); + /**Please configure accessToken in the string_config file. + * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see + * https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token + * A token generated at the server. This applies to scenarios with high-security requirements. For details, see + * https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/ + String accessToken = getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) + { + accessToken = null; + } + /**Allows a user to join a channel. * if you do not specify the uid, we will generate the uid for you. * If your account has enabled token mechanism through the console, you must fill in the * corresponding token here. In general, it is not recommended to open the token mechanism in the test phase.*/ - int res = engine.joinChannel(null, channelId, "Extra Optional Data", 0); + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); if (res != 0) { // Usually happens with invalid parameters @@ -287,6 +317,7 @@ public void onLeaveChannel(RtcStats stats) super.onLeaveChannel(stats); Log.i(TAG, String.format("local user %d leaveChannel!", myUid)); showLongToast(String.format("local user %d leaveChannel!", myUid)); + handler.removeCallbacks(runnable); } /**Occurs when the local user joins a specified channel. @@ -301,6 +332,9 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed) Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); myUid = uid; + /**Determine if there is a host in the channel*/ + noBroadcaster = true; + handler.postDelayed(runnable, 3000); } /**Since v2.9.0. @@ -384,6 +418,14 @@ public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapse { super.onRemoteVideoStateChanged(uid, state, reason, elapsed); Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + if(state == REMOTE_VIDEO_STATE_DECODING) + { + /**REMOTE_VIDEO_STATE_DECODING as the basis for judging whether there is a broadcaster + * in the channel. + * But you should judge according to your own business logic, here is just for example, + * not for reference.*/ + noBroadcaster = false; + } } /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. @@ -467,6 +509,9 @@ public Object instantiateItem(ViewGroup collection, int position) LayoutInflater inflater = LayoutInflater.from(context); layout = (ViewGroup) inflater.inflate(R.layout.view_item_quickswitch, collection, false); viewList.put(position, layout); + + TextView channel = layout.findViewById(R.id.channelName); + channel.setText(String.format("channel: %s", roomNameList.get(position))); } collection.addView(layout); @@ -494,7 +539,8 @@ private void setSurfaceView(int position, final int uid, final SurfaceView view) ViewGroup surfaceContainer = viewGroup.findViewById(R.id.fl_remote); surfaceContainer.removeAllViews(); view.setZOrderMediaOverlay(true); - surfaceContainer.addView(view, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + surfaceContainer.addView(view, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); TextView uidTextView = viewGroup.findViewById(R.id.channelUid); uidTextView.setText(String.format("uid: %d", uid)); diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java index afb897c90..2dd5c2a0b 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java @@ -217,12 +217,11 @@ private void joinChannel(String channelId) String accessToken = getString(R.string.agora_access_token); if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { - showAlert("token is null!"); - return; + accessToken = null; } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ - int res = engine.joinChannel(null, channelId, "Extra Optional Data", 0); + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); if (res != 0) { // Usually happens with invalid parameters diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java index 6148f6711..f5d1dc27f 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java @@ -215,12 +215,11 @@ private void joinChannel(String channelId) String accessToken = getString(R.string.agora_access_token); if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { - showAlert("token is null!"); - return; + accessToken = null; } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ - int res = engine.joinChannel(null, channelId, "Extra Optional Data", 0); + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); if (res != 0) { // Usually happens with invalid parameters diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java index ce83906a5..8521b7320 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java @@ -220,8 +220,8 @@ private void joinChannel(String channelId) ORIENTATION_MODE_ADAPTIVE )); /**register metadata observer - * @return 0:方法调用成功 - * < 0:方法调用失败*/ + * @return 0:Success + * < 0:Failure*/ int code = engine.registerMediaMetadataObserver(iMetadataObserver, IMetadataObserver.VIDEO_METADATA); Log.e(TAG, code + ""); @@ -233,8 +233,7 @@ private void joinChannel(String channelId) String accessToken = getString(R.string.agora_access_token); if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { - showAlert("token is null!"); - return; + accessToken = null; } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/AudioRecordService.java similarity index 98% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/AudioRecordService.java index 2c3cfb253..2bd11703b 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AudioRecordService.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/AudioRecordService.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.advanced; +package io.agora.api.example.examples.advanced.custom; import android.app.Notification; import android.app.NotificationChannel; @@ -86,7 +86,7 @@ public void onDestroy() super.onDestroy(); } - class RecordThread extends Thread + public class RecordThread extends Thread { private AudioRecord audioRecord; public static final int DEFAULT_SAMPLE_RATE = 16000; diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/CustomAudioRecord.java similarity index 97% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/CustomAudioRecord.java index 9abbd5bd1..e2f0e76b0 100755 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomAudioRecord.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/CustomAudioRecord.java @@ -1,10 +1,7 @@ -package io.agora.api.example.examples.advanced; +package io.agora.api.example.examples.advanced.custom; import android.content.Context; import android.content.Intent; -import android.media.AudioFormat; -import android.media.AudioRecord; -import android.media.MediaRecorder; import android.os.Bundle; import android.os.Handler; import android.text.TextUtils; @@ -28,13 +25,13 @@ import io.agora.rtc.IRtcEngineEventHandler; import io.agora.rtc.RtcEngine; -import static io.agora.api.example.examples.advanced.AudioRecordService.RecordThread.DEFAULT_CHANNEL_COUNT; -import static io.agora.api.example.examples.advanced.AudioRecordService.RecordThread.DEFAULT_SAMPLE_RATE; +import static io.agora.api.example.examples.advanced.custom.AudioRecordService.RecordThread.DEFAULT_CHANNEL_COUNT; +import static io.agora.api.example.examples.advanced.custom.AudioRecordService.RecordThread.DEFAULT_SAMPLE_RATE; /**This demo demonstrates how to make a one-to-one voice call*/ @Example( group = "ADVANCED", - name = "CustomAudioRecord", + name = "Custom AudioRecord", actionId = R.id.action_mainFragment_to_CustomAudioRecord ) public class CustomAudioRecord extends BaseFragment implements View.OnClickListener @@ -211,8 +208,7 @@ private void joinChannel(String channelId) String accessToken = getString(R.string.agora_access_token); if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { - showAlert("token is null!"); - return; + accessToken = null; } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java index d9fc57ed3..c6c04880c 100755 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java @@ -27,7 +27,7 @@ /**This demo demonstrates how to make a one-to-one voice call*/ @Example( group = "BASIC", - name = "JoinChannelAudio", + name = "JoinChannel Audio", actionId = R.id.action_mainFragment_to_joinChannelAudio ) public class JoinChannelAudio extends BaseFragment implements View.OnClickListener @@ -198,8 +198,7 @@ private void joinChannel(String channelId) String accessToken = getString(R.string.agora_access_token); if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { - showAlert("token is null!"); - return; + accessToken = null; } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java index 637331493..657fc0d85 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java @@ -36,7 +36,7 @@ /**This demo demonstrates how to make a one-to-one video call*/ @Example( group = "BASIC", - name = "JoinChannelVideo", + name = "JoinChannel Video", actionId = R.id.action_mainFragment_to_joinChannelVideo ) public class JoinChannelVideo extends BaseFragment implements View.OnClickListener @@ -208,8 +208,7 @@ private void joinChannel(String channelId) String accessToken = getString(R.string.agora_access_token); if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { - showAlert("token is null!"); - return; + accessToken = null; } /** Allows a user to join a channel. if you do not specify the uid, we will generate the uid for you*/ diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java index 8895f5250..cbce99753 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java @@ -23,7 +23,8 @@ import dalvik.system.DexFile; import io.agora.rtc.BuildConfig; -public class ClassUtils { +public class ClassUtils +{ private static final String TAG = ClassUtils.class.getSimpleName(); private static final String EXTRACTED_NAME_EXT = ".classes"; private static final String EXTRACTED_SUFFIX = ".zip"; @@ -36,51 +37,70 @@ public class ClassUtils { private static final int VM_WITH_MULTIDEX_VERSION_MAJOR = 2; private static final int VM_WITH_MULTIDEX_VERSION_MINOR = 1; - private static SharedPreferences getMultiDexPreferences(Context context) { + private static SharedPreferences getMultiDexPreferences(Context context) + { return context.getSharedPreferences(PREFS_FILE, Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB ? Context.MODE_PRIVATE : Context.MODE_PRIVATE | Context.MODE_MULTI_PROCESS); } /** - * 通过指定包名,扫描包下面包含的所有的ClassName + * By specifying the package name, scan all ClassName contained under the package * - * @param context U know - * @param packageName 包名 - * @return 所有class的集合 + * @param context + * @param packageName + * @return Collection of all classes */ - public static Set getFileNameByPackageName(Context context, final String packageName) throws PackageManager.NameNotFoundException, IOException, InterruptedException { + public static Set getFileNameByPackageName(Context context, final String packageName) throws PackageManager.NameNotFoundException, IOException, InterruptedException + { final Set classNames = new HashSet<>(); List paths = getSourcePaths(context); final CountDownLatch parserCtl = new CountDownLatch(paths.size()); - for (final String path : paths) { - DefaultPoolExecutor.getInstance().execute(new Runnable() { + for (final String path : paths) + { + DefaultPoolExecutor.getInstance().execute(new Runnable() + { @Override - public void run() { + public void run() + { DexFile dexfile = null; - try { - if (path.endsWith(EXTRACTED_SUFFIX)) { + try + { + if (path.endsWith(EXTRACTED_SUFFIX)) + { //NOT use new DexFile(path), because it will throw "permission error in /data/dalvik-cache" dexfile = DexFile.loadDex(path, path + ".tmp", 0); - } else { + } + else + { dexfile = new DexFile(path); } Enumeration dexEntries = dexfile.entries(); - while (dexEntries.hasMoreElements()) { + while (dexEntries.hasMoreElements()) + { String className = dexEntries.nextElement(); - if (className.startsWith(packageName)) { + if (className.startsWith(packageName)) + { classNames.add(className); } } - } catch (Throwable ignore) { + } + catch (Throwable ignore) + { Log.e("ARouter", "Scan map file in dex files made error.", ignore); - } finally { - if (null != dexfile) { - try { + } + finally + { + if (null != dexfile) + { + try + { dexfile.close(); - } catch (Throwable ignore) { + } + catch (Throwable ignore) + { } } @@ -104,7 +124,8 @@ public void run() { * @throws PackageManager.NameNotFoundException * @throws IOException */ - public static List getSourcePaths(Context context) throws PackageManager.NameNotFoundException, IOException { + public static List getSourcePaths(Context context) throws PackageManager.NameNotFoundException, IOException + { ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0); File sourceApk = new File(applicationInfo.sourceDir); @@ -114,27 +135,33 @@ public static List getSourcePaths(Context context) throws PackageManager //the prefix of extracted file, ie: test.classes String extractedFilePrefix = sourceApk.getName() + EXTRACTED_NAME_EXT; -// 如果VM已经支持了MultiDex,就不要去Secondary Folder加载 Classesx.zip了,那里已经么有了 -// 通过是否存在sp中的multidex.version是不准确的,因为从低版本升级上来的用户,是包含这个sp配置的 - if (!isVMMultidexCapable()) { + /** If MultiDex already supported by VM, we will not to load Classesx.zip from + * Secondary Folder, because there is none.*/ + if (!isVMMultidexCapable()) + { //the total dex numbers int totalDexNumber = getMultiDexPreferences(context).getInt(KEY_DEX_NUMBER, 1); File dexDir = new File(applicationInfo.dataDir, SECONDARY_FOLDER_NAME); - for (int secondaryNumber = 2; secondaryNumber <= totalDexNumber; secondaryNumber++) { + for (int secondaryNumber = 2; secondaryNumber <= totalDexNumber; secondaryNumber++) + { //for each dex file, ie: test.classes2.zip, test.classes3.zip... String fileName = extractedFilePrefix + secondaryNumber + EXTRACTED_SUFFIX; File extractedFile = new File(dexDir, fileName); - if (extractedFile.isFile()) { + if (extractedFile.isFile()) + { sourcePaths.add(extractedFile.getAbsolutePath()); //we ignore the verify zip part - } else { + } + else + { throw new IOException("Missing extracted secondary dex file '" + extractedFile.getPath() + "'"); } } } - if (BuildConfig.DEBUG) { // Search instant run support only debuggable + if (BuildConfig.DEBUG) + { // Search instant run support only debuggable sourcePaths.addAll(tryLoadInstantRunDexFile(applicationInfo)); } return sourcePaths; @@ -143,32 +170,42 @@ public static List getSourcePaths(Context context) throws PackageManager /** * Get instant run dex path, used to catch the branch usingApkSplits=false. */ - private static List tryLoadInstantRunDexFile(ApplicationInfo applicationInfo) { + private static List tryLoadInstantRunDexFile(ApplicationInfo applicationInfo) + { List instantRunSourcePaths = new ArrayList<>(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && null != applicationInfo.splitSourceDirs) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && null != applicationInfo.splitSourceDirs) + { // add the split apk, normally for InstantRun, and newest version. instantRunSourcePaths.addAll(Arrays.asList(applicationInfo.splitSourceDirs)); Log.d(TAG, "Found InstantRun support"); - } else { - try { + } + else + { + try + { // This man is reflection from Google instant run sdk, he will tell me where the dex files go. Class pathsByInstantRun = Class.forName("com.android.tools.fd.runtime.Paths"); Method getDexFileDirectory = pathsByInstantRun.getMethod("getDexFileDirectory", String.class); String instantRunDexPath = (String) getDexFileDirectory.invoke(null, applicationInfo.packageName); File instantRunFilePath = new File(instantRunDexPath); - if (instantRunFilePath.exists() && instantRunFilePath.isDirectory()) { + if (instantRunFilePath.exists() && instantRunFilePath.isDirectory()) + { File[] dexFile = instantRunFilePath.listFiles(); - for (File file : dexFile) { - if (null != file && file.exists() && file.isFile() && file.getName().endsWith(".dex")) { + for (File file : dexFile) + { + if (null != file && file.exists() && file.isFile() && file.getName().endsWith(".dex")) + { instantRunSourcePaths.add(file.getAbsolutePath()); } } Log.d(TAG, "Found InstantRun support"); } - } catch (Exception e) { + } + catch (Exception e) + { Log.e(TAG, "InstantRun support error, " + e.getMessage()); } } @@ -182,33 +219,45 @@ private static List tryLoadInstantRunDexFile(ApplicationInfo application * * @return true if the VM handles multidex */ - private static boolean isVMMultidexCapable() { + private static boolean isVMMultidexCapable() + { boolean isMultidexCapable = false; String vmName = null; - try { - if (isYunOS()) { // YunOS需要特殊判断 + try + { + if (isYunOS()) + { // YunOS need special judgment vmName = "'YunOS'"; isMultidexCapable = Integer.valueOf(System.getProperty("ro.build.version.sdk")) >= 21; - } else { // 非YunOS原生Android + } + else + { // Native Android system vmName = "'Android'"; String versionString = System.getProperty("java.vm.version"); - if (versionString != null) { + if (versionString != null) + { Matcher matcher = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?").matcher(versionString); - if (matcher.matches()) { - try { + if (matcher.matches()) + { + try + { int major = Integer.parseInt(matcher.group(1)); int minor = Integer.parseInt(matcher.group(2)); isMultidexCapable = (major > VM_WITH_MULTIDEX_VERSION_MAJOR) || ((major == VM_WITH_MULTIDEX_VERSION_MAJOR) && (minor >= VM_WITH_MULTIDEX_VERSION_MINOR)); - } catch (NumberFormatException ignore) { + } + catch (NumberFormatException ignore) + { // let isMultidexCapable be false } } } } - } catch (Exception ignore) { + } + catch (Exception ignore) + { } @@ -217,15 +266,19 @@ private static boolean isVMMultidexCapable() { } /** - * 判断系统是否为YunOS系统 + * Determine whether the system is a YunOS system */ - private static boolean isYunOS() { - try { + private static boolean isYunOS() + { + try + { String version = System.getProperty("ro.yunos.version"); String vmName = System.getProperty("java.vm.name"); return (vmName != null && vmName.toLowerCase().contains("lemur")) || (version != null && version.trim().length() > 0); - } catch (Exception ignore) { + } + catch (Exception ignore) + { return false; } } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultPoolExecutor.java b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultPoolExecutor.java index 8d855b41b..324fc3087 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultPoolExecutor.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultPoolExecutor.java @@ -15,11 +15,11 @@ /** * Executors * - * @author 正纬 Contact me. * @version 1.0 * @since 16/4/28 下午4:07 */ -public class DefaultPoolExecutor extends ThreadPoolExecutor { +public class DefaultPoolExecutor extends ThreadPoolExecutor +{ private static final String TAG = DefaultPoolExecutor.class.getSimpleName(); // Thread args private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors(); @@ -29,10 +29,14 @@ public class DefaultPoolExecutor extends ThreadPoolExecutor { private static DefaultPoolExecutor instance; - public static DefaultPoolExecutor getInstance() { - if (null == instance) { - synchronized (DefaultPoolExecutor.class) { - if (null == instance) { + public static DefaultPoolExecutor getInstance() + { + if (null == instance) + { + synchronized (DefaultPoolExecutor.class) + { + if (null == instance) + { instance = new DefaultPoolExecutor( INIT_THREAD_COUNT, MAX_THREAD_COUNT, @@ -46,36 +50,47 @@ public static DefaultPoolExecutor getInstance() { return instance; } - private DefaultPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, ThreadFactory threadFactory) { - super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, new RejectedExecutionHandler() { + private DefaultPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, ThreadFactory threadFactory) + { + super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, new RejectedExecutionHandler() + { @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { + public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) + { Log.e(TAG, "Task rejected, too many task!"); } }); } - /* - * 线程执行结束,顺便看一下有么有什么乱七八糟的异常 - * + /* thread execution complete, handle possible exceptions. * @param r the runnable that has completed * @param t the exception that caused termination, or null if */ @Override - protected void afterExecute(Runnable r, Throwable t) { + protected void afterExecute(Runnable r, Throwable t) + { super.afterExecute(r, t); - if (t == null && r instanceof Future) { - try { + if (t == null && r instanceof Future) + { + try + { ((Future) r).get(); - } catch (CancellationException ce) { + } + catch (CancellationException ce) + { t = ce; - } catch (ExecutionException ee) { + } + catch (ExecutionException ee) + { t = ee.getCause(); - } catch (InterruptedException ie) { + } + catch (InterruptedException ie) + { Thread.currentThread().interrupt(); // ignore/reset } } - if (t != null) { + if (t != null) + { Log.w(TAG, "Running task appeared exception! Thread [" + Thread.currentThread().getName() + "], because [" + t.getMessage() + "]\n" + TextUtils.formatStackTrace(t.getStackTrace())); } } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultThreadFactory.java b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultThreadFactory.java index 08ca6d7c4..7a6f99fca 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultThreadFactory.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/DefaultThreadFactory.java @@ -8,13 +8,14 @@ import java.util.concurrent.atomic.AtomicInteger; /** - * 线程池工厂类 + * DefaultThreadFactory * * @author zhilong Contact me. * @version 1.0 * @since 15/12/25 上午10:51 */ -public class DefaultThreadFactory implements ThreadFactory { +public class DefaultThreadFactory implements ThreadFactory +{ private static final String TAG = DefaultThreadFactory.class.getSimpleName(); private static final AtomicInteger poolNumber = new AtomicInteger(1); @@ -23,25 +24,29 @@ public class DefaultThreadFactory implements ThreadFactory { private final ThreadGroup group; private final String namePrefix; - public DefaultThreadFactory() { + public DefaultThreadFactory() + { SecurityManager s = System.getSecurityManager(); group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); namePrefix = "ARouter task pool No." + poolNumber.getAndIncrement() + ", thread No."; } - public Thread newThread(@NonNull Runnable runnable) { + public Thread newThread(@NonNull Runnable runnable) + { String threadName = namePrefix + threadNumber.getAndIncrement(); Log.i(TAG, "Thread production, name is [" + threadName + "]"); Thread thread = new Thread(group, runnable, threadName, 0); - if (thread.isDaemon()) { //设为非后台线程 + if (thread.isDaemon()) + { //Make non-background thread thread.setDaemon(false); } - if (thread.getPriority() != Thread.NORM_PRIORITY) { //优先级为normal + if (thread.getPriority() != Thread.NORM_PRIORITY) + { thread.setPriority(Thread.NORM_PRIORITY); } - // 捕获多线程处理中的异常 + // Catching exceptions in multi-threaded processing thread.setUncaughtExceptionHandler((thread1, ex) -> Log.i(TAG, "Running task appeared exception! Thread [" + thread1.getName() + "], because [" + ex.getMessage() + "]")); return thread; } diff --git a/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml b/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml index ed096b566..40df5c251 100644 --- a/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml +++ b/Android/APIExample/app/src/main/res/layout/view_item_quickswitch.xml @@ -22,11 +22,13 @@ + android:layout_height="wrap_content" + android:textColor="#ff00"/> + android:layout_height="wrap_content" + android:textColor="#ff00" /> diff --git a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml index a8d126931..c9d51c5a3 100755 --- a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml +++ b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml @@ -63,7 +63,7 @@ tools:layout="@layout/fragment_quick_switch_channel" /> diff --git a/Android/APIExample/app/src/main/res/values-zh/strings.xml b/Android/APIExample/app/src/main/res/values-zh/strings.xml index 1c46dc60a..17b867ace 100644 --- a/Android/APIExample/app/src/main/res/values-zh/strings.xml +++ b/Android/APIExample/app/src/main/res/values-zh/strings.xml @@ -17,4 +17,6 @@ 关闭麦克风 发送元数据 请确保你已经按照QuickSwitchChannel类中的注释所说的那样建立频道,否则你将看到一片空白。 + 当前频道内无主播 + 你可以左右滑动切换频道 \ No newline at end of file diff --git a/Android/APIExample/app/src/main/res/values/string_configs.xml b/Android/APIExample/app/src/main/res/values/string_configs.xml index 4939350f7..9a2fc7bf2 100644 --- a/Android/APIExample/app/src/main/res/values/string_configs.xml +++ b/Android/APIExample/app/src/main/res/values/string_configs.xml @@ -1,5 +1,5 @@ - <#YOUR APP ID#> - <#YOUR ACCESS TOKEN#> + + diff --git a/Android/APIExample/app/src/main/res/values/strings.xml b/Android/APIExample/app/src/main/res/values/strings.xml index 78e11f422..828b2b39e 100644 --- a/Android/APIExample/app/src/main/res/values/strings.xml +++ b/Android/APIExample/app/src/main/res/values/strings.xml @@ -16,4 +16,6 @@ CloseMicrophone Send Metadata Make sure you have set up the channel as the comments in the QuickSwitchChannel class say, or you will see a blank. + There is no broadcaster in the current channel + You can swipe left and right to switch channels From 642bcb1f0c339f40daba2053428e42be25c163e5 Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Thu, 18 Jun 2020 15:59:03 +0800 Subject: [PATCH 024/430] Add custom encryption scheme example. --- Android/APIExample/.gitignore | 3 + Android/APIExample/app/.gitignore | 19 + Android/APIExample/app/build.gradle | 4 +- .../examples/advanced/StreamEncrypt.java | 435 + .../agora/api/example/utils/ClassUtils.java | 2 +- .../res/layout/fragment_stream_encrypt.xml | 44 + .../app/src/main/res/navigation/nav_graph.xml | 8 + Android/APIExample/lib-component/.gitignore | 20 + Android/APIExample/lib-component/build.gradle | 35 + .../lib-component/consumer-rules.pro | 0 .../lib-component/proguard-rules.pro | 21 + .../src/main/AndroidManifest.xml | 2 + .../APIExample/lib-stream-encrypt/.gitignore | 20 + .../lib-stream-encrypt/CMakeLists.txt | 16 + .../lib-stream-encrypt/build.gradle | 41 + .../lib-stream-encrypt/consumer-rules.pro | 0 .../lib-stream-encrypt/proguard-rules.pro | 21 + .../src/main/AndroidManifest.xml | 2 + .../src/main/cpp/include/agora/AgoraBase.h | 737 ++ .../include/agora/AgoraRtcCryptoCppLoader.h | 18 + .../cpp/include/agora/IAgoraMediaEngine.h | 736 ++ .../main/cpp/include/agora/IAgoraRtcChannel.h | 1249 +++ .../main/cpp/include/agora/IAgoraRtcEngine.h | 7694 +++++++++++++++++ .../main/cpp/include/agora/IAgoraService.h | 77 + .../include/packet_processing_plugin_jni.h | 12 + .../main/cpp/packet_processing_plugin_jni.cpp | 205 + .../api/streamencrypt/PacketProcessor.java | 18 + Android/APIExample/settings.gradle | 2 + 28 files changed, 11438 insertions(+), 3 deletions(-) create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java create mode 100644 Android/APIExample/app/src/main/res/layout/fragment_stream_encrypt.xml create mode 100644 Android/APIExample/lib-component/.gitignore create mode 100644 Android/APIExample/lib-component/build.gradle create mode 100644 Android/APIExample/lib-component/consumer-rules.pro create mode 100644 Android/APIExample/lib-component/proguard-rules.pro create mode 100644 Android/APIExample/lib-component/src/main/AndroidManifest.xml create mode 100644 Android/APIExample/lib-stream-encrypt/.gitignore create mode 100644 Android/APIExample/lib-stream-encrypt/CMakeLists.txt create mode 100644 Android/APIExample/lib-stream-encrypt/build.gradle create mode 100644 Android/APIExample/lib-stream-encrypt/consumer-rules.pro create mode 100644 Android/APIExample/lib-stream-encrypt/proguard-rules.pro create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/AndroidManifest.xml create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraRtcCryptoCppLoader.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraMediaEngine.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcChannel.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcEngine.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraService.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/include/packet_processing_plugin_jni.h create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/cpp/packet_processing_plugin_jni.cpp create mode 100644 Android/APIExample/lib-stream-encrypt/src/main/java/io/agora/api/streamencrypt/PacketProcessor.java diff --git a/Android/APIExample/.gitignore b/Android/APIExample/.gitignore index b37f493a9..da62f148c 100644 --- a/Android/APIExample/.gitignore +++ b/Android/APIExample/.gitignore @@ -1,6 +1,7 @@ *.iml .gradle /local.properties +/.idea /.idea/caches /.idea/libraries /.idea/modules.xml @@ -15,3 +16,5 @@ gradlew gradlew.bat .externalNativeBuild .cxx +androidTest/ +Test/ diff --git a/Android/APIExample/app/.gitignore b/Android/APIExample/app/.gitignore index 796b96d1c..da62f148c 100644 --- a/Android/APIExample/app/.gitignore +++ b/Android/APIExample/app/.gitignore @@ -1 +1,20 @@ +*.iml +.gradle +/local.properties +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store /build +/captures +gradle +gradlew +gradlew.bat +.externalNativeBuild +.cxx +androidTest/ +Test/ diff --git a/Android/APIExample/app/build.gradle b/Android/APIExample/app/build.gradle index 5912bd89c..b9037ec90 100644 --- a/Android/APIExample/app/build.gradle +++ b/Android/APIExample/app/build.gradle @@ -44,8 +44,8 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'io.agora.rtc:full-sdk:3.0.0' - implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.2.0' implementation 'com.yanzhenjie:permission:2.0.3' + + implementation project(path: ':lib-stream-encrypt') } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java new file mode 100644 index 000000000..8c6ca5d7b --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java @@ -0,0 +1,435 @@ +package io.agora.api.example.examples.advanced; + +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.SurfaceView; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.yanzhenjie.permission.AndPermission; +import com.yanzhenjie.permission.runtime.Permission; + +import io.agora.api.example.R; +import io.agora.api.example.annotation.Example; +import io.agora.api.example.common.BaseFragment; +import io.agora.api.streamencrypt.PacketProcessor; +import io.agora.rtc.Constants; +import io.agora.rtc.IRtcEngineEventHandler; +import io.agora.rtc.RtcEngine; +import io.agora.rtc.video.VideoCanvas; +import io.agora.rtc.video.VideoEncoderConfiguration; + +import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; +import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; +import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; +import static io.agora.rtc.video.VideoEncoderConfiguration.STANDARD_BITRATE; +import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; + +/**This example demonstrates how to use a custom encryption scheme to encrypt audio and video streams.*/ +@Example( + group = "ADVANCED", + name = "Stream Encrypt", + actionId = R.id.action_mainFragment_to_StreamEncrypt +) +public class StreamEncrypt extends BaseFragment implements View.OnClickListener +{ + private static final String TAG = StreamEncrypt.class.getSimpleName(); + + private FrameLayout fl_local, fl_remote; + private Button join; + private EditText et_channel; + private RtcEngine engine; + private int myUid; + private boolean joined = false; + private PacketProcessor packetProcessor = new PacketProcessor(); + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + { + View view = inflater.inflate(R.layout.fragment_stream_encrypt, container, false); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) + { + super.onViewCreated(view, savedInstanceState); + join = view.findViewById(R.id.btn_join); + et_channel = view.findViewById(R.id.et_channel); + view.findViewById(R.id.btn_join).setOnClickListener(this); + fl_local = view.findViewById(R.id.fl_local); + fl_remote = view.findViewById(R.id.fl_remote); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) + { + super.onActivityCreated(savedInstanceState); + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + try + { + /**Creates an RtcEngine instance. + * @param context The context of Android Activity + * @param appId The App ID issued to you by Agora. See + * How to get the App ID + * @param handler IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + engine = RtcEngine.create(context.getApplicationContext(), getString(R.string.agora_app_id), iRtcEngineEventHandler); + } + catch (Exception e) + { + e.printStackTrace(); + getActivity().onBackPressed(); + } + /**register AgoraPacketObserver for encrypt/decrypt stream*/ + packetProcessor.registerProcessing(); + } + + @Override + public void onDestroy() + { + super.onDestroy(); + /**leaveChannel and Destroy the RtcEngine instance*/ + if(engine != null) + { + engine.leaveChannel(); + } + /**unregister AgoraPacketObserver*/ + packetProcessor.unregisterProcessing(); + handler.post(RtcEngine::destroy); + engine = null; + } + + @Override + public void onClick(View v) + { + if (v.getId() == R.id.btn_join) + { + if (!joined) + { + // call when join button hit + String channelId = et_channel.getText().toString(); + // Check permission + if (AndPermission.hasPermissions(this, Permission.Group.STORAGE, Permission.Group.MICROPHONE, Permission.Group.CAMERA)) + { + joinChannel(channelId); + return; + } + // Request permission + AndPermission.with(this).runtime().permission( + Permission.Group.STORAGE, + Permission.Group.MICROPHONE, + Permission.Group.CAMERA + ).onGranted(permissions -> + { + // Permissions Granted + joinChannel(channelId); + }).start(); + } + else + { + joined = false; + /**After joining a channel, the user must call the leaveChannel method to end the + * call before joining another channel. This method returns 0 if the user leaves the + * channel and releases all resources related to the call. This method call is + * asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. + * A successful leaveChannel method call triggers the following callbacks: + * 1:The local client: onLeaveChannel. + * 2:The remote client: onUserOffline, if the user leaving the channel is in the + * Communication channel, or is a BROADCASTER in the Live Broadcast profile. + * @returns 0: Success. + * < 0: Failure. + * PS: + * 1:If you call the destroy method immediately after calling the leaveChannel + * method, the leaveChannel process interrupts, and the SDK does not trigger + * the onLeaveChannel callback. + * 2:If you call the leaveChannel method during CDN live streaming, the SDK + * triggers the removeInjectStreamUrl method.*/ + engine.leaveChannel(); + join.setText(getString(R.string.join)); + } + } + } + + private void joinChannel(String channelId) + { + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + + // Create render view by RtcEngine + SurfaceView surfaceView = RtcEngine.CreateRendererView(context); + // Local video is on the top + surfaceView.setZOrderMediaOverlay(true); + // Add to the local container + fl_local.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + // Setup local video to render your local camera preview + engine.setupLocalVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, 0)); + // Set audio route to speaker + engine.setDefaultAudioRoutetoSpeakerphone(true); + + /** Sets the channel profile of the Agora RtcEngine. + CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile. + Use this profile in one-on-one calls or group calls, where all users can talk freely. + CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast + channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; + an audience can only receive streams.*/ + engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); + /**In the demo, the default is to enter as the anchor.*/ + engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_BROADCASTER); + // Enable video module + engine.enableVideo(); + // Setup video encoding configs + engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( + VD_640x360, + FRAME_RATE_FPS_15, + STANDARD_BITRATE, + ORIENTATION_MODE_ADAPTIVE + )); + + /**Please configure accessToken in the string_config file. + * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see + * https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token + * A token generated at the server. This applies to scenarios with high-security requirements. For details, see + * https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/ + String accessToken = getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) + { + accessToken = null; + } + /** Allows a user to join a channel. + if you do not specify the uid, we will generate the uid for you*/ + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); + if (res != 0) + { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + showAlert(RtcEngine.getErrorDescription(Math.abs(res))); + return; + } + // Prevent repeated entry + join.setEnabled(false); + } + + /** + * IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events. + */ + private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() + { + /**Reports a warning during SDK runtime. + * Warning code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_warn_code.html*/ + @Override + public void onWarning(int warn) + { + Log.w(TAG, String.format("onWarning code %d message %s", warn, RtcEngine.getErrorDescription(warn))); + } + + /**Reports an error during SDK runtime. + * Error code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html*/ + @Override + public void onError(int err) + { + Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + } + + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics.*/ + @Override + public void onLeaveChannel(RtcStats stats) + { + super.onLeaveChannel(stats); + Log.i(TAG, String.format("local user %d leaveChannel!", myUid)); + showLongToast(String.format("local user %d leaveChannel!", myUid)); + } + + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) + { + Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + myUid = uid; + joined = true; + handler.post(new Runnable() + { + @Override + public void run() + { + join.setEnabled(true); + join.setText(getString(R.string.leave)); + } + }); + } + + /**Since v2.9.0. + * This callback indicates the state change of the remote audio stream. + * PS: This callback does not work properly when the number of users (in the Communication profile) or + * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the user whose audio state changes. + * @param state State of the remote audio + * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due + * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), + * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). + * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. + * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, + * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). + * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). + * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to + * REMOTE_AUDIO_REASON_INTERNAL(0). + * @param reason The reason of the remote audio state change. + * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio + * stream or disables the audio module. + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio + * stream or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or + * disables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream + * or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method + * until the SDK triggers this callback.*/ + @Override + public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteAudioStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Since v2.9.0. + * Occurs when the remote video state changes. + * PS: This callback does not work properly when the number of users (in the Communication + * profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video: + * REMOTE_VIDEO_STATE_STOPPED(0): The remote video is in the default state, probably due + * to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5), + * or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7). + * REMOTE_VIDEO_STATE_STARTING(1): The first remote video packet is received. + * REMOTE_VIDEO_STATE_DECODING(2): The remote video stream is decoded and plays normally, + * probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6), + * or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9). + * REMOTE_VIDEO_STATE_FROZEN(3): The remote video is frozen, probably due to + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8). + * REMOTE_VIDEO_STATE_FAILED(4): The remote video fails to start, probably due to + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0). + * @param reason The reason of the remote video state change: + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0): Internal reasons. + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3): The local user stops receiving the remote + * video stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote + * video stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5): The remote user stops sending the video + * stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the video + * stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8): The remote media stream falls back to the + * audio-only stream due to poor network conditions. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9): The remote media stream switches + * back to the video stream after the network conditions improve. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method until + * the SDK triggers this callback.*/ + @Override + public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteVideoStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered.*/ + @Override + public void onUserJoined(int uid, int elapsed) + { + super.onUserJoined(uid, elapsed); + Log.i(TAG, "onUserJoined->" + uid); + showLongToast(String.format("user %d joined!", uid)); + /**Check if the context is correct*/ + Context context = getContext(); + if (context == null) return; + handler.post(() -> + { + /**Display remote video stream*/ + SurfaceView surfaceView = null; + if (fl_remote.getChildCount() == 0) + { + // Create render view by RtcEngine + surfaceView = RtcEngine.CreateRendererView(context); + // Add to the remote container + fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + } + else + { + View view = fl_remote.getChildAt(0); + if (view instanceof SurfaceView) + { + surfaceView = (SurfaceView) view; + } + } + + // Setup remote video to render + engine.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); + }); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience.*/ + @Override + public void onUserOffline(int uid, int reason) + { + Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); + showLongToast(String.format("user %d offline! reason:%d", uid, reason)); + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }; +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java index cbce99753..0c281272d 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/ClassUtils.java @@ -21,7 +21,7 @@ import java.util.regex.Pattern; import dalvik.system.DexFile; -import io.agora.rtc.BuildConfig; +import io.agora.api.example.BuildConfig; public class ClassUtils { diff --git a/Android/APIExample/app/src/main/res/layout/fragment_stream_encrypt.xml b/Android/APIExample/app/src/main/res/layout/fragment_stream_encrypt.xml new file mode 100644 index 000000000..786967999 --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/fragment_stream_encrypt.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml index c9d51c5a3..6cb1f12e3 100755 --- a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml +++ b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml @@ -30,6 +30,9 @@ + + diff --git a/Android/APIExample/lib-component/.gitignore b/Android/APIExample/lib-component/.gitignore new file mode 100644 index 000000000..da62f148c --- /dev/null +++ b/Android/APIExample/lib-component/.gitignore @@ -0,0 +1,20 @@ +*.iml +.gradle +/local.properties +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +gradle +gradlew +gradlew.bat +.externalNativeBuild +.cxx +androidTest/ +Test/ diff --git a/Android/APIExample/lib-component/build.gradle b/Android/APIExample/lib-component/build.gradle new file mode 100644 index 000000000..e79e9edb1 --- /dev/null +++ b/Android/APIExample/lib-component/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + + api 'io.agora.rtc:full-sdk:3.0.1' +} diff --git a/Android/APIExample/lib-component/consumer-rules.pro b/Android/APIExample/lib-component/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/Android/APIExample/lib-component/proguard-rules.pro b/Android/APIExample/lib-component/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/Android/APIExample/lib-component/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/Android/APIExample/lib-component/src/main/AndroidManifest.xml b/Android/APIExample/lib-component/src/main/AndroidManifest.xml new file mode 100644 index 000000000..d8659af65 --- /dev/null +++ b/Android/APIExample/lib-component/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/Android/APIExample/lib-stream-encrypt/.gitignore b/Android/APIExample/lib-stream-encrypt/.gitignore new file mode 100644 index 000000000..da62f148c --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/.gitignore @@ -0,0 +1,20 @@ +*.iml +.gradle +/local.properties +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +gradle +gradlew +gradlew.bat +.externalNativeBuild +.cxx +androidTest/ +Test/ diff --git a/Android/APIExample/lib-stream-encrypt/CMakeLists.txt b/Android/APIExample/lib-stream-encrypt/CMakeLists.txt new file mode 100644 index 000000000..22ce7510f --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/CMakeLists.txt @@ -0,0 +1,16 @@ +# For more information about using CMake with Android Studio, read the +# documentation: https://d.android.com/studio/projects/add-native-code.html + +# Sets the minimum version of CMake required to build the native library. + +cmake_minimum_required(VERSION 3.4.1) + +add_library(apm-plugin-packet-processing SHARED + ./src/main/cpp/packet_processing_plugin_jni.cpp +) + +include_directories(./src/main/cpp/include) + +find_library(log-lib log) + +target_link_libraries(apm-plugin-packet-processing ${log-lib}) \ No newline at end of file diff --git a/Android/APIExample/lib-stream-encrypt/build.gradle b/Android/APIExample/lib-stream-encrypt/build.gradle new file mode 100644 index 000000000..df5ab811e --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/build.gradle @@ -0,0 +1,41 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + externalNativeBuild { + cmake { + path 'CMakeLists.txt' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + + api project(path: ':lib-component') +} diff --git a/Android/APIExample/lib-stream-encrypt/consumer-rules.pro b/Android/APIExample/lib-stream-encrypt/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/Android/APIExample/lib-stream-encrypt/proguard-rules.pro b/Android/APIExample/lib-stream-encrypt/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/Android/APIExample/lib-stream-encrypt/src/main/AndroidManifest.xml b/Android/APIExample/lib-stream-encrypt/src/main/AndroidManifest.xml new file mode 100644 index 000000000..dee6bb4ab --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h new file mode 100644 index 000000000..29407b5d8 --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h @@ -0,0 +1,737 @@ +// Agora Engine SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +#ifndef AGORA_BASE_H +#define AGORA_BASE_H + +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#include +#define AGORA_CALL __cdecl +#if defined(AGORARTC_EXPORT) +#define AGORA_API extern "C" __declspec(dllexport) +#define AGORA_CPP_API __declspec(dllexport) +#else +#define AGORA_API extern "C" __declspec(dllimport) +#define AGORA_CPP_API __declspec(dllimport) +#endif +#elif defined(__APPLE__) +#include +#define AGORA_API __attribute__((visibility("default"))) extern "C" +#define AGORA_CPP_API __attribute__((visibility("default"))) +#define AGORA_CALL +#elif defined(__ANDROID__) || defined(__linux__) +#define AGORA_API extern "C" __attribute__((visibility("default"))) +#define AGORA_CPP_API __attribute__((visibility("default"))) +#define AGORA_CALL +#else +#define AGORA_API extern "C" +#define AGORA_CPP_API +#define AGORA_CALL +#endif + +namespace agora { +namespace util { + +template +class AutoPtr { + typedef T value_type; + typedef T* pointer_type; +public: + AutoPtr(pointer_type p=0) + :ptr_(p) + {} + ~AutoPtr() { + if (ptr_) + ptr_->release(); + } + operator bool() const { return ptr_ != (pointer_type)0; } + value_type& operator*() const { + return *get(); + } + + pointer_type operator->() const { + return get(); + } + + pointer_type get() const { + return ptr_; + } + + pointer_type release() { + pointer_type tmp = ptr_; + ptr_ = 0; + return tmp; + } + + void reset(pointer_type ptr = 0) { + if (ptr != ptr_ && ptr_) + ptr_->release(); + ptr_ = ptr; + } + template + bool queryInterface(C1* c, C2 iid) { + pointer_type p = NULL; + if (c && !c->queryInterface(iid, (void**)&p)) + { + reset(p); + } + return p != NULL; + } +private: + AutoPtr(const AutoPtr&); + AutoPtr& operator=(const AutoPtr&); +private: + pointer_type ptr_; +}; +class IString { +protected: + virtual ~IString(){} +public: + virtual bool empty() const = 0; + virtual const char* c_str() = 0; + virtual const char* data() = 0; + virtual size_t length() = 0; + virtual void release() = 0; +}; +typedef AutoPtr AString; + +}//namespace util + +enum INTERFACE_ID_TYPE +{ + AGORA_IID_AUDIO_DEVICE_MANAGER = 1, + AGORA_IID_VIDEO_DEVICE_MANAGER = 2, + AGORA_IID_RTC_ENGINE_PARAMETER = 3, + AGORA_IID_MEDIA_ENGINE = 4, + AGORA_IID_SIGNALING_ENGINE = 8, +}; + + /** Warning code. + */ +enum WARN_CODE_TYPE +{ + /** 8: The specified view is invalid. Specify a view when using the video call function. + */ + WARN_INVALID_VIEW = 8, + /** 16: Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected. + */ + WARN_INIT_VIDEO = 16, + /** 20: The request is pending, usually due to some module not being ready, and the SDK postponed processing the request. + */ + WARN_PENDING = 20, + /** 103: No channel resources are available. Maybe because the server cannot allocate any channel resource. + */ + WARN_NO_AVAILABLE_CHANNEL = 103, + /** 104: A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server. + */ + WARN_LOOKUP_CHANNEL_TIMEOUT = 104, + /** **DEPRECATED** 105: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. + + Deprecated as of v2.4.1. Use CONNECTION_CHANGED_REJECTED_BY_SERVER(10) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + */ + WARN_LOOKUP_CHANNEL_REJECTED = 105, + /** 106: A timeout occurs when opening the channel. Once the specific channel is found, the SDK opens the channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server. + */ + WARN_OPEN_CHANNEL_TIMEOUT = 106, + /** 107: The server rejects the request to open the channel. The server cannot process this request or the request is illegal. + */ + WARN_OPEN_CHANNEL_REJECTED = 107, + + // sdk: 100~1000 + /** 111: A timeout occurs when switching to the live video. + */ + WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111, + /** 118: A timeout occurs when setting the client role in the live broadcast profile. + */ + WARN_SET_CLIENT_ROLE_TIMEOUT = 118, + /** 121: The ticket to open the channel is invalid. + */ + WARN_OPEN_CHANNEL_INVALID_TICKET = 121, + /** 122: Try connecting to another server. + */ + WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122, + /** 131: The channel connection cannot be recovered. */ + WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131, + WARN_CHANNEL_CONNECTION_IP_CHANGED = 132, + WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133, + /** 701: An error occurs in opening the audio mixing file. + */ + WARN_AUDIO_MIXING_OPEN_ERROR = 701, + /** 1014: Audio Device Module: a warning occurs in the playback device. + */ + WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014, + /** 1016: Audio Device Module: a warning occurs in the recording device. + */ + WARN_ADM_RUNTIME_RECORDING_WARNING = 1016, + /** 1019: Audio Device Module: no valid audio data is collected. + */ + WARN_ADM_RECORD_AUDIO_SILENCE = 1019, + /** 1020: Audio Device Module: the playback device fails. + */ + WARN_ADM_PLAYOUT_MALFUNCTION = 1020, + /** 1021: Audio Device Module: the recording device fails. + */ + WARN_ADM_RECORD_MALFUNCTION = 1021, + /** 1025: The audio playback or recording is interrupted by system events (such as a phone call). + */ + WARN_ADM_CALL_INTERRUPTION = 1025, + /** 1029: During a call, the audio session category should be set to + * AVAudioSessionCategoryPlayAndRecord, and RtcEngine monitors this value. + * If the audio session category is set to other values, this warning code + * is triggered and RtcEngine will forcefully set it back to + * AVAudioSessionCategoryPlayAndRecord. + */ + WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD = 1029, + + WARN_ADM_IOS_SAMPLERATE_CHANGE = 1030, + + /** 1031: Audio Device Module: the recorded audio voice is too low. + */ + WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031, + /** 1032: Audio Device Module: the playback audio voice is too low. + */ + WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032, + WARN_ADM_RECORD_AUDIO_IS_ACTIVE = 1033, + /** 1040: Audio device module: An exception occurs with the audio drive. + * Solutions: + * - Disable or re-enable the audio device. + * - Re-enable your device. + * - Update the sound card drive. + */ + WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040, + /** 1042: Audio device module: The audio recording device is different from the audio playback device, + * which may cause echoes problem. Agora recommends using the same audio device to record and playback + * audio. + */ + WARN_ADM_INCONSISTENT_AUDIO_DEVICE = 1042, + /** 1051: (Communication profile only) audio Processing Module: howling is detected. + */ + WARN_APM_HOWLING = 1051, + /** 1052: Audio Device Module: the device is in the glitch state. + */ + WARN_ADM_GLITCH_STATE = 1052, + /** 1053: Audio Device Module: the underlying audio settings have changed. + */ + WARN_ADM_IMPROPER_SETTINGS = 1053, + /// @cond + WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, + /// @endcond + /** 1323: Audio device module: No available playback device. + * Solution: Plug in the audio device. + */ + WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, + /** Audio device module: The capture device is released improperly. + * Solutions: + * - Disable or re-enable the audio device. + * - Re-enable your device. + * - Update the sound card drive. + */ + WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324, + /** 1610: Super-resolution warning: the original video dimensions of the remote user exceed 640 * 480. + */ + WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION = 1610, + /** 1611: Super-resolution warning: another user is using super resolution. + */ + WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION = 1611, + /** 1612: The device is not supported. + */ + WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED = 1612, + /// @cond + WARN_RTM_LOGIN_TIMEOUT = 2005, + WARN_RTM_KEEP_ALIVE_TIMEOUT = 2009 + /// @endcond +}; + +/** Error code. +*/ +enum ERROR_CODE_TYPE +{ + /** 0: No error occurs. + */ + ERR_OK = 0, + //1~1000 + /** 1: A general error occurs (no specified reason). + */ + ERR_FAILED = 1, + /** 2: An invalid parameter is used. For example, the specific channel name includes illegal characters. + */ + ERR_INVALID_ARGUMENT = 2, + /** 3: The SDK module is not ready. Possible solutions: + + - Check the audio device. + - Check the completeness of the application. + - Re-initialize the RTC engine. + */ + ERR_NOT_READY = 3, + /** 4: The SDK does not support this function. + */ + ERR_NOT_SUPPORTED = 4, + /** 5: The request is rejected. + */ + ERR_REFUSED = 5, + /** 6: The buffer size is not big enough to store the returned data. + */ + ERR_BUFFER_TOO_SMALL = 6, + /** 7: The SDK is not initialized before calling this method. + */ + ERR_NOT_INITIALIZED = 7, + /** 9: No permission exists. Check if the user has granted access to the audio or video device. + */ + ERR_NO_PERMISSION = 9, + /** 10: An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (more than 10 seconds) for the SDK to process. + */ + ERR_TIMEDOUT = 10, + /** 11: The request is canceled. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_CANCELED = 11, + /** 12: The method is called too often. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_TOO_OFTEN = 12, + /** 13: The SDK fails to bind to the network socket. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_BIND_SOCKET = 13, + /** 14: The network is unavailable. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_NET_DOWN = 14, + /** 15: No network buffers are available. This is for internal SDK internal use only, and it does not return to the application through any method or callback. + */ + ERR_NET_NOBUFS = 15, + /** 17: The request to join the channel is rejected. This error usually occurs when the user is already in the channel, and still calls the method to join the channel, for example, \ref agora::rtc::IRtcEngine::joinChannel "joinChannel". + */ + ERR_JOIN_CHANNEL_REJECTED = 17, + /** 18: The request to leave the channel is rejected. + + This error usually occurs: + + - When the user has left the channel and still calls \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, stop calling \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel". + - When the user has not joined the channel and still calls \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, no extra operation is needed. + */ + ERR_LEAVE_CHANNEL_REJECTED = 18, + /** 19: Resources are occupied and cannot be reused. + */ + ERR_ALREADY_IN_USE = 19, + /** 20: The SDK gives up the request due to too many requests. + */ + ERR_ABORTED = 20, + /** 21: In Windows, specific firewall settings can cause the SDK to fail to initialize and crash. + */ + ERR_INIT_NET_ENGINE = 21, + /** 22: The application uses too much of the system resources and the SDK fails to allocate the resources. + */ + ERR_RESOURCE_LIMITED = 22, + /** 101: The specified App ID is invalid. Please try to rejoin the channel with a valid App ID. + */ + ERR_INVALID_APP_ID = 101, + /** 102: The specified channel name is invalid. Please try to rejoin the channel with a valid channel name. + */ + ERR_INVALID_CHANNEL_NAME = 102, + /** **DEPRECATED** 109: Deprecated as of v2.4.1. Use CONNECTION_CHANGED_TOKEN_EXPIRED(9) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + + The token expired due to one of the following reasons: + + - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the Token to access the Agora service within 24 hours after the Token is generated. If the user does not access the Agora service after 24 hours, this Token is no longer valid. + - Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel. + */ + ERR_TOKEN_EXPIRED = 109, + /** **DEPRECATED** 110: Deprecated as of v2.4.1. Use CONNECTION_CHANGED_INVALID_TOKEN(8) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + + The token is invalid due to one of the following reasons: + + - The App Certificate for the project is enabled in Console, but the user is still using the App ID. Once the App Certificate is enabled, the user must use a token. + - The uid is mandatory, and users must set the same uid as the one set in the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + */ + ERR_INVALID_TOKEN = 110, + /** 111: The internet connection is interrupted. This applies to the Agora Web SDK only. + */ + ERR_CONNECTION_INTERRUPTED = 111, // only used in web sdk + /** 112: The internet connection is lost. This applies to the Agora Web SDK only. + */ + ERR_CONNECTION_LOST = 112, // only used in web sdk + /** 113: The user is not in the channel when calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" or \ref agora::rtc::IRtcEngine::getUserInfoByUserAccount "getUserInfoByUserAccount" method. + */ + ERR_NOT_IN_CHANNEL = 113, + /** 114: The size of the sent data is over 1024 bytes when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + */ + ERR_SIZE_TOO_LARGE = 114, + /** 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + */ + ERR_BITRATE_LIMIT = 115, + /** 116: Too many data streams (over 5 streams) are created when the user calls the \ref agora::rtc::IRtcEngine::createDataStream "createDataStream" method. + */ + ERR_TOO_MANY_DATA_STREAMS = 116, + /** 117: The data stream transmission timed out. + */ + ERR_STREAM_MESSAGE_TIMEOUT = 117, + /** 119: Switching roles fail. Please try to rejoin the channel. + */ + ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119, + /** 120: Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel. + */ + ERR_DECRYPTION_FAILED = 120, + /** 123: The client is banned by the server. + */ + ERR_CLIENT_IS_BANNED_BY_SERVER = 123, + /** 124: Incorrect watermark file parameter. + */ + ERR_WATERMARK_PARAM = 124, + /** 125: Incorrect watermark file path. + */ + ERR_WATERMARK_PATH = 125, + /** 126: Incorrect watermark file format. + */ + ERR_WATERMARK_PNG = 126, + /** 127: Incorrect watermark file information. + */ + ERR_WATERMARKR_INFO = 127, + /** 128: Incorrect watermark file data format. + */ + ERR_WATERMARK_ARGB = 128, + /** 129: An error occurs in reading the watermark file. + */ + ERR_WATERMARK_READ = 129, + /** 130: Encryption is enabled when the user calls the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method (CDN live streaming does not support encrypted streams). + */ + ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130, + /** 134: The user account is invalid. */ + ERR_INVALID_USER_ACCOUNT = 134, + + /** 151: CDN related errors. Remove the original URL address and add a new one by calling the \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods. + */ + ERR_PUBLISH_STREAM_CDN_ERROR = 151, + /** 152: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. + */ + ERR_PUBLISH_STREAM_NUM_REACH_LIMIT = 152, + /** 153: The host manipulates other hosts' URLs. Check your app logic. + */ + ERR_PUBLISH_STREAM_NOT_AUTHORIZED = 153, + /** 154: An error occurs in Agora's streaming server. Call the addPublishStreamUrl method to publish the streaming again. + */ + ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR = 154, + /** 155: The server fails to find the stream. + */ + ERR_PUBLISH_STREAM_NOT_FOUND = 155, + /** 156: The format of the RTMP stream URL is not supported. Check whether the URL format is correct. + */ + ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED = 156, + + //signaling: 400~600 + ERR_LOGOUT_OTHER = 400, // + ERR_LOGOUT_USER = 401, // logout by user + ERR_LOGOUT_NET = 402, // network failure + ERR_LOGOUT_KICKED = 403, // login in other device + ERR_LOGOUT_PACKET = 404, // + ERR_LOGOUT_TOKEN_EXPIRED = 405, // token expired + ERR_LOGOUT_OLDVERSION = 406, // + ERR_LOGOUT_TOKEN_WRONG = 407, + ERR_LOGOUT_ALREADY_LOGOUT = 408, + ERR_LOGIN_OTHER = 420, + ERR_LOGIN_NET = 421, + ERR_LOGIN_FAILED = 422, + ERR_LOGIN_CANCELED = 423, + ERR_LOGIN_TOKEN_EXPIRED = 424, + ERR_LOGIN_OLD_VERSION = 425, + ERR_LOGIN_TOKEN_WRONG = 426, + ERR_LOGIN_TOKEN_KICKED = 427, + ERR_LOGIN_ALREADY_LOGIN = 428, + ERR_JOIN_CHANNEL_OTHER = 440, + ERR_SEND_MESSAGE_OTHER = 440, + ERR_SEND_MESSAGE_TIMEOUT = 441, + ERR_QUERY_USERNUM_OTHER = 450, + ERR_QUERY_USERNUM_TIMEOUT = 451, + ERR_QUERY_USERNUM_BYUSER = 452, + ERR_LEAVE_CHANNEL_OTHER = 460, + ERR_LEAVE_CHANNEL_KICKED = 461, + ERR_LEAVE_CHANNEL_BYUSER = 462, + ERR_LEAVE_CHANNEL_LOGOUT = 463, + ERR_LEAVE_CHANNEL_DISCONNECTED = 464, + ERR_INVITE_OTHER = 470, + ERR_INVITE_REINVITE = 471, + ERR_INVITE_NET = 472, + ERR_INVITE_PEER_OFFLINE = 473, + ERR_INVITE_TIMEOUT = 474, + ERR_INVITE_CANT_RECV = 475, + + + //1001~2000 + /** 1001: Fails to load the media engine. + */ + ERR_LOAD_MEDIA_ENGINE = 1001, + /** 1002: Fails to start the call after enabling the media engine. + */ + ERR_START_CALL = 1002, + /** **DEPRECATED** 1003: Fails to start the camera. + + Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE(4) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + */ + ERR_START_CAMERA = 1003, + /** 1004: Fails to start the video rendering module. + */ + ERR_START_VIDEO_RENDER = 1004, + /** 1005: A general error occurs in the Audio Device Module (no specified reason). Check if the audio device is used by another application, or try rejoining the channel. + */ + ERR_ADM_GENERAL_ERROR = 1005, + /** 1006: Audio Device Module: An error occurs in using the Java resources. + */ + ERR_ADM_JAVA_RESOURCE = 1006, + /** 1007: Audio Device Module: An error occurs in setting the sampling frequency. + */ + ERR_ADM_SAMPLE_RATE = 1007, + /** 1008: Audio Device Module: An error occurs in initializing the playback device. + */ + ERR_ADM_INIT_PLAYOUT = 1008, + /** 1009: Audio Device Module: An error occurs in starting the playback device. + */ + ERR_ADM_START_PLAYOUT = 1009, + /** 1010: Audio Device Module: An error occurs in stopping the playback device. + */ + ERR_ADM_STOP_PLAYOUT = 1010, + /** 1011: Audio Device Module: An error occurs in initializing the recording device. + */ + ERR_ADM_INIT_RECORDING = 1011, + /** 1012: Audio Device Module: An error occurs in starting the recording device. + */ + ERR_ADM_START_RECORDING = 1012, + /** 1013: Audio Device Module: An error occurs in stopping the recording device. + */ + ERR_ADM_STOP_RECORDING = 1013, + /** 1015: Audio Device Module: A playback error occurs. Check your playback device and try rejoining the channel. + */ + ERR_ADM_RUNTIME_PLAYOUT_ERROR = 1015, + /** 1017: Audio Device Module: A recording error occurs. + */ + ERR_ADM_RUNTIME_RECORDING_ERROR = 1017, + /** 1018: Audio Device Module: Fails to record. + */ + ERR_ADM_RECORD_AUDIO_FAILED = 1018, + /** 1022: Audio Device Module: An error occurs in initializing the + * loopback device. + */ + ERR_ADM_INIT_LOOPBACK = 1022, + /** 1023: Audio Device Module: An error occurs in starting the loopback + * device. + */ + ERR_ADM_START_LOOPBACK = 1023, + /** 1027: Audio Device Module: No recording permission exists. Check if the + * recording permission is granted. + */ + ERR_ADM_NO_PERMISSION = 1027, + /** 1033: Audio device module: The device is occupied. + */ + ERR_ADM_RECORD_AUDIO_IS_ACTIVE = 1033, + /** 1101: Audio device module: A fatal exception occurs. + */ + ERR_ADM_ANDROID_JNI_JAVA_RESOURCE = 1101, + /** 1108: Audio device module: The recording frequency is lower than 50. + * 0 indicates that the recording is not yet started. We recommend + * checking your recording permission. + */ + ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY = 1108, + /** 1109: The playback frequency is lower than 50. 0 indicates that the + * playback is not yet started. We recommend checking if you have created + * too many AudioTrack instances. + */ + ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY = 1109, + /** 1111: Audio device module: AudioRecord fails to start up. A ROM system + * error occurs. We recommend the following options to debug: + * - Restart your App. + * - Restart your cellphone. + * - Check your recording permission. + */ + ERR_ADM_ANDROID_JNI_JAVA_START_RECORD = 1111, + /** 1112: Audio device module: AudioTrack fails to start up. A ROM system + * error occurs. We recommend the following options to debug: + * - Restart your App. + * - Restart your cellphone. + * - Check your playback permission. + */ + ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK = 1112, + /** 1115: Audio device module: AudioRecord returns error. The SDK will + * automatically restart AudioRecord. */ + ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR = 1115, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE = 1151, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER = 1153, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD = 1156, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER = 1157, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD = 1160, + /** 1201: Audio device module: The current device does not support audio + * input, possibly because you have mistakenly configured the audio session + * category, or because some other app is occupying the input device. We + * recommend terminating all background apps and re-joining the channel. */ + ERR_ADM_IOS_INPUT_NOT_AVAILABLE = 1201, + /** 1206: Audio device module: Cannot activate the Audio Session.*/ + ERR_ADM_IOS_ACTIVATE_SESSION_FAIL = 1206, + /** 1210: Audio device module: Fails to initialize the audio device, + * normally because the audio device parameters are wrongly set.*/ + ERR_ADM_IOS_VPIO_INIT_FAIL = 1210, + /** 1213: Audio device module: Fails to re-initialize the audio device, + * normally because the audio device parameters are wrongly set.*/ + ERR_ADM_IOS_VPIO_REINIT_FAIL = 1213, + /** 1214: Fails to re-start up the Audio Unit, possibly because the audio + * session category is not compatible with the settings of the Audio Unit. + */ + ERR_ADM_IOS_VPIO_RESTART_FAIL = 1214, + /// @cond + ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL = 1219, + /// @endcond + /** **DEPRECATED** */ + ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO = 1221, + /** 1301: Audio device module: An audio driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system.*/ + ERR_ADM_WIN_CORE_INIT = 1301, + /** 1303: Audio device module: A recording driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system. */ + ERR_ADM_WIN_CORE_INIT_RECORDING = 1303, + /** 1306: Audio device module: A playout driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system. */ + ERR_ADM_WIN_CORE_INIT_PLAYOUT = 1306, + /** 1307: Audio device module: No audio device is available. Solutions: + * Plug in a proper audio device. */ + ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL = 1307, + /** 1309: Audio device module: An audio driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system. */ + ERR_ADM_WIN_CORE_START_RECORDING = 1309, + /** 1311: Audio device module: Insufficient system memory or poor device + * performance. Solutions: Reboot the system or replace the device. + */ + ERR_ADM_WIN_CORE_CREATE_REC_THREAD = 1311, + /** 1314: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver.*/ + ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP = 1314, + /** 1319: Audio device module: Insufficient system memory or poor device + * performance. Solutions: Reboot the system or replace the device. */ + ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD = 1319, + /** 1320: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Replace the device. */ + ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP = 1320, + /** 1322: Audio device module: No audio sampling device is available. + * Solutions: Plug in a proper recording device. */ + ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, + /** 1323: Audio device module: No audio playout device is available. + * Solutions: Plug in a proper playback device.*/ + ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, + /** 1351: Audio device module: An audio driver abnormality or a + * compatibility issue occurs. Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT = 1351, + /** 1353: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_RECORDING = 1353, + /** 1354: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_MICROPHONE = 1354, + /** 1355: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_PLAYOUT = 1355, + /** 1356: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_SPEAKER = 1356, + /** 1357: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_START_RECORDING = 1357, + /** 1358: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver.*/ + ERR_ADM_WIN_WAVE_START_PLAYOUT = 1358, + /** 1359: Audio Device Module: No recording device exists. + */ + ERR_ADM_NO_RECORDING_DEVICE = 1359, + /** 1360: Audio Device Module: No playback device exists. + */ + ERR_ADM_NO_PLAYOUT_DEVICE = 1360, + + // VDM error code starts from 1500 + /** 1501: Video Device Module: The camera is unauthorized. + */ + ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501, + + // VDM error code starts from 1500 + /** **DEPRECATED** 1502: Video Device Module: The camera in use. + + Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY(3) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + */ + ERR_VDM_WIN_DEVICE_IN_USE = 1502, + + // VCM error code starts from 1600 + /** 1600: Video Device Module: An unknown error occurs. + */ + ERR_VCM_UNKNOWN_ERROR = 1600, + /** 1601: Video Device Module: An error occurs in initializing the video encoder. + */ + ERR_VCM_ENCODER_INIT_ERROR = 1601, + /** 1602: Video Device Module: An error occurs in encoding. + */ + ERR_VCM_ENCODER_ENCODE_ERROR = 1602, + /** 1603: Video Device Module: An error occurs in setting the video encoder. + */ + ERR_VCM_ENCODER_SET_ERROR = 1603, +}; + + /** Output log filter level. */ +enum LOG_FILTER_TYPE +{ +/** 0: Do not output any log information. */ + LOG_FILTER_OFF = 0, + /** 0x080f: Output all log information. + Set your log filter as debug if you want to get the most complete log file. */ + LOG_FILTER_DEBUG = 0x080f, + /** 0x000f: Output CRITICAL, ERROR, WARNING, and INFO level log information. + We recommend setting your log filter as this level. + */ + LOG_FILTER_INFO = 0x000f, + /** 0x000e: Outputs CRITICAL, ERROR, and WARNING level log information. + */ + LOG_FILTER_WARN = 0x000e, + /** 0x000c: Outputs CRITICAL and ERROR level log information. */ + LOG_FILTER_ERROR = 0x000c, + /** 0x0008: Outputs CRITICAL level log information. */ + LOG_FILTER_CRITICAL = 0x0008, + /// @cond + LOG_FILTER_MASK = 0x80f, + /// @endcond +}; +} // namespace agora + +#endif diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraRtcCryptoCppLoader.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraRtcCryptoCppLoader.h new file mode 100644 index 000000000..58e4902c1 --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/AgoraRtcCryptoCppLoader.h @@ -0,0 +1,18 @@ +// +// AgoraRtcCryptoCppLoader.h +// AgoraRtcCryptoLoader +// +// Copyright © 2019 Agora IO. All rights reserved. +// + +#ifndef AgoraRtcCryptoCppLoader_h +#define AgoraRtcCryptoCppLoader_h + +class AgoraRtcCryptoCppLoader +{ +public: + AgoraRtcCryptoCppLoader(); + ~AgoraRtcCryptoCppLoader(); +}; + +#endif /* AgoraRtcCryptoCppLoader_h */ diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraMediaEngine.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraMediaEngine.h new file mode 100644 index 000000000..2ebf3abab --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraMediaEngine.h @@ -0,0 +1,736 @@ +#ifndef AGORA_MEDIA_ENGINE_H +#define AGORA_MEDIA_ENGINE_H +#include + +namespace agora { +namespace media { +/** **DEPRECATED** Type of audio device. + */ +enum MEDIA_SOURCE_TYPE { + /** Audio playback device. + */ + AUDIO_PLAYOUT_SOURCE = 0, + /** Microphone. + */ + AUDIO_RECORDING_SOURCE = 1, +}; + +/** + * The IAudioFrameObserver class. + */ +class IAudioFrameObserver { + public: + /** The frame type. */ + enum AUDIO_FRAME_TYPE { + /** 0: PCM16. */ + FRAME_TYPE_PCM16 = 0, // PCM 16bit little endian + }; + /** Definition of AudioFrame */ + struct AudioFrame { + /** The type of the audio frame. See #AUDIO_FRAME_TYPE + */ + AUDIO_FRAME_TYPE type; + /** The number of samples per channel in the audio frame. + */ + int samples; //number of samples for each channel in this frame + /**The number of bytes per audio sample, which is usually 16-bit (2-byte). + */ + int bytesPerSample; //number of bytes per sample: 2 for PCM16 + /** The number of audio channels. + - 1: Mono + - 2: Stereo (the data is interleaved) + */ + int channels; //number of channels (data are interleaved if stereo) + /** The sample rate. + */ + int samplesPerSec; //sampling rate + /** The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved. + The size of the data buffer is as follows: `buffer` = `samples` × `channels` × `bytesPerSample`. + */ + void* buffer; //data buffer + /** The timestamp of the external audio frame. You can use this parameter for the following purposes: + - Restore the order of the captured audio frame. + - Synchronize audio and video frames in video-related scenarios, including where external video sources are used. + */ + int64_t renderTimeMs; + /** Reserved parameter. + */ + int avsync_type; + }; + + public: + /** Retrieves the recorded audio frame. + + @param audioFrame Pointer to AudioFrame. + @return + - true: Valid buffer in AudioFrame, and the recorded audio frame is sent out. + - false: Invalid buffer in AudioFrame, and the recorded audio frame is discarded. + */ + virtual bool onRecordAudioFrame(AudioFrame& audioFrame) = 0; + /** Retrieves the audio playback frame for getting the audio. + + @param audioFrame Pointer to AudioFrame. + @return + - true: Valid buffer in AudioFrame, and the audio playback frame is sent out. + - false: Invalid buffer in AudioFrame, and the audio playback frame is discarded. + */ + virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) = 0; + /** Retrieves the mixed recorded and playback audio frame. + + + @note This callback only returns the single-channel data. + + @param audioFrame Pointer to AudioFrame. + @return + - true: Valid buffer in AudioFrame and the mixed recorded and playback audio frame is sent out. + - false: Invalid buffer in AudioFrame and the mixed recorded and playback audio frame is discarded. + */ + virtual bool onMixedAudioFrame(AudioFrame& audioFrame) = 0; + /** Retrieves the audio frame of a specified user before mixing. + + The SDK triggers this callback if isMultipleChannelFrameWanted returns false. + + @param uid The user ID + @param audioFrame Pointer to AudioFrame. + @return + - true: Valid buffer in AudioFrame, and the mixed recorded and playback audio frame is sent out. + - false: Invalid buffer in AudioFrame, and the mixed recorded and playback audio frame is discarded. + */ + virtual bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, + AudioFrame& audioFrame) = 0; + /** Determines whether to receive audio data from multiple channels. + + @since v3.0.1 + + After you register the audio frame observer, the SDK triggers this callback every time it captures an audio frame. + + In the multi-channel scenario, if you want to get audio data from multiple channels, + set the return value of this callback as true. After that, the SDK triggers the + \ref IAudioFrameObserver::onPlaybackAudioFrameBeforeMixingEx "onPlaybackAudioFrameBeforeMixingEx" callback to send you the before-mixing + audio data from various channels. You can also get the channel ID of each audio frame. + + @note + - Once you set the return value of this callback as true, the SDK triggers + only the \ref IAudioFrameObserver::onPlaybackAudioFrameBeforeMixingEx "onPlaybackAudioFrameBeforeMixingEx" callback + to send the before-mixing audio frame. \ref IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing "onPlaybackAudioFrameBeforeMixing" is not triggered. + In the multi-channel scenario, Agora recommends setting the return value as true. + - If you set the return value of this callback as false, the SDK triggers only the `onPlaybackAudioFrameBeforeMixing` callback to send the audio data. + @return + - `true`: Receive audio data from multiple channels. + - `false`: Do not receive audio data from multiple channels. + */ + virtual bool isMultipleChannelFrameWanted() { return false; } + + /** Gets the before-mixing playback audio frame from multiple channels. + + After you successfully register the audio frame observer, if you set the return + value of isMultipleChannelFrameWanted as true, the SDK triggers this callback each + time it receives a before-mixing audio frame from any of the channel. + + @param channelId The channel ID of this audio frame. + @param uid The ID of the user sending this audio frame. + @param audioFrame The pointer to AudioFrame. + @return + - `true`: The data in AudioFrame is valid, and send this audio frame. + - `false`: The data in AudioFrame in invalid, and do not send this audio frame. + */ + virtual bool onPlaybackAudioFrameBeforeMixingEx(const char *channelId, + unsigned int uid, AudioFrame& audioFrame) { return true; } + +}; + +/** + * The IVideoFrameObserver class. + */ +class IVideoFrameObserver { + public: + /** The video frame type. */ + enum VIDEO_FRAME_TYPE { + /** + * 0: YUV420 + */ + FRAME_TYPE_YUV420 = 0, // YUV 420 format + /** + * 1: YUV422 + */ + FRAME_TYPE_YUV422 = 1, // YUV 422 format + /** + * 2: RGBA + */ + FRAME_TYPE_RGBA = 2, // RGBA format + }; + /** + * The frame position of the video observer. + */ + enum VIDEO_OBSERVER_POSITION { + /** + * 1: The post-capturer position, which corresponds to the video data in the onCaptureVideoFrame callback. + */ + POSITION_POST_CAPTURER = 1 << 0, + /** + * 2: The pre-renderer position, which corresponds to the video data in the onRenderVideoFrame callback. + */ + POSITION_PRE_RENDERER = 1 << 1, + /** + * 4: The pre-encoder position, which corresponds to the video data in the onPreEncodeVideoFrame callback. + */ + POSITION_PRE_ENCODER = 1 << 2, + }; + /** Video frame information. The video data format is YUV420. The buffer provides a pointer to a pointer. The interface cannot modify the pointer of the buffer, but can modify the content of the buffer only. + */ + struct VideoFrame { + VIDEO_FRAME_TYPE type; + /** Video pixel width. + */ + int width; //width of video frame + /** Video pixel height. + */ + int height; //height of video frame + /** Line span of the Y buffer within the YUV data. + */ + int yStride; //stride of Y data buffer + /** Line span of the U buffer within the YUV data. + */ + int uStride; //stride of U data buffer + /** Line span of the V buffer within the YUV data. + */ + int vStride; //stride of V data buffer + /** Pointer to the Y buffer pointer within the YUV data. + */ + void* yBuffer; //Y data buffer + /** Pointer to the U buffer pointer within the YUV data. + */ + void* uBuffer; //U data buffer + /** Pointer to the V buffer pointer within the YUV data. + */ + void* vBuffer; //V data buffer + /** Set the rotation of this frame before rendering the video. Supports 0, 90, 180, 270 degrees clockwise. + */ + int rotation; // rotation of this frame (0, 90, 180, 270) + /** The timestamp of the external audio frame. It is mandatory. You can use this parameter for the following purposes: + - Restore the order of the captured audio frame. + - Synchronize audio and video frames in video-related scenarios, including scenarios where external video sources are used. + @note This timestamp is for rendering the video stream, and not for capturing the video stream. + */ + int64_t renderTimeMs; + int avsync_type; + }; + + public: + /** Occurs each time the SDK receives a video frame captured by the local camera. + * + * After you successfully register the video frame observer, the SDK triggers this callback each time a video frame is received. In this callback, + * you can get the video data captured by the local camera. You can then pre-process the data according to your scenarios. + * + * After pre-processing, you can send the processed video data back to the SDK by setting the `videoFrame` parameter in this callback. + * + * @note + * This callback does not support sending processed RGBA video data back to the SDK. + * + * @param videoFrame Pointer to VideoFrame. + * @return Whether or not to ignore the current video frame if the pre-processing fails: + * - true: Do not ignore. + * - false: Ignore the current video frame, and do not send it back to the SDK. + */ + virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) = 0; + /** @since v3.0.0 + * + * Occurs each time the SDK receives a video frame before encoding. + * + * After you successfully register the video frame observer, the SDK triggers this callback each time when it receives a video frame. In this callback, you can get the video data before encoding. You can then process the data according to your particular scenarios. + * + * After processing, you can send the processed video data back to the SDK by setting the `VideoFrame` parameter in this callback. + * + * @note + * - As of v3.0.1, if you want to receive this callback, you also need to set `POSITION_PRE_ENCODE(1 << 2)` as a frame position in the \ref getObservedFramePosition "getObservedFramePosition" callback. + * - The video data that this callback gets has been pre-processed, with its content cropped, rotated, and the image enhanced. + * - This callback does not support sending processed RGBA video data back to the SDK. + * + * @param videoFrame A pointer to VideoFrame + * @return Whether to ignore the current video frame if the processing fails: + * - true: Do not ignore the current video frame. + * - false: Ignore the current video frame, and do not send it back to the SDK. + */ + virtual bool onPreEncodeVideoFrame(VideoFrame& videoFrame) { return true; } + /** Occurs each time the SDK receives a video frame sent by the remote user. + * + * After you successfully register the video frame observer and isMultipleChannelFrameWanted return false, the SDK triggers this callback each time a video frame is received. + * In this callback, you can get the video data sent by the remote user. You can then post-process the data according to your scenarios. + * + * After post-processing, you can send the processed data back to the SDK by setting the `videoFrame` parameter in this callback. + * + * @note + * This callback does not support sending processed RGBA video data back to the SDK. + * + * @param uid ID of the remote user who sends the current video frame. + * @param videoFrame Pointer to VideoFrame. + * @return Whether or not to ignore the current video frame if the post-processing fails: + * - true: Do not ignore. + * - false: Ignore the current video frame, and do not send it back to the SDK. + */ + virtual bool onRenderVideoFrame(unsigned int uid, VideoFrame& videoFrame) = 0; + /** Occurs each time the SDK receives a video frame and prompts you to set the video format. + * + * YUV420 is the default video format. If you want to receive other video formats, register this callback in the IVideoFrameObserver class. + * + * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. + * You need to set your preferred video data in the return value of this callback. + * + * @return Sets the video format: #VIDEO_FRAME_TYPE + * - #FRAME_TYPE_YUV420 (0): (Default) YUV420. + * - #FRAME_TYPE_RGBA (2): RGBA + */ + virtual VIDEO_FRAME_TYPE getVideoFormatPreference() { return FRAME_TYPE_YUV420; } + /** Occurs each time the SDK receives a video frame and prompts you whether or not to rotate the captured video according to the rotation member in the VideoFrame class. + * + * The SDK does not rotate the captured video by default. If you want to rotate the captured video according to the rotation member in the VideoFrame class, register this callback in the IVideoFrameObserver class. + * + * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. You need to set whether or not to rotate the video frame in the return value of this callback. + * + * @note + * This callback applies to RGBA video data only. + * + * @return Sets whether or not to rotate the captured video: + * - true: Rotate. + * - false: (Default) Do not rotate. + */ + virtual bool getRotationApplied() { return false; } + /** Occurs each time the SDK receives a video frame and prompts you whether or not to mirror the captured video. + * + * The SDK does not mirror the captured video by default. Register this callback in the IVideoFrameObserver class if you want to mirror the captured video. + * + * After you successfully register the video frame observer, the SDK triggers this callback each time a video frame is received. + * You need to set whether or not to mirror the captured video in the return value of this callback. + * + * @note + * This callback applies to RGBA video data only. + * + * @return Sets whether or not to mirror the captured video: + * - true: Mirror. + * - false: (Default) Do not mirror. + */ + virtual bool getMirrorApplied() { return false; } + /** @since v3.0.0 + + Sets whether to output the acquired video frame smoothly. + + If you want the video frames acquired from \ref IVideoFrameObserver::onRenderVideoFrame "onRenderVideoFrame" to be more evenly spaced, you can register the `getSmoothRenderingEnabled` callback in the `IVideoFrameObserver` class and set its return value as `true`. + + @note + - Register this callback before joining a channel. + - This callback applies to scenarios where the acquired video frame is self-rendered after being processed, not to scenarios where the video frame is sent back to the SDK after being processed. + + @return Set whether or not to smooth the video frames: + - true: Smooth the video frame. + - false: (Default) Do not smooth. + */ + virtual bool getSmoothRenderingEnabled(){ return false; } + /** + * Sets the frame position for the video observer. + * @since v3.0.1 + * + * After you successfully register the video observer, the SDK triggers this callback each time it receives a video frame. You can determine which position to observe by setting the return value. + * The SDK provides 3 positions for observer. Each position corresponds to a callback function: + * - `POSITION_POST_CAPTURER(1 << 0)`: The position after capturing the video data, which corresponds to the \ref onCaptureVideoFrame "onCaptureVideoFrame" callback. + * - `POSITION_PRE_RENDERER(1 << 1)`: The position before receiving the remote video data, which corresponds to the \ref onRenderVideoFrame "onRenderVideoFrame" callback. + * - `POSITION_PRE_ENCODER(1 << 2)`: The position before encoding the video data, which corresponds to the \ref onPreEncodeVideoFrame "onPreEncodeVideoFrame" callback. + * + * @note + * - Use '|' (the OR operator) to observe multiple frame positions. + * - This callback observes `POSITION_POST_CAPTURER(1 << 0)` and `POSITION_PRE_RENDERER(1 << 1)` by default. + * - To conserve the system consumption, you can reduce the number of frame positions that you want to observe. + * + * @return A bit mask that controls the frame position of the video observer: #VIDEO_OBSERVER_POSITION. + * + */ + virtual uint32_t getObservedFramePosition() { return static_cast(POSITION_POST_CAPTURER | POSITION_PRE_RENDERER); } + + /** Determines whether to receive video data from multiple channels. + + After you register the video frame observer, the SDK triggers this callback + every time it captures a video frame. + + In the multi-channel scenario, if you want to get video data from multiple channels, + set the return value of this callback as true. After that, the SDK triggers the + onRenderVideoFrameEx callback to send you + the video data from various channels. You can also get the channel ID of each video frame. + + @note + - Once you set the return value of this callback as true, the SDK triggers only the `onRenderVideoFrameEx` callback to + send the video frame. onRenderVideoFrame will not be triggered. In the multi-channel scenario, Agora recommends setting the return value as true. + - If you set the return value of this callback as false, the SDK triggers only the `onRenderVideoFrame` callback to send the video data. + @return + - `true`: Receive video data from multiple channels. + - `false`: Do not receive video data from multiple channels. + */ + virtual bool isMultipleChannelFrameWanted() { return false; } + + /** Gets the video frame from multiple channels. + + After you successfully register the video frame observer, if you set the return value of + isMultipleChannelFrameWanted as true, the SDK triggers this callback each time it receives a video frame + from any of the channel. + + You can process the video data retrieved from this callback according to your scenario, and send the + processed data back to the SDK using the `videoFrame` parameter in this callback. + + @note This callback does not support sending RGBA video data back to the SDK. + + @param channelId The channel ID of this video frame. + @param uid The ID of the user sending this video frame. + @param videoFrame The pointer to VideoFrame. + @return Whether to send this video frame to the SDK if post-processing fails: + - `true`: Send this video frame. + - `false`: Do not send this video frame. + */ + virtual bool onRenderVideoFrameEx(const char *channelId, unsigned int uid, VideoFrame& videoFrame) { return true; } +}; + +class IVideoFrame { + public: + enum PLANE_TYPE { + Y_PLANE = 0, + U_PLANE = 1, + V_PLANE = 2, + NUM_OF_PLANES = 3 + }; + enum VIDEO_TYPE { + VIDEO_TYPE_UNKNOWN = 0, + VIDEO_TYPE_I420 = 1, + VIDEO_TYPE_IYUV = 2, + VIDEO_TYPE_RGB24 = 3, + VIDEO_TYPE_ABGR = 4, + VIDEO_TYPE_ARGB = 5, + VIDEO_TYPE_ARGB4444 = 6, + VIDEO_TYPE_RGB565 = 7, + VIDEO_TYPE_ARGB1555 = 8, + VIDEO_TYPE_YUY2 = 9, + VIDEO_TYPE_YV12 = 10, + VIDEO_TYPE_UYVY = 11, + VIDEO_TYPE_MJPG = 12, + VIDEO_TYPE_NV21 = 13, + VIDEO_TYPE_NV12 = 14, + VIDEO_TYPE_BGRA = 15, + VIDEO_TYPE_RGBA = 16, + VIDEO_TYPE_I422 = 17, + }; + virtual void release() = 0; + virtual const unsigned char* buffer(PLANE_TYPE type) const = 0; + + /** Copies the frame. + + If the required size is larger than the allocated size, new buffers of the adequate size will be allocated. + + @param dest_frame Address of the returned destination frame. See IVideoFrame. + @return + - 0: Success. + - -1: Failure. + */ + virtual int copyFrame(IVideoFrame** dest_frame) const = 0; + /** Converts the frame. + + @note The source and destination frames have equal heights. + + @param dst_video_type Type of the output video. + @param dst_sample_size Required only for the parsing of M-JPEG. + @param dst_frame Pointer to a destination frame. See IVideoFrame. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int convertFrame(VIDEO_TYPE dst_video_type, int dst_sample_size, + unsigned char* dst_frame) const = 0; + /** Retrieves the specified component in the YUV space. + + @param type Component type: #PLANE_TYPE + */ + virtual int allocated_size(PLANE_TYPE type) const = 0; + /** Retrieves the stride of the specified component in the YUV space. + + @param type Component type: #PLANE_TYPE + */ + virtual int stride(PLANE_TYPE type) const = 0; + /** Retrieves the width of the frame. + */ + virtual int width() const = 0; + /** Retrieves the height of the frame. + */ + virtual int height() const = 0; + /** Retrieves the timestamp (90 ms) of the frame. + */ + virtual unsigned int timestamp() const = 0; + /** Retrieves the render time (ms). + */ + virtual int64_t render_time_ms() const = 0; + /** Checks if a plane is of zero size. + + @return + - true: The plane is of zero size. + - false: The plane is not of zero size. + */ + virtual bool IsZeroSize() const = 0; + + virtual VIDEO_TYPE GetVideoType() const = 0; +}; +/** **DEPRECATED** */ +class IExternalVideoRenderCallback { + public: + /** Occurs when the video view size has changed. + */ + virtual void onViewSizeChanged(int width, int height) = 0; + /** Occurs when the video view is destroyed. + */ + virtual void onViewDestroyed() = 0; +}; +/** **DEPRECATED** */ +struct ExternalVideoRenerContext { + IExternalVideoRenderCallback* renderCallback; + /** Video display window. + */ + void* view; + /** Video display mode: \ref agora::rtc::RENDER_MODE_TYPE "RENDER_MODE_TYPE" */ + int renderMode; + /** The image layer location. + + - 0: (Default) The image is at the bottom of the stack + - 100: The image is at the top of the stack. + + @note If the value is set to below 0 or above 100, the #ERR_INVALID_ARGUMENT error occurs. + */ + int zOrder; + /** Video layout distance from the left. + */ + float left; + /** Video layout distance from the top. + */ + float top; + /** Video layout distance from the right. + */ + float right; + /** Video layout distance from the bottom. + */ + float bottom; +}; + +class IExternalVideoRender { + public: + virtual void release() = 0; + virtual int initialize() = 0; + virtual int deliverFrame(const IVideoFrame& videoFrame, int rotation, + bool mirrored) = 0; +}; + +class IExternalVideoRenderFactory { + public: + virtual IExternalVideoRender* createRenderInstance( + const ExternalVideoRenerContext& context) = 0; +}; + +/** The external video frame. + */ +struct ExternalVideoFrame +{ + /** The video buffer type. + */ + enum VIDEO_BUFFER_TYPE + { + /** 1: The video buffer in the format of raw data. + */ + VIDEO_BUFFER_RAW_DATA = 1, + }; + + /** The video pixel format. + */ + enum VIDEO_PIXEL_FORMAT + { + /** 0: The video pixel format is unknown. + */ + VIDEO_PIXEL_UNKNOWN = 0, + /** 1: The video pixel format is I420. + */ + VIDEO_PIXEL_I420 = 1, + /** 2: The video pixel format is BGRA. + */ + VIDEO_PIXEL_BGRA = 2, + /** 3: The video pixel format is NV21. + */ + VIDEO_PIXEL_NV21 = 3, + /** 4: The video pixel format is RGBA. + */ + VIDEO_PIXEL_RGBA = 4, + /** 5: The video pixel format is IMC2. + */ + VIDEO_PIXEL_IMC2 = 5, + /** 7: The video pixel format is ARGB. + */ + VIDEO_PIXEL_ARGB = 7, + /** 8: The video pixel format is NV12. + */ + VIDEO_PIXEL_NV12 = 8, + /** 16: The video pixel format is I422. + */ + VIDEO_PIXEL_I422 = 16, + }; + + /** The buffer type. See #VIDEO_BUFFER_TYPE + */ + VIDEO_BUFFER_TYPE type; + /** The pixel format. See #VIDEO_PIXEL_FORMAT + */ + VIDEO_PIXEL_FORMAT format; + /** The video buffer. + */ + void* buffer; + /** Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture. + */ + int stride; + /** Height of the incoming video frame. + */ + int height; + /** [Raw data related parameter] The number of pixels trimmed from the left. The default value is 0. + */ + int cropLeft; + /** [Raw data related parameter] The number of pixels trimmed from the top. The default value is 0. + */ + int cropTop; + /** [Raw data related parameter] The number of pixels trimmed from the right. The default value is 0. + */ + int cropRight; + /** [Raw data related parameter] The number of pixels trimmed from the bottom. The default value is 0. + */ + int cropBottom; + /** [Raw data related parameter] The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0. + */ + int rotation; + /** Timestamp of the incoming video frame (ms). An incorrect timestamp results in frame loss or unsynchronized audio and video. + */ + long long timestamp; +}; + +class IMediaEngine { + public: + virtual ~IMediaEngine () {}; + virtual void release() = 0; + /** Registers an audio frame observer object. + + This method is used to register an audio frame observer object (register a callback). This method is required to register callbacks when the engine is required to provide an \ref IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" or \ref IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback. + + @param observer Audio frame observer object instance. If NULL is passed in, the registration is canceled. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0; + /** Registers a video frame observer object. + + You need to implement the IVideoFrameObserver class in this method, and register callbacks according to your scenarios. + + After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received. + + @note When handling the video data returned in the callbacks, pay attention to the changes in the `width` and `height` parameters, + which may be adapted under the following circumstances: + - When the network condition deteriorates, the video resolution decreases incrementally. + - If the user adjusts the video profile, the resolution of the video returned in the callbacks also changes. + @param observer Video frame observer object instance. If NULL is passed in, the registration is canceled. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0; + /** **DEPRECATED** */ + virtual int registerVideoRenderFactory(IExternalVideoRenderFactory* factory) = 0; + /** **DEPRECATED** Use \ref agora::media::IMediaEngine::pushAudioFrame(IAudioFrameObserver::AudioFrame* frame) "pushAudioFrame(IAudioFrameObserver::AudioFrame* frame)" instead. + + Pushes the external audio frame. + + @param type Type of audio capture device: #MEDIA_SOURCE_TYPE. + @param frame Audio frame pointer: \ref IAudioFrameObserver::AudioFrame "AudioFrame". + @param wrap Whether to use the placeholder. We recommend setting the default value. + - true: Use. + - false: (Default) Not use. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pushAudioFrame(MEDIA_SOURCE_TYPE type, + IAudioFrameObserver::AudioFrame* frame, + bool wrap) = 0; + /** Pushes the external audio frame. + + @param frame Pointer to the audio frame: \ref IAudioFrameObserver::AudioFrame "AudioFrame". + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pushAudioFrame(IAudioFrameObserver::AudioFrame* frame) = 0; + /** Pulls the remote audio data. + * + * Before calling this method, call the + * \ref agora::rtc::IRtcEngine::setExternalAudioSink + * "setExternalAudioSink(enabled: true)" method to enable and set the + * external audio sink. + * + * After a successful method call, the app pulls the decoded and mixed + * audio data for playback. + * + * @note + * - Once you call the \ref agora::media::IMediaEngine::pullAudioFrame + * "pullAudioFrame" method successfully, the app will not retrieve any audio + * data from the + * \ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame + * "onPlaybackAudioFrame" callback. + * - The difference between the + * \ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame + * "onPlaybackAudioFrame" callback and the + * \ref agora::media::IMediaEngine::pullAudioFrame "pullAudioFrame" method is as + * follows: + * - `onPlaybackAudioFrame`: The SDK sends the audio data to the app once + * every 10 ms. Any delay in processing the audio frames may result in audio + * jitter. + * - `pullAudioFrame`: The app pulls the remote audio data. After setting the + * audio data parameters, the SDK adjusts the frame buffer and avoids + * problems caused by jitter in the external audio playback. + * + * @param frame Pointers to the audio frame. + * See: \ref IAudioFrameObserver::AudioFrame "AudioFrame". + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int pullAudioFrame(IAudioFrameObserver::AudioFrame* frame) = 0; + /** Configures the external video source. + + @param enable Sets whether to use the external video source: + - true: Use the external video source. + - false: (Default) Do not use the external video source. + + @param useTexture Sets whether to use texture as an input: + - true: Use texture as an input. + - false: (Default) Do not use texture as an input. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setExternalVideoSource(bool enable, bool useTexture) = 0; + /** Pushes the video frame using the \ref ExternalVideoFrame "ExternalVideoFrame" and passes the video frame to the Agora SDK. + + @param frame Video frame to be pushed. See \ref ExternalVideoFrame "ExternalVideoFrame". + + @note In the Communication profile, this method does not support video frames in the Texture format. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pushVideoFrame(ExternalVideoFrame *frame) = 0; +}; + +} // namespace media + +} // namespace agora + +#endif // AGORA_MEDIA_ENGINE_H diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcChannel.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcChannel.h new file mode 100644 index 000000000..bbb0aa12d --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcChannel.h @@ -0,0 +1,1249 @@ +// +// AgoraRtcEngine SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +#ifndef IAgoraRtcChannel_h +#define IAgoraRtcChannel_h +#include "IAgoraRtcEngine.h" + +namespace agora { +namespace rtc { +/** The channel media options. */ +struct ChannelMediaOptions { + /** Determines whether to subscribe to audio streams when the user joins the channel: + - true: (Default) Subscribe. + - false: Do not subscribe. + + This member serves a similar function to the \ref agora::rtc::IChannel::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method. After joining the channel, + you can call the `muteAllRemoteAudioStreams` method to set whether to subscribe to audio streams in the channel. + */ + bool autoSubscribeAudio; + /** Determines whether to subscribe to video streams when the user joins the channel: + - true: (Default) Subscribe. + - false: Do not subscribe. + + This member serves a similar function to the \ref agora::rtc::IChannel::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method. After joining the channel, + you can call the `muteAllRemoteVideoStreams` method to set whether to subscribe to video streams in the channel. + */ + bool autoSubscribeVideo; + ChannelMediaOptions() + : autoSubscribeAudio(true) + , autoSubscribeVideo(true) + {} +}; +/** The IChannel class. */ +class IChannel; +/** The IChannelEventHandler class. */ +class IChannelEventHandler +{ +public: + virtual ~IChannelEventHandler() {} + /** Reports the warning code of `IChannel`. + + @param rtcChannel IChannel + @param warn The warning code: #WARN_CODE_TYPE + @param msg The warning message. + + */ + virtual void onChannelWarning(IChannel *rtcChannel, int warn, const char* msg) { + (void)rtcChannel; + (void)warn; + (void)msg; + } + /** Reports the error code of `IChannel`. + + @param rtcChannel IChannel + @param err The error code: #ERROR_CODE_TYPE + @param msg The error message. + */ + virtual void onChannelError(IChannel *rtcChannel, int err, const char* msg) { + (void)rtcChannel; + (void)err; + (void)msg; + } + /** Occurs when a user joins a channel. + + This callback notifies the application that a user joins a specified channel. + + @param rtcChannel IChannel + @param uid The user ID. If the `uid` is not specified in the \ref IChannel::joinChannel "joinChannel" method, the server automatically assigns a `uid`. + + @param elapsed Time elapsed (ms) from the local user calling \ref IChannel::joinChannel "joinChannel" until this callback is triggered. + */ + virtual void onJoinChannelSuccess(IChannel *rtcChannel, uid_t uid, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)elapsed; + } + /** Occurs when a user rejoins the channel after being disconnected due to network problems. + + @param rtcChannel IChannel + @param uid The user ID. + @param elapsed Time elapsed (ms) from the local user starting to reconnect until this callback is triggered. + + */ + virtual void onRejoinChannelSuccess(IChannel *rtcChannel, uid_t uid, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)elapsed; + } + /** Occurs when a user leaves the channel. + + This callback notifies the application that a user leaves the channel when the application calls the \ref agora::rtc::IChannel::leaveChannel "leaveChannel" method. + + The application retrieves information, such as the call duration and statistics. + + @param rtcChannel IChannel + @param stats The call statistics: RtcStats. + */ + virtual void onLeaveChannel(IChannel *rtcChannel, const RtcStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa. + + This callback notifies the application of a user role switch when the application calls the \ref IChannel::setClientRole "setClientRole" method. + + The SDK triggers this callback when the local user switches the user role by calling the \ref IChannel::setClientRole "setClientRole" method after joining the channel. + + @param rtcChannel IChannel + @param oldRole Role that the user switches from: #CLIENT_ROLE_TYPE. + @param newRole Role that the user switches to: #CLIENT_ROLE_TYPE. + */ + virtual void onClientRoleChanged(IChannel *rtcChannel, CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) { + (void)rtcChannel; + (void)oldRole; + (void)newRole; + } + /** Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel. + + - Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users. + - Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend limiting the number of hosts to 17. + + The SDK triggers this callback under one of the following circumstances: + - A remote user/host joins the channel by calling the \ref agora::rtc::IChannel::joinChannel "joinChannel" method. + - A remote user switches the user role to the host by calling the \ref agora::rtc::IChannel::setClientRole "setClientRole" method after joining the channel. + - A remote user/host rejoins the channel after a network interruption. + - The host injects an online media stream into the channel by calling the \ref agora::rtc::IChannel::addInjectStreamUrl "addInjectStreamUrl" method. + + @note In the Live-broadcast profile: + - The host receives this callback when another host joins the channel. + - The audience in the channel receives this callback when a new host joins the channel. + - When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams. + + @param rtcChannel IChannel + @param uid User ID of the user or host joining the channel. + @param elapsed Time delay (ms) from the local user calling the \ref IChannel::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onUserJoined(IChannel *rtcChannel, uid_t uid, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)elapsed; + } + /** Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + + Reasons why the user is offline: + + - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel. + - Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using the Agora RTM SDK for more reliable offline detection. + + @param rtcChannel IChannel + @param uid User ID of the user leaving the channel or going offline. + @param reason Reason why the user is offline: #USER_OFFLINE_REASON_TYPE. + */ + virtual void onUserOffline(IChannel *rtcChannel, uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + (void)rtcChannel; + (void)uid; + (void)reason; + } + /** Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. + + The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the \ref IChannel::joinChannel "joinChannel" method, whether or not it is in the channel. + + This callback is different from \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted": + + - The SDK triggers the `onConnectionInterrupted` callback when it loses connection with the server for more than four seconds after it successfully joins the channel. + - The SDK triggers the `onConnectionLost` callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. + + If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. + + @param rtcChannel IChannel + */ + virtual void onConnectionLost(IChannel *rtcChannel) { + (void)rtcChannel; + } + /** Occurs when the token expires. + + After a token is specified by calling the \ref IChannel::joinChannel "joinChannel" method, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server. + + This callback notifies the app to generate a new token and call `joinChannel` to rejoin the channel with the new token. + + @param rtcChannel IChannel + */ + virtual void onRequestToken(IChannel *rtcChannel) { + (void)rtcChannel; + } + /** Occurs when the token expires in 30 seconds. + + The user becomes offline if the token used in the \ref IChannel::joinChannel "joinChannel" method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the \ref IChannel::renewToken "renewToken" method to pass the new token to the SDK. + + @param rtcChannel IChannel + @param token Token that expires in 30 seconds. + */ + virtual void onTokenPrivilegeWillExpire(IChannel *rtcChannel, const char* token) { + (void)rtcChannel; + (void)token; + } + /** Reports the statistics of the current call. + + The SDK triggers this callback once every two seconds after the user joins the channel. + + @param rtcChannel IChannel + @param stats Statistics of the RtcEngine: RtcStats. + */ + virtual void onRtcStats(IChannel *rtcChannel, const RtcStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Reports the last mile network quality of each user in the channel once every two seconds. + + Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times. + + @param rtcChannel IChannel + @param uid User ID. The network quality of the user with this @p uid is reported. If @p uid is 0, the local network quality is reported. + @param txQuality Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. @p txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 * 480 and a frame rate of 15 fps in the Live-broadcast profile, but may be inadequate for resolutions higher than 1280 * 720. See #QUALITY_TYPE. + @param rxQuality Downlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE. + */ + virtual void onNetworkQuality(IChannel *rtcChannel, uid_t uid, int txQuality, int rxQuality) { + (void)rtcChannel; + (void)uid; + (void)txQuality; + (void)rxQuality; + } + /** Reports the statistics of the video stream from each remote user/host. + * + * The SDK triggers this callback once every two seconds for each remote + * user/host. If a channel includes multiple remote users, the SDK + * triggers this callback as many times. + * + * @param rtcChannel IChannel + * @param stats Statistics of the remote video stream. See + * RemoteVideoStats. + */ + virtual void onRemoteVideoStats(IChannel *rtcChannel, const RemoteVideoStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Reports the statistics of the audio stream from each remote user/host. + + This callback replaces the \ref agora::rtc::IRtcEngineEventHandler::onAudioQuality "onAudioQuality" callback. + + The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. + + @param rtcChannel IChannel + @param stats The statistics of the received remote audio streams. See RemoteAudioStats. + */ + virtual void onRemoteAudioStats(IChannel *rtcChannel, const RemoteAudioStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Occurs when the remote audio state changes. + + This callback indicates the state change of the remote audio stream. + @note This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + + @param rtcChannel IChannel + @param uid ID of the remote user whose audio state changes. + @param state State of the remote audio. See #REMOTE_AUDIO_STATE. + @param reason The reason of the remote audio state change. + See #REMOTE_AUDIO_STATE_REASON. + @param elapsed Time elapsed (ms) from the local user calling the + \ref IChannel::joinChannel "joinChannel" method until the SDK + triggers this callback. + */ + virtual void onRemoteAudioStateChanged(IChannel *rtcChannel, uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + /** Reports which user is the loudest speaker. + + If the user enables the audio volume indication by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method, this callback returns the @p uid of the active speaker detected by the audio volume detection module of the SDK. + + @note + - To receive this callback, you need to call the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. + - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. + + @param rtcChannel IChannel + @param uid User ID of the active speaker. A `uid` of 0 represents the local user. + */ + virtual void onActiveSpeaker(IChannel *rtcChannel, uid_t uid) { + (void)rtcChannel; + (void)uid; + } + /** Occurs when the video size or rotation of a specified user changes. + + @param rtcChannel IChannel + @param uid User ID of the remote user or local user (0) whose video size or rotation changes. + @param width New width (pixels) of the video. + @param height New height (pixels) of the video. + @param rotation New rotation of the video [0 to 360). + */ + virtual void onVideoSizeChanged(IChannel *rtcChannel, uid_t uid, int width, int height, int rotation) { + (void)rtcChannel; + (void)uid; + (void)width; + (void)height; + (void)rotation; + } + /** Occurs when the remote video state changes. + + @note This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + + @param rtcChannel IChannel + @param uid ID of the remote user whose video state changes. + @param state State of the remote video. See #REMOTE_VIDEO_STATE. + @param reason The reason of the remote video state change. See + #REMOTE_VIDEO_STATE_REASON. + @param elapsed Time elapsed (ms) from the local user calling the + \ref agora::rtc::IChannel::joinChannel "joinChannel" method until the + SDK triggers this callback. + */ + virtual void onRemoteVideoStateChanged(IChannel *rtcChannel, uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + /** Occurs when the local user receives the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method. + + @param rtcChannel IChannel + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param data The data received by the local user. + @param length Length of the data in bytes. + */ + virtual void onStreamMessage(IChannel *rtcChannel, uid_t uid, int streamId, const char* data, size_t length) { + (void)rtcChannel; + (void)uid; + (void)streamId; + (void)data; + (void)length; + } + /** Occurs when the local user does not receive the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method. + + @param rtcChannel IChannel + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param code Error code: #ERROR_CODE_TYPE. + @param missed Number of lost messages. + @param cached Number of incoming cached messages when the data stream is interrupted. + */ + virtual void onStreamMessageError(IChannel *rtcChannel, uid_t uid, int streamId, int code, int missed, int cached) { + (void)rtcChannel; + (void)uid; + (void)streamId; + (void)code; + (void)missed; + (void)cached; + } + /** Occurs when the state of the media stream relay changes. + * + * The SDK returns the state of the current media relay with any error + * message. + * @param rtcChannel IChannel + * @param state The state code in #CHANNEL_MEDIA_RELAY_STATE. + * @param code The error code in #CHANNEL_MEDIA_RELAY_ERROR. + */ + virtual void onChannelMediaRelayStateChanged(IChannel *rtcChannel, CHANNEL_MEDIA_RELAY_STATE state,CHANNEL_MEDIA_RELAY_ERROR code) { + (void)rtcChannel; + (void)state; + (void)code; + } + /** Reports events during the media stream relay. + * @param rtcChannel IChannel + * @param code The event code in #CHANNEL_MEDIA_RELAY_EVENT. + */ + virtual void onChannelMediaRelayEvent(IChannel *rtcChannel, CHANNEL_MEDIA_RELAY_EVENT code) { + (void)rtcChannel; + (void)code; + } + /** + Occurs when the state of the RTMP streaming changes. + + The SDK triggers this callback to report the result of the local user calling the \ref agora::rtc::IChannel::addPublishStreamUrl "addPublishStreamUrl" or \ref agora::rtc::IChannel::removePublishStreamUrl "removePublishStreamUrl" method. + + This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the *errCode* parameter. + + @param rtcChannel IChannel + @param url The RTMP URL address. + @param state The RTMP streaming state. See: #RTMP_STREAM_PUBLISH_STATE. + @param errCode The detailed error information for streaming. See: #RTMP_STREAM_PUBLISH_ERROR. + */ + virtual void onRtmpStreamingStateChanged(IChannel *rtcChannel, const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { + (void)rtcChannel; + (void) url; + (RTMP_STREAM_PUBLISH_STATE) state; + (RTMP_STREAM_PUBLISH_ERROR) errCode; + } + /** Occurs when the publisher's transcoding is updated. + + When the `LiveTranscoding` class in the \ref agora::rtc::IChannel::setLiveTranscoding "setLiveTranscoding" method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information to the local host. + + @note If you call the `setLiveTranscoding` method to set the LiveTranscoding class for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + + @param rtcChannel IChannel + */ + virtual void onTranscodingUpdated(IChannel *rtcChannel) { + (void)rtcChannel; + } + /** Occurs when a voice or video stream URL address is added to a live broadcast. + + @param rtcChannel IChannel + @param url The URL address of the externally injected stream. + @param uid User ID. + @param status State of the externally injected stream: #INJECT_STREAM_STATUS. + */ + virtual void onStreamInjectedStatus(IChannel *rtcChannel, const char* url, uid_t uid, int status) { + (void)rtcChannel; + (void)url; + (void)uid; + (void)status; + } + /** Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve. + + If you call \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" and set *option* as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. + + @param rtcChannel IChannel + @param isFallbackOrRecover Whether the published stream falls back to audio-only or switches back to the video: + - true: The published stream falls back to audio-only due to poor network conditions. + - false: The published stream switches back to the video after the network conditions improve. + */ + virtual void onLocalPublishFallbackToAudioOnly(IChannel *rtcChannel, bool isFallbackOrRecover) { + (void)rtcChannel; + (void)isFallbackOrRecover; + } + /** Occurs when the remote media stream falls back to audio-only stream + * due to poor network conditions or switches back to the video stream + * after the network conditions improve. + * + * If you call + * \ref IRtcEngine::setRemoteSubscribeFallbackOption + * "setRemoteSubscribeFallbackOption" and set + * @p option as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this + * callback when the remote media stream falls back to audio-only mode due + * to poor uplink conditions, or when the remote media stream switches + * back to the video after the uplink network condition improves. + * + * @note Once the remote media stream switches to the low stream due to + * poor network conditions, you can monitor the stream switch between a + * high and low stream in the RemoteVideoStats callback. + * @param rtcChannel IChannel + * @param uid ID of the remote user sending the stream. + * @param isFallbackOrRecover Whether the remotely subscribed media stream + * falls back to audio-only or switches back to the video: + * - true: The remotely subscribed media stream falls back to audio-only + * due to poor network conditions. + * - false: The remotely subscribed media stream switches back to the + * video stream after the network conditions improved. + */ + virtual void onRemoteSubscribeFallbackToAudioOnly(IChannel *rtcChannel, uid_t uid, bool isFallbackOrRecover) { + (void)rtcChannel; + (void)uid; + (void)isFallbackOrRecover; + } + /** Occurs when the connection state between the SDK and the server changes. + + @param rtcChannel IChannel + @param state See #CONNECTION_STATE_TYPE. + @param reason See #CONNECTION_CHANGED_REASON_TYPE. + */ + virtual void onConnectionStateChanged(IChannel *rtcChannel, + CONNECTION_STATE_TYPE state, + CONNECTION_CHANGED_REASON_TYPE reason) { + (void)rtcChannel; + (void)state; + (void)reason; + } +}; + +/** The IChannel class. */ +class IChannel +{ +public: + virtual ~IChannel() {} + /** Releases all IChannel resources. + + @return + - 0: Success. + - < 0: Failure. + - `ERR_NOT_INITIALIZED (7)`: The SDK is not initialized before calling this method. + */ + virtual int release() = 0; + /** Sets the channel event handler. + + After setting the channel event handler, you can listen for channel events and receive the statistics of the corresponding `IChannel` object. + + @param channelEh The event handler of the `IChannel` object. For details, see IChannelEventHandler. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setChannelEventHandler(IChannelEventHandler *channelEh) = 0; + /** Joins the channel with a user ID. + + This method differs from the `joinChannel` method in the `IRtcEngine` class in the following aspects: + + | IChannel::joinChannel | IRtcEngine::joinChannel | + |------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| + | Does not contain the `channelId` parameter, because `channelId` is specified when creating the `IChannel` object. | Contains the `channelId` parameter, which specifies the channel to join. | + | Contains the `options` parameter, which decides whether to subscribe to all streams before joining the channel. | Does not contain the `options` parameter. By default, users subscribe to all streams when joining the channel. | + | Users can join multiple channels simultaneously by creating multiple `IChannel` objects and calling the `joinChannel` method of each object. | Users can join only one channel. | + | By default, the SDK does not publish any stream after the user joins the channel. You need to call the publish method to do that. | By default, the SDK publishes streams once the user joins the channel. | + + @note + - If you are already in a channel, you cannot rejoin it with the same `uid`. + - We recommend using different UIDs for different channels. + - If you want to join the same channel from different devices, ensure that the UIDs in all devices are different. + - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the `IChannel` object. + + @param token The token for authentication: + - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-temporary-token). + - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-token). + @param info (Optional) Additional information about the channel. This parameter can be set as null. Other users in the channel do not receive this information. + @param uid The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If `uid` is not assigned (or set as `0`), the SDK assigns a `uid` and reports it in the \ref agora::rtc::IChannelEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. The app must maintain this user ID. + @param options The channel media options: \ref agora::rtc::ChannelMediaOptions::ChannelMediaOptions "ChannelMediaOptions" + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannel(const char* token, + const char* info, + uid_t uid, + const ChannelMediaOptions& options) = 0; + /** Joins the channel with a user account. + + After the user successfully joins the channel, the SDK triggers the following callbacks: + + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" and \ref agora::rtc::IChannelEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" . + - The remote client: \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" and \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. + + @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. + If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + + @param token The token generated at your server: + - For low-security requirements: You can use the temporary token generated at Console. For details, see [Get a temporary toke](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-temporary-token). + - For high-security requirements: Set it as the token generated at your server. For details, see [Get a token](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-token). + @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + @param options The channel media options: \ref agora::rtc::ChannelMediaOptions::ChannelMediaOptions “ChannelMediaOptions”. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannelWithUserAccount(const char* token, + const char* userAccount, + const ChannelMediaOptions& options) = 0; + /** Allows a user to leave a channel, such as hanging up or exiting a call. + + After joining a channel, the user must call the *leaveChannel* method to end the call before joining another channel. + + This method returns 0 if the user leaves the channel and releases all resources related to the call. + + This method call is asynchronous, and the user has not left the channel when the method call returns. Once the user leaves the channel, the SDK triggers the \ref IChannelEventHandler::onLeaveChannel "onLeaveChannel" callback. + + A successful \ref agora::rtc::IChannel::leaveChannel "leaveChannel" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IChannelEventHandler::onLeaveChannel "onLeaveChannel" + - The remote client: \ref agora::rtc::IChannelEventHandler::onUserOffline "onUserOffline" , if the user leaving the channel is in the Communication channel, or is a BROADCASTER in the Live Broadcast profile. + + @note + - If you call the \ref IChannel::release "release" method immediately after the *leaveChannel* method, the *leaveChannel* process interrupts, and the \ref IChannelEventHandler::onLeaveChannel "onLeaveChannel" callback is not triggered. + - If you call the *leaveChannel* method during a CDN live streaming, the SDK triggers the \ref IChannel::removePublishStreamUrl "removePublishStreamUrl" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int leaveChannel() = 0; + + /** Publishes the local stream to the channel. + + You must keep the following restrictions in mind when calling this method. Otherwise, the SDK returns the #ERR_REFUSED (5): + - This method publishes one stream only to the channel corresponding to the current `IChannel` object. + - In a Live Broadcast channel, only a broadcaster can call this method. To switch the client role, call \ref agora::rtc::IChannel::setClientRole "setClientRole" of the current `IChannel` object. + - You can publish a stream to only one channel at a time. For details on joining multiple channels, see the advanced guide *Join Multiple Channels*. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_REFUSED (5): The method call is refused. + */ + virtual int publish() = 0; + + /** Stops publishing a stream to the channel. + + If you call this method in a channel where you are not publishing streams, the SDK returns #ERR_REFUSED (5). + + @return + - 0: Success. + - < 0: Failure. + - #ERR_REFUSED (5): The method call is refused. + */ + virtual int unpublish() = 0; + + /** Gets the channel ID of the current `IChannel` object. + + @return + - The channel ID of the current `IChannel` object, if the method call succeeds. + - The empty string "", if the method call fails. + */ + virtual const char *channelId() = 0; + /** Retrieves the current call ID. + + When a user joins a channel on a client, a `callId` is generated to identify the call from the client. + Feedback methods, such as \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain", must be called after the call ends to submit feedback to the SDK. + + The `rate` and `complain` methods require the `callId` parameter retrieved from the `getCallId` method during a call. `callId` is passed as an argument into the `rate` and `complain` methods after the call ends. + + @param callId The current call ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getCallId(agora::util::AString& callId) = 0; + /** Gets a new token when the current token expires after a period of time. + + The `token` expires after a period of time once the token schema is enabled when: + + - The SDK triggers the \ref IChannelEventHandler::onTokenPrivilegeWillExpire "onTokenPrivilegeWillExpire" callback, or + - The \ref IChannelEventHandler::onConnectionStateChanged "onConnectionStateChanged" reports CONNECTION_CHANGED_TOKEN_EXPIRED(9). + + The application should call this method to get the new `token`. Failure to do so will result in the SDK disconnecting from the server. + + @param token Pointer to the new token. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int renewToken(const char* token) = 0; + /** Enables built-in encryption with an encryption password before users join a channel. + + All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel. + + If an encryption password is not specified, the encryption functionality will be disabled. + + @note + - Do not use this method for CDN live streaming. + - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. + + @param secret Pointer to the encryption password. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionSecret(const char* secret) = 0; + /** Sets the built-in encryption mode. + + The Agora SDK supports built-in encryption, which is set to the `aes-128-xts` mode by default. Call this method to use other encryption modes. + + All users in the same channel must use the same encryption mode and password. + + Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. + + @note Call the \ref IChannel::setEncryptionSecret "setEncryptionSecret" method to enable the built-in encryption function before calling this method. + + @param encryptionMode The set encryption mode: + - "aes-128-xts": (Default) 128-bit AES encryption, XTS mode. + - "aes-128-ecb": 128-bit AES encryption, ECB mode. + - "aes-256-xts": 256-bit AES encryption, XTS mode. + - "": When encryptionMode is set as NULL, the encryption mode is set as "aes-128-xts" by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionMode(const char* encryptionMode) = 0; + /** Registers a packet observer. + + The Agora SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission. + + @note + - The size of the packet sent to the network after processing should not exceed 1200 bytes, otherwise, the packet may fail to be sent. + - Ensure that both receivers and senders call this method, otherwise, you may meet undefined behaviors such as no voice and black screen. + - When you use CDN live streaming, recording or storage functions, Agora doesn't recommend calling this method. + + @param observer The registered packet observer. See IPacketObserver. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerPacketObserver(IPacketObserver* observer) = 0; + /** Registers the metadata observer. + + Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the \ref agora::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback. + This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. + + @note + - Call this method before the joinChannel method. + - This method applies to the Live-broadcast channel profile. + + @param observer The IMetadataObserver class. See the definition of IMetadataObserver for details. + @param type See \ref IMetadataObserver::METADATA_TYPE "METADATA_TYPE". The SDK supports VIDEO_METADATA (0) only for now. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerMediaMetadataObserver(IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type) = 0; + /** Sets the role of the user, such as a host or an audience (default), before joining a channel in a live broadcast. + + This method can be used to switch the user role in a live broadcast after the user joins a channel. + + In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful \ref agora::rtc::IChannel::setClientRole "setClientRole" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IChannelEventHandler::onClientRoleChanged "onClientRoleChanged" + - The remote client: \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" or \ref agora::rtc::IChannelEventHandler::onUserOffline "onUserOffline" (BECOME_AUDIENCE) + + @note + This method applies only to the Live-broadcast profile. + + @param role Sets the role of the user. See #CLIENT_ROLE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setClientRole(CLIENT_ROLE_TYPE role) = 0; + /** Prioritizes a remote user's stream. + + Use this method with the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. + If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. + + @note The Agora SDK supports setting `serPriority` as high for one user only. + + @param uid The ID of the remote user. + @param userPriority Sets the priority of the remote user. See #PRIORITY_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteUserPriority(uid_t uid, PRIORITY_TYPE userPriority) = 0; + /** Sets the sound position and gain of a remote user. + + When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the + local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, + such as Battle Royale games. + + @note + - For this method to work, enable stereo panning for remote users by calling the \ref agora::rtc::IRtcEngine::enableSoundPositionIndication "enableSoundPositionIndication" method before joining a channel. + - This method requires hardware support. For the best sound positioning, we recommend using a stereo speaker. + + @param uid The ID of the remote user. + @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: + - 0.0: the remote sound comes from the front. + - -1.0: the remote sound comes from the left. + - 1.0: the remote sound comes from the right. + @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). + The smaller the value, the less the gain. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVoicePosition(uid_t uid, double pan, double gain) = 0; + /** Updates the display mode of the video view of a remote user. + + After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. + This method affects only the video view that the local user sees. + + @note + - Call this method after calling the \ref agora::rtc::IRtcEngine::setupRemoteVideo "setupRemoteVideo" method to initialize the remote video view. + - During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user. + + @param userId The ID of the remote user. + @param renderMode The rendering mode of the remote video view. See #RENDER_MODE_TYPE. + @param mirrorMode + - The mirror mode of the remote video view. See #VIDEO_MIRROR_MODE_TYPE. + - **Note**: The SDK disables the mirror mode by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** Sets whether to receive all remote audio streams by default. + + You can call this method either before or after joining a channel. If you call `setDefaultMuteAllRemoteAudioStreams (true)` after joining a channel, the remote audio streams of all subsequent users are not received. + + @note If you want to resume receiving the audio stream, call \ref agora::rtc::IChannel::muteRemoteAudioStream "muteRemoteAudioStream (false)", + and specify the ID of the remote user whose audio stream you want to receive. + To receive the audio streams of multiple remote users, call `muteRemoteAudioStream (false)` as many times. + Calling `setDefaultMuteAllRemoteAudioStreams (false)` resumes receiving the audio streams of subsequent users only. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams by default: + - true: Stops receiving all remote users' audio streams by default. + - false: (Default) Receives all remote users' audio streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteAudioStreams(bool mute) = 0; + /** Sets whether to receive all remote video streams by default. + + You can call this method either before or after joining a channel. If you + call `setDefaultMuteAllRemoteVideoStreams (true)` after joining a channel, + the remote video streams of all subsequent users are not received. + + @note If you want to resume receiving the video stream, call + \ref agora::rtc::IChannel::muteRemoteVideoStream "muteRemoteVideoStream (false)", + and specify the ID of the remote user whose video stream you want to receive. + To receive the video streams of multiple remote users, call `muteRemoteVideoStream (false)` + as many times. Calling `setDefaultMuteAllRemoteVideoStreams (false)` resumes + receiving the video streams of subsequent users only. + + @param mute Sets whether to receive/stop receiving all remote users' video streams by default: + - true: Stop receiving all remote users' video streams by default. + - false: (Default) Receive all remote users' video streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' audio streams. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams. + - true: Stops receiving all remote users' audio streams. + - false: (Default) Receives all remote users' audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteAudioStreams(bool mute) = 0; + /** Adjust the playback volume of the specified remote user. + + After joining a channel, call \ref agora::rtc::IRtcEngine::adjustPlaybackSignalVolume "adjustPlaybackSignalVolume" to adjust the playback volume of different remote users, + or adjust multiple times for one remote user. + + @note + - Call this method after joining a channel. + - This method adjusts the playback volume, which is the mixed volume for the specified remote user. + - This method can only adjust the playback volume of one specified remote user at a time. If you want to adjust the playback volume of several remote users, + call the method multiple times, once for each remote user. + + @param userId The user ID, which should be the same as the `uid` of \ref agora::rtc::IChannel::joinChannel "joinChannel" + @param volume The playback volume of the voice. The value ranges from 0 to 100: + - 0: Mute. + - 100: Original volume. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustUserPlaybackSignalVolume(uid_t userId, int volume) = 0; + /** Stops/Resumes receiving a specified remote user's audio stream. + + @note If you called the \ref agora::rtc::IChannel::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method and set `mute` as `true` to stop + receiving all remote users' audio streams, call the `muteAllRemoteAudioStreams` method and set `mute` as `false` before calling this method. + The `muteAllRemoteAudioStreams` method sets all remote audio streams, while the `muteRemoteAudioStream` method sets a specified remote audio stream. + + @param userId The user ID of the specified remote user sending the audio. + @param mute Sets whether to receive/stop receiving a specified remote user's audio stream: + - true: Stops receiving the specified remote user's audio stream. + - false: (Default) Receives the specified remote user's audio stream. + + @return + - 0: Success. + - < 0: Failure. + + */ + virtual int muteRemoteAudioStream(uid_t userId, bool mute) = 0; + /** Stops/Resumes receiving all video stream from a specified remote user. + + @param mute Sets whether to receive/stop receiving all remote users' video streams: + - true: Stop receiving all remote users' video streams. + - false: (Default) Receive all remote users' video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving the video stream from a specified remote user. + + @note If you called the \ref agora::rtc::IChannel::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method and + set `mute` as `true` to stop receiving all remote video streams, call the `muteAllRemoteVideoStreams` method and + set `mute` as `false` before calling this method. + + @param userId The user ID of the specified remote user. + @param mute Sets whether to stop/resume receiving the video stream from a specified remote user: + - true: Stop receiving the specified remote user's video stream. + - false: (Default) Receive the specified remote user's video stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteRemoteVideoStream(uid_t userId, bool mute) = 0; + /** Sets the stream type of the remote video. + + Under limited network conditions, if the publisher has not disabled the dual-stream mode using + \ref agora::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" (false), + the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or + the low-video stream (the low resolution, and low bitrate video stream). + + By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. + This method allows the app to adjust the corresponding video stream type based on the size of the video window to + reduce the bandwidth and resources. + + The aspect ratio of the low-video stream is the same as the high-quality video stream. Once the resolution of the high-quality video + stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + + The method result returns in the \ref agora::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. + + @param userId The ID of the remote user sending the video stream. + @param streamType Sets the video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVideoStreamType(uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + /** Sets the default stream type of remote videos. + + Under limited network conditions, if the publisher has not disabled the dual-stream mode using + \ref agora::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" (false), + the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or + the low-video stream (the low resolution, and low bitrate video stream). + + By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. + This method allows the app to adjust the corresponding video stream type based on the size of the video window to + reduce the bandwidth and resources. The aspect ratio of the low-video stream is the same as the high-quality video stream. + Once the resolution of the high-quality video + stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + + The method result returns in the \ref agora::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. + + @param streamType Sets the default video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + /** Creates a data stream. + + Each user can create up to five data streams during the lifecycle of the IChannel. + + @note Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. + + @param streamId The ID of the created data stream. + @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds: + - true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, + an error is reported to the application. + - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for + any delay or missing data stream. + @param ordered Sets whether or not the recipients receive the data stream in the sent order: + - true: The recipients receive the data stream in the sent order. + - false: The recipients do not receive the data stream in the sent order. + + @return + - Returns 0: Success. + - < 0: Failure. + */ + virtual int createDataStream(int* streamId, bool reliable, bool ordered) = 0; + /** Sends data stream messages to all users in a channel. + + The SDK has the following restrictions on this method: + - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB. + - Each client can send up to 6 kB of data per second. + - Each user can have up to five data streams simultaneously. + + A successful \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method call triggers + the \ref agora::rtc::IChannelEventHandler::onStreamMessage "onStreamMessage" callback on the remote client, from which the remote user gets the stream message. + + A failed \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method call triggers + the \ref agora::rtc::IChannelEventHandler::onStreamMessageError "onStreamMessage" callback on the remote client. + + @note + - This method applies only to the Communication profile or to the hosts in the Live-broadcast profile. If an audience in the Live-broadcast profile calls this method, the audience may be switched to a host. + - Ensure that you have created the data stream using \ref agora::rtc::IChannel::createDataStream "createDataStream" before calling this method. + + @param streamId The ID of the sent data stream, returned in the \ref IChannel::createDataStream "createDataStream" method. + @param data The sent data. + @param length The length of the sent data. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0; + /** Publishes the local stream to a specified CDN live RTMP address. (CDN live only.) + + The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback. + + The \ref agora::rtc::IChannel::addPublishStreamUrl "addPublishStreamUrl" method call triggers + the \ref agora::rtc::IChannelEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client + to report the state of adding a local stream to the CDN. + + @note + - Ensure that the user joins the channel before calling this method. + - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in the advanced guide *Push Streams to CDN*. + - This method adds only one stream RTMP URL address each time it is called. + + @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. + @param transcodingEnabled Sets whether transcoding is enabled/disabled: + - true: Enable transcoding. To [transcode](https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#transcoding) the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. If you set this parameter as `true`, ensure that you call the \ref IChannel::setLiveTranscoding "setLiveTranscoding" method before this method. + - false: Disable transcoding. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0. + - #ERR_NOT_INITIALIZED (7): You have not initialized `IChannel` when publishing the stream. + */ + virtual int addPublishStreamUrl(const char *url, bool transcodingEnabled) = 0; + /** Removes an RTMP stream from the CDN. + + This method removes the RTMP URL address (added by the \ref IChannel::addPublishStreamUrl "addPublishStreamUrl" method) from a CDN live stream. + + The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamUnpublished "onStreamUnpublished" callback. + + The \ref agora::rtc::IChannel::removePublishStreamUrl "removePublishStreamUrl" method call triggers + the \ref agora::rtc::IChannelEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of removing an RTMP stream from the CDN. + + @note + - This method removes only one RTMP URL address each time it is called. + - The RTMP URL address must not contain special characters, such as Chinese language characters. + + @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removePublishStreamUrl(const char *url) = 0; + /** Sets the video layout and audio settings for CDN live. (CDN live only.) + + The SDK triggers the \ref agora::rtc::IChannelEventHandler::onTranscodingUpdated "onTranscodingUpdated" callback when you + call the `setLiveTranscoding` method to update the transcoding setting. + + @note + - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in the advanced guide *Push Streams to CDN*.. + - If you call the `setLiveTranscoding` method to set the transcoding setting for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + + @param transcoding Sets the CDN live audio/video transcoding settings. See LiveTranscoding. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLiveTranscoding(const LiveTranscoding &transcoding) = 0; + /** Adds a voice or video stream URL address to a live broadcast. + + The \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback returns the inject status. + If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. + This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. + + The \ref agora::rtc::IChannel::addInjectStreamUrl "addInjectStreamUrl" method call triggers the following callbacks: + - The local client: + - \ref agora::rtc::IChannelEventHandler::onStreamInjectedStatus "onStreamInjectedStatus" , with the state of the injecting the online stream. + - \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + - The remote client: + - \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + + @note + - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in the advanced guide *Push Streams to CDN*. + - This method applies to the Native SDK v2.4.1 and later. + - This method applies to the Live-Broadcast profile only. + - You can inject only one media stream into the channel at the same time. + + @param url The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and HTTP-FLV. + - Supported audio codec type: AAC. + - Supported video codec type: H264 (AVC). + @param config The InjectStreamConfig object that contains the configuration of the added voice or video stream. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid. + - #ERR_NOT_READY (3): The user is not in the channel. + - #ERR_NOT_SUPPORTED (4): The channel profile is not live broadcast. Call the \ref IRtcEngine::setChannelProfile "setChannelProfile" method and set the channel profile to live broadcast before calling this method. + - #ERR_NOT_INITIALIZED (7): The SDK is not initialized. Ensure that the IChannel object is initialized before calling this method. + */ + virtual int addInjectStreamUrl(const char* url, const InjectStreamConfig& config) = 0; + /** Removes the voice or video stream URL address from a live broadcast. + + This method removes the URL address (added by the \ref IChannel::addInjectStreamUrl "addInjectStreamUrl" method) from the live broadcast. + + @note If this method is called successfully, the SDK triggers the \ref IChannelEventHandler::onUserOffline "onUserOffline" callback and returns a stream uid of 666. + + @param url Pointer to the URL address of the added stream to be removed. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removeInjectStreamUrl(const char* url) = 0; + /** Starts to relay media streams across channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" and + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callbacks, and these callbacks return the + * state and events of the media stream relay. + * - If the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback returns + * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the broadcaster starts + * sending data to the destination channel. + * - If the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream + * relay. + * + * @note + * - Call this method after the \ref joinChannel() "joinChannel" method. + * - This method takes effect only when you are a broadcaster in a + * Live-broadcast channel. + * - After a successful method call, if you want to call this method + * again, ensure that you call the + * \ref stopChannelMediaRelay() "stopChannelMediaRelay" method to quit the + * current relay. + * - Contact sales-us@agora.io before implementing this function. + * - We do not support string user accounts in this API. + * + * @param configuration The configuration of the media stream relay: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int startChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Updates the channels for media stream relay. + * + * After a successful + * \ref startChannelMediaRelay() "startChannelMediaRelay" method call, if + * you want to relay the media stream to more channels, or leave the + * current relay channel, you can call the + * \ref updateChannelMediaRelay() "updateChannelMediaRelay" method. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback with the + * #RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code. + * + * @note + * Call this method after the + * \ref startChannelMediaRelay() "startChannelMediaRelay" method to update + * the destination channel. + * + * @param configuration The media stream relay configuration: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int updateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Stops the media stream relay. + * + * Once the relay stops, the broadcaster quits all the destination + * channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback. If the callback returns + * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the broadcaster successfully + * stops the relay. + * + * @note + * If the method call fails, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback with the + * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or + * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the + * channel by calling the \ref leaveChannel() "leaveChannel" method, and + * the media stream relay automatically stops. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int stopChannelMediaRelay() = 0; + /** Gets the current connection state of the SDK. + + @return #CONNECTION_STATE_TYPE. + */ + virtual CONNECTION_STATE_TYPE getConnectionState() = 0; +}; +/** @since v3.0.0 + + The IRtcEngine2 class. */ +class IRtcEngine2 : public IRtcEngine +{ +public: + + /** Creates and gets an `IChannel` object. + + To join more than one channel, call this method multiple times to create as many `IChannel` objects as needed, and + call the \ref agora::rtc::IChannel::joinChannel "joinChannel" method of each created `IChannel` object. + + After joining multiple channels, you can simultaneously subscribe to streams of all the channels, but publish a stream in only one channel at one time. + @param channelId The unique channel name for an Agora RTC session. It must be in the string format and not exceed 64 bytes in length. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @note + - This parameter does not have a default value. You must set it. + - Do not set it as the empty string "". Otherwise, the SDK returns #ERR_REFUSED (5). + + @return + - The `IChannel` object, if the method call succeeds. + - An empty pointer NULL, if the method call fails. + - `ERR_REFUSED(5)`, if you set channelId as the empty string "". + */ + virtual IChannel* createChannel(const char *channelId) = 0; + +}; + + +} +} + + +#endif diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcEngine.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcEngine.h new file mode 100644 index 000000000..2118ce62b --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraRtcEngine.h @@ -0,0 +1,7694 @@ +// +// AgoraRtcEngine SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +/** + @defgroup createAgoraRtcEngine Create an AgoraRtcEngine + */ + +#ifndef AGORA_RTC_ENGINE_H +#define AGORA_RTC_ENGINE_H +#include "AgoraBase.h" +#include "IAgoraService.h" + +namespace agora { +namespace rtc { + typedef unsigned int uid_t; + typedef void* view_t; +/** Maximum length of the device ID. +*/ +enum MAX_DEVICE_ID_LENGTH_TYPE +{ + /** The maximum length of the device ID is 512 bytes. + */ + MAX_DEVICE_ID_LENGTH = 512 +}; +/** Maximum length of user account. + */ +enum MAX_USER_ACCOUNT_LENGTH_TYPE +{ + /** The maximum length of user account is 255 bytes. + */ + MAX_USER_ACCOUNT_LENGTH = 256 +}; +/** Maximum length of channel ID. + */ +enum MAX_CHANNEL_ID_LENGTH_TYPE +{ + /** The maximum length of channel id is 64 bytes. + */ + MAX_CHANNEL_ID_LENGTH = 65 +}; +/** Formats of the quality report. +*/ +enum QUALITY_REPORT_FORMAT_TYPE +{ + /** 0: The quality report in JSON format, + */ + QUALITY_REPORT_JSON = 0, + /** 1: The quality report in HTML format. + */ + QUALITY_REPORT_HTML = 1, +}; + +enum MEDIA_ENGINE_EVENT_CODE_TYPE +{ + /** 0: For internal use only. + */ + MEDIA_ENGINE_RECORDING_ERROR = 0, + /** 1: For internal use only. + */ + MEDIA_ENGINE_PLAYOUT_ERROR = 1, + /** 2: For internal use only. + */ + MEDIA_ENGINE_RECORDING_WARNING = 2, + /** 3: For internal use only. + */ + MEDIA_ENGINE_PLAYOUT_WARNING = 3, + /** 10: For internal use only. + */ + MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH = 10, + /** 12: For internal use only. + */ + MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS = 12, + /** 13: For internal use only. + */ + MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS = 13, + /** 14: For internal use only. + */ + MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED = 14, + /** 15: For internal use only. + */ + MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED = 15, + // media engine role changed + /** 20: For internal use only. + */ + MEDIA_ENGINE_ROLE_BROADCASTER_SOLO = 20, + /** 21: For internal use only. + */ + MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE = 21, + /** 22: For internal use only. + */ + MEDIA_ENGINE_ROLE_AUDIENCE = 22, + /** 23: For internal use only. + */ + MEDIA_ENGINE_ROLE_COMM_PEER = 23, + /** 24: For internal use only. + */ + MEDIA_ENGINE_ROLE_GAME_PEER = 24, + // iOS adm sample rate changed + /** 110: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART = 110, + /** 111: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART = 111, + /** 112: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS = 112, + /** 113: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS = 113, + // audio mix state + /** 710: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY = 710, + /** 711: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED = 711, + /** 712: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART = 712, + /** 713: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED = 713, + /** 714: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR = 714, + //Mixing error codes + /** 701: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN = 701, + /** 702: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT = 702, + /** 703: The audio mixing file playback is interrupted. For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF = 703, + /** 0: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR = 0, +}; + +/** The states of the local user's audio mixing file. +*/ +enum AUDIO_MIXING_STATE_TYPE{ + /** 710: The audio mixing file is playing. + */ + AUDIO_MIXING_STATE_PLAYING = 710, + /** 711: The audio mixing file pauses playing. + */ + AUDIO_MIXING_STATE_PAUSED = 711, + /** 713: The audio mixing file stops playing. + */ + AUDIO_MIXING_STATE_STOPPED = 713, + /** 714: An exception occurs when playing the audio mixing file. See #AUDIO_MIXING_ERROR_TYPE. + */ + AUDIO_MIXING_STATE_FAILED = 714, +}; + +/** The error codes of the local user's audio mixing file. +*/ +enum AUDIO_MIXING_ERROR_TYPE{ + /** 701: The SDK cannot open the audio mixing file. + */ + AUDIO_MIXING_ERROR_CAN_NOT_OPEN = 701, + /** 702: The SDK opens the audio mixing file too frequently. + */ + AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL = 702, + /** 703: The audio mixing file playback is interrupted. + */ + AUDIO_MIXING_ERROR_INTERRUPTED_EOF = 703, + /** 0: The SDK can open the audio mixing file. + */ + AUDIO_MIXING_ERROR_OK = 0, +}; + +/** Media device states. + */ +enum MEDIA_DEVICE_STATE_TYPE +{ + /** 1: The device is active. + */ + MEDIA_DEVICE_STATE_ACTIVE = 1, + /** 2: The device is disabled. + */ + MEDIA_DEVICE_STATE_DISABLED = 2, + /** 4: The device is not present. + */ + MEDIA_DEVICE_STATE_NOT_PRESENT = 4, + /** 8: The device is unplugged. + */ + MEDIA_DEVICE_STATE_UNPLUGGED = 8 +}; + +/** Media device types. + */ +enum MEDIA_DEVICE_TYPE +{ + /** -1: Unknown device type. + */ + UNKNOWN_AUDIO_DEVICE = -1, + /** 0: Audio playback device. + */ + AUDIO_PLAYOUT_DEVICE = 0, + /** 1: Audio recording device. + */ + AUDIO_RECORDING_DEVICE = 1, + /** 2: Video renderer. + */ + VIDEO_RENDER_DEVICE = 2, + /** 3: Video capturer. + */ + VIDEO_CAPTURE_DEVICE = 3, + /** 4: Application audio playback device. + */ + AUDIO_APPLICATION_PLAYOUT_DEVICE = 4, +}; + +/** Local video state types + */ +enum LOCAL_VIDEO_STREAM_STATE +{ + /** Initial state */ + LOCAL_VIDEO_STREAM_STATE_STOPPED = 0, + /** The capturer starts successfully. */ + LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1, + /** The first video frame is successfully encoded. */ + LOCAL_VIDEO_STREAM_STATE_ENCODING = 2, + /** The local video fails to start. */ + LOCAL_VIDEO_STREAM_STATE_FAILED = 3 +}; + +/** Local video state error codes + */ +enum LOCAL_VIDEO_STREAM_ERROR { + /** The local video is normal. */ + LOCAL_VIDEO_STREAM_ERROR_OK = 0, + /** No specified reason for the local video failure. */ + LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1, + /** No permission to use the local video capturing device. */ + LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, + /** The local video capturing device is in use. */ + LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3, + /** The local video capture fails. Check whether the capturing device is working properly. */ + LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4, + /** The local video encoding fails. */ + LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5 +}; + +/** Local audio state types. + */ +enum LOCAL_AUDIO_STREAM_STATE +{ + /** 0: The local audio is in the initial state. + */ + LOCAL_AUDIO_STREAM_STATE_STOPPED = 0, + /** 1: The recording device starts successfully. + */ + LOCAL_AUDIO_STREAM_STATE_RECORDING = 1, + /** 2: The first audio frame encodes successfully. + */ + LOCAL_AUDIO_STREAM_STATE_ENCODING = 2, + /** 3: The local audio fails to start. + */ + LOCAL_AUDIO_STREAM_STATE_FAILED = 3 +}; + +/** Local audio state error codes. + */ +enum LOCAL_AUDIO_STREAM_ERROR +{ + /** 0: The local audio is normal. + */ + LOCAL_AUDIO_STREAM_ERROR_OK = 0, + /** 1: No specified reason for the local audio failure. + */ + LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1, + /** 2: No permission to use the local audio device. + */ + LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, + /** 3: The microphone is in use. + */ + LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3, + /** 4: The local audio recording fails. Check whether the recording device + * is working properly. + */ + LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4, + /** 5: The local audio encoding fails. + */ + LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5 +}; + +/** Audio recording qualities. +*/ +enum AUDIO_RECORDING_QUALITY_TYPE +{ + /** 0: Low quality. The sample rate is 32 kHz, and the file size is around + * 1.2 MB after 10 minutes of recording. + */ + AUDIO_RECORDING_QUALITY_LOW = 0, + /** 1: Medium quality. The sample rate is 32 kHz, and the file size is + * around 2 MB after 10 minutes of recording. + */ + AUDIO_RECORDING_QUALITY_MEDIUM = 1, + /** 2: High quality. The sample rate is 32 kHz, and the file size is + * around 3.75 MB after 10 minutes of recording. + */ + AUDIO_RECORDING_QUALITY_HIGH = 2, +}; + +/** Network quality types. */ +enum QUALITY_TYPE +{ + /** 0: The network quality is unknown. */ + QUALITY_UNKNOWN = 0, + /** 1: The network quality is excellent. */ + QUALITY_EXCELLENT = 1, + /** 2: The network quality is quite good, but the bitrate may be slightly lower than excellent. */ + QUALITY_GOOD = 2, + /** 3: Users can feel the communication slightly impaired. */ + QUALITY_POOR = 3, + /** 4: Users cannot communicate smoothly. */ + QUALITY_BAD = 4, + /** 5: The network is so bad that users can barely communicate. */ + QUALITY_VBAD = 5, + /** 6: The network is down and users cannot communicate at all. */ + QUALITY_DOWN = 6, + /** 7: Users cannot detect the network quality. (Not in use.) */ + QUALITY_UNSUPPORTED = 7, + /** 8: Detecting the network quality. */ + QUALITY_DETECTING = 8, +}; + +/** Video display modes. */ +enum RENDER_MODE_TYPE +{ + /** +1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. + */ + RENDER_MODE_HIDDEN = 1, + /** +2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black. + */ + RENDER_MODE_FIT = 2, + /** **DEPRECATED** 3: This mode is deprecated. + */ + RENDER_MODE_ADAPTIVE = 3, + /** + 4: The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window. + */ + RENDER_MODE_FILL = 4, +}; + +/** Video mirror modes. */ +enum VIDEO_MIRROR_MODE_TYPE +{ + /** 0: (Default) The SDK enables the mirror mode. + */ + VIDEO_MIRROR_MODE_AUTO = 0,//determined by SDK + /** 1: Enable mirror mode. */ + VIDEO_MIRROR_MODE_ENABLED = 1,//enabled mirror + /** 2: Disable mirror mode. */ + VIDEO_MIRROR_MODE_DISABLED = 2,//disable mirror +}; + +/** **DEPRECATED** Video profiles. */ +enum VIDEO_PROFILE_TYPE +{ + /** 0: 160 * 120, frame rate 15 fps, bitrate 65 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_120P = 0, + /** 2: 120 * 120, frame rate 15 fps, bitrate 50 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_120P_3 = 2, + /** 10: 320*180, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_180P = 10, + /** 12: 180 * 180, frame rate 15 fps, bitrate 100 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_180P_3 = 12, + /** 13: 240 * 180, frame rate 15 fps, bitrate 120 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_180P_4 = 13, + /** 20: 320 * 240, frame rate 15 fps, bitrate 200 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_240P = 20, + /** 22: 240 * 240, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_240P_3 = 22, + /** 23: 424 * 240, frame rate 15 fps, bitrate 220 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_240P_4 = 23, + /** 30: 640 * 360, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P = 30, + /** 32: 360 * 360, frame rate 15 fps, bitrate 260 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_3 = 32, + /** 33: 640 * 360, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_4 = 33, + /** 35: 360 * 360, frame rate 30 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_6 = 35, + /** 36: 480 * 360, frame rate 15 fps, bitrate 320 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_7 = 36, + /** 37: 480 * 360, frame rate 30 fps, bitrate 490 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_8 = 37, + /** 38: 640 * 360, frame rate 15 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_LANDSCAPE_360P_9 = 38, + /** 39: 640 * 360, frame rate 24 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_LANDSCAPE_360P_10 = 39, + /** 100: 640 * 360, frame rate 24 fps, bitrate 1000 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_LANDSCAPE_360P_11 = 100, + /** 40: 640 * 480, frame rate 15 fps, bitrate 500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P = 40, + /** 42: 480 * 480, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_3 = 42, + /** 43: 640 * 480, frame rate 30 fps, bitrate 750 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_4 = 43, + /** 45: 480 * 480, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_6 = 45, + /** 47: 848 * 480, frame rate 15 fps, bitrate 610 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_8 = 47, + /** 48: 848 * 480, frame rate 30 fps, bitrate 930 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_9 = 48, + /** 49: 640 * 480, frame rate 10 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_10 = 49, + /** 50: 1280 * 720, frame rate 15 fps, bitrate 1130 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P = 50, + /** 52: 1280 * 720, frame rate 30 fps, bitrate 1710 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P_3 = 52, + /** 54: 960 * 720, frame rate 15 fps, bitrate 910 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P_5 = 54, + /** 55: 960 * 720, frame rate 30 fps, bitrate 1380 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P_6 = 55, + /** 60: 1920 * 1080, frame rate 15 fps, bitrate 2080 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1080P = 60, + /** 62: 1920 * 1080, frame rate 30 fps, bitrate 3150 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62, + /** 64: 1920 * 1080, frame rate 60 fps, bitrate 4780 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64, + /** 66: 2560 * 1440, frame rate 30 fps, bitrate 4850 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1440P = 66, + /** 67: 2560 * 1440, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67, + /** 70: 3840 * 2160, frame rate 30 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_4K = 70, + /** 72: 3840 * 2160, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_4K_3 = 72, + /** 1000: 120 * 160, frame rate 15 fps, bitrate 65 Kbps. */ + VIDEO_PROFILE_PORTRAIT_120P = 1000, + /** 1002: 120 * 120, frame rate 15 fps, bitrate 50 Kbps. */ + VIDEO_PROFILE_PORTRAIT_120P_3 = 1002, + /** 1010: 180 * 320, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_PORTRAIT_180P = 1010, + /** 1012: 180 * 180, frame rate 15 fps, bitrate 100 Kbps. */ + VIDEO_PROFILE_PORTRAIT_180P_3 = 1012, + /** 1013: 180 * 240, frame rate 15 fps, bitrate 120 Kbps. */ + VIDEO_PROFILE_PORTRAIT_180P_4 = 1013, + /** 1020: 240 * 320, frame rate 15 fps, bitrate 200 Kbps. */ + VIDEO_PROFILE_PORTRAIT_240P = 1020, + /** 1022: 240 * 240, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_PORTRAIT_240P_3 = 1022, + /** 1023: 240 * 424, frame rate 15 fps, bitrate 220 Kbps. */ + VIDEO_PROFILE_PORTRAIT_240P_4 = 1023, + /** 1030: 360 * 640, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P = 1030, + /** 1032: 360 * 360, frame rate 15 fps, bitrate 260 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_3 = 1032, + /** 1033: 360 * 640, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_4 = 1033, + /** 1035: 360 * 360, frame rate 30 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_6 = 1035, + /** 1036: 360 * 480, frame rate 15 fps, bitrate 320 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_7 = 1036, + /** 1037: 360 * 480, frame rate 30 fps, bitrate 490 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_8 = 1037, + /** 1038: 360 * 640, frame rate 15 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_PORTRAIT_360P_9 = 1038, + /** 1039: 360 * 640, frame rate 24 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_PORTRAIT_360P_10 = 1039, + /** 1100: 360 * 640, frame rate 24 fps, bitrate 1000 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_PORTRAIT_360P_11 = 1100, + /** 1040: 480 * 640, frame rate 15 fps, bitrate 500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P = 1040, + /** 1042: 480 * 480, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_3 = 1042, + /** 1043: 480 * 640, frame rate 30 fps, bitrate 750 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_4 = 1043, + /** 1045: 480 * 480, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_6 = 1045, + /** 1047: 480 * 848, frame rate 15 fps, bitrate 610 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_8 = 1047, + /** 1048: 480 * 848, frame rate 30 fps, bitrate 930 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_9 = 1048, + /** 1049: 480 * 640, frame rate 10 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_10 = 1049, + /** 1050: 720 * 1280, frame rate 15 fps, bitrate 1130 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P = 1050, + /** 1052: 720 * 1280, frame rate 30 fps, bitrate 1710 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P_3 = 1052, + /** 1054: 720 * 960, frame rate 15 fps, bitrate 910 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P_5 = 1054, + /** 1055: 720 * 960, frame rate 30 fps, bitrate 1380 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P_6 = 1055, + /** 1060: 1080 * 1920, frame rate 15 fps, bitrate 2080 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1080P = 1060, + /** 1062: 1080 * 1920, frame rate 30 fps, bitrate 3150 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062, + /** 1064: 1080 * 1920, frame rate 60 fps, bitrate 4780 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064, + /** 1066: 1440 * 2560, frame rate 30 fps, bitrate 4850 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1440P = 1066, + /** 1067: 1440 * 2560, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067, + /** 1070: 2160 * 3840, frame rate 30 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_4K = 1070, + /** 1072: 2160 * 3840, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_4K_3 = 1072, + /** Default 640 * 360, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_DEFAULT = VIDEO_PROFILE_LANDSCAPE_360P, +}; + +/** Audio profiles. + +Sets the sample rate, bitrate, encoding mode, and the number of channels:*/ +enum AUDIO_PROFILE_TYPE // sample rate, bit rate, mono/stereo, speech/music codec +{ + /** + 0: Default audio profile: + - For the live-broadcast profile: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 52 Kbps. + - For the communication profile: A sample rate of 16 KHz, music encoding, mono, and a bitrate of up to 16 Kbps. + */ + AUDIO_PROFILE_DEFAULT = 0, // use default settings + /** + 1: A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps. + */ + AUDIO_PROFILE_SPEECH_STANDARD = 1, // 32Khz, 18Kbps, mono, speech + /** + 2: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 48 Kbps. + */ + AUDIO_PROFILE_MUSIC_STANDARD = 2, // 48Khz, 48Kbps, mono, music + /** + 3: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 56 Kbps. + */ + AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, // 48Khz, 56Kbps, stereo, music + /** + 4: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 128 Kbps. + */ + AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, // 48Khz, 128Kbps, mono, music + /** + 5: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 192 Kbps. + */ + AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, // 48Khz, 192Kbps, stereo, music + /** + 6: A sample rate of 16 KHz, audio encoding, mono, and Acoustic Echo Cancellation (AES) enabled. + */ + AUDIO_PROFILE_IOT = 6, + AUDIO_PROFILE_NUM = 7, +}; + +/** Audio application scenarios. +*/ +enum AUDIO_SCENARIO_TYPE // set a suitable scenario for your app type +{ + /** 0: Default. */ + AUDIO_SCENARIO_DEFAULT = 0, + /** 1: Entertainment scenario, supporting voice during gameplay. */ + AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT = 1, + /** 2: Education scenario, prioritizing smoothness and stability. */ + AUDIO_SCENARIO_EDUCATION = 2, + /** 3: Live gaming scenario, enabling the gaming audio effects in the speaker mode in a live broadcast scenario. Choose this scenario for high-fidelity music playback. */ + AUDIO_SCENARIO_GAME_STREAMING = 3, + /** 4: Showroom scenario, optimizing the audio quality with external professional equipment. */ + AUDIO_SCENARIO_SHOWROOM = 4, + /** 5: Gaming scenario. */ + AUDIO_SCENARIO_CHATROOM_GAMING = 5, + /** 6: Applicable to the IoT scenario. */ + AUDIO_SCENARIO_IOT = 6, + AUDIO_SCENARIO_NUM = 7, +}; + + /** The channel profile of the IRtcEngine. + */ +enum CHANNEL_PROFILE_TYPE +{ + /** (Default) The Communication profile. Use this profile in one-on-one calls or group calls, where all users can talk freely. + */ + CHANNEL_PROFILE_COMMUNICATION = 0, + /** The Live-Broadcast profile. Users in a live-broadcast channel have a role as either broadcaster or audience. + A broadcaster can both send and receive streams; an audience can only receive streams. + */ + CHANNEL_PROFILE_LIVE_BROADCASTING = 1, + /** 2: The Gaming profile. This profile uses a codec with a lower bitrate and consumes less power. Applies to the gaming scenario, where all game players can talk freely. + */ + CHANNEL_PROFILE_GAME = 2, +}; + +/** Client roles in a live broadcast. */ +enum CLIENT_ROLE_TYPE +{ + /** 1: Broadcaster. A broadcaster can both send and receive streams. */ + CLIENT_ROLE_BROADCASTER = 1, + /** 2: Audience, the default role. An audience can only receive streams. */ + CLIENT_ROLE_AUDIENCE = 2, +}; + +/** Reasons for a user being offline. */ +enum USER_OFFLINE_REASON_TYPE +{ + /** 0: The user quits the call. */ + USER_OFFLINE_QUIT = 0, + /** 1: The SDK times out and the user drops offline because no data packet is received within a certain period of time. If the user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. */ + USER_OFFLINE_DROPPED = 1, + /** 2: (Live broadcast only.) The client role switched from the host to the audience. */ + USER_OFFLINE_BECOME_AUDIENCE = 2, +}; +/** + States of the RTMP streaming. + */ +enum RTMP_STREAM_PUBLISH_STATE +{ + /** The RTMP streaming has not started or has ended. This state is also triggered after you remove an RTMP address from the CDN by calling removePublishStreamUrl. + */ + RTMP_STREAM_PUBLISH_STATE_IDLE = 0, + /** The SDK is connecting to Agora's streaming server and the RTMP server. This state is triggered after you call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. + */ + RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1, + /** The RTMP streaming publishes. The SDK successfully publishes the RTMP streaming and returns this state. + */ + RTMP_STREAM_PUBLISH_STATE_RUNNING = 2, + /** The RTMP streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP streaming and returns this state. + + - If the SDK successfully resumes the streaming, #RTMP_STREAM_PUBLISH_STATE_RUNNING (2) returns. + - If the streaming does not resume within 60 seconds or server errors occur, #RTMP_STREAM_PUBLISH_STATE_FAILURE (4) returns. You can also reconnect to the server by calling the \ref IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods. + */ + RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3, + /** The RTMP streaming fails. See the errCode parameter for the detailed error information. You can also call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the RTMP streaming again. + */ + RTMP_STREAM_PUBLISH_STATE_FAILURE = 4, +}; + +/** + Error codes of the RTMP streaming. + */ +enum RTMP_STREAM_PUBLISH_ERROR +{ + /** The RTMP streaming publishes successfully. */ + RTMP_STREAM_PUBLISH_ERROR_OK = 0, + /** Invalid argument used. If, for example, you do not call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method to configure the LiveTranscoding parameters before calling the addPublishStreamUrl method, the SDK returns this error. Check whether you set the parameters in the *setLiveTranscoding* method properly. */ + RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1, + /** The RTMP streaming is encrypted and cannot be published. */ + RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2, + /** Timeout for the RTMP streaming. Call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the streaming again. */ + RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3, + /** An error occurs in Agora's streaming server. Call the addPublishStreamUrl method to publish the streaming again. */ + RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4, + /** An error occurs in the RTMP server. */ + RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5, + /** The RTMP streaming publishes too frequently. */ + RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6, + /** The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */ + RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7, + /** The host manipulates other hosts' URLs. Check your app logic. */ + RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8, + /** Agora's server fails to find the RTMP streaming. */ + RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9, + /** The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. */ + RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10, +}; + +/** States of importing an external video stream in a live broadcast. */ +enum INJECT_STREAM_STATUS +{ + /** 0: The external video stream imported successfully. */ + INJECT_STREAM_STATUS_START_SUCCESS = 0, + /** 1: The external video stream already exists. */ + INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1, + /** 2: The external video stream to be imported is unauthorized. */ + INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2, + /** 3: Import external video stream timeout. */ + INJECT_STREAM_STATUS_START_TIMEDOUT = 3, + /** 4: Import external video stream failed. */ + INJECT_STREAM_STATUS_START_FAILED = 4, + /** 5: The external video stream stopped importing successfully. */ + INJECT_STREAM_STATUS_STOP_SUCCESS = 5, + /** 6: No external video stream is found. */ + INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6, + /** 7: The external video stream to be stopped importing is unauthorized. */ + INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7, + /** 8: Stop importing external video stream timeout. */ + INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8, + /** 9: Stop importing external video stream failed. */ + INJECT_STREAM_STATUS_STOP_FAILED = 9, + /** 10: The external video stream is corrupted. */ + INJECT_STREAM_STATUS_BROKEN = 10, +}; +/** Remote video stream types. */ +enum REMOTE_VIDEO_STREAM_TYPE +{ + /** 0: High-stream video. */ + REMOTE_VIDEO_STREAM_HIGH = 0, + /** 1: Low-stream video. */ + REMOTE_VIDEO_STREAM_LOW = 1, +}; + +/** The use mode of the audio data in the \ref media::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" or \ref media::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback. + */ + enum RAW_AUDIO_FRAME_OP_MODE_TYPE +{ + /** 0: Read-only mode: Users only read the \ref agora::media::IAudioFrameObserver::AudioFrame "AudioFrame" data without modifying anything. For example, when users acquire the data with the Agora SDK, then push the RTMP streams. */ + RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0, + /** 1: Write-only mode: Users replace the \ref agora::media::IAudioFrameObserver::AudioFrame "AudioFrame" data with their own data and pass the data to the SDK for encoding. For example, when users acquire the data. */ + RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY = 1, + /** 2: Read and write mode: Users read the data from \ref agora::media::IAudioFrameObserver::AudioFrame "AudioFrame", modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change. */ + RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2, +}; + +/** Audio-sample rates. */ +enum AUDIO_SAMPLE_RATE_TYPE +{ + /** 32000: 32 kHz */ + AUDIO_SAMPLE_RATE_32000 = 32000, + /** 44100: 44.1 kHz */ + AUDIO_SAMPLE_RATE_44100 = 44100, + /** 48000: 48 kHz */ + AUDIO_SAMPLE_RATE_48000 = 48000, +}; + +/** Video codec profile types. */ +enum VIDEO_CODEC_PROFILE_TYPE +{ /** 66: Baseline video codec profile. Generally used in video calls on mobile phones. */ + VIDEO_CODEC_PROFILE_BASELINE = 66, + /** 77: Main video codec profile. Generally used in mainstream electronics such as MP4 players, portable video players, PSP, and iPads. */ + VIDEO_CODEC_PROFILE_MAIN = 77, + /** 100: (Default) High video codec profile. Generally used in high-resolution broadcasts or television. */ + VIDEO_CODEC_PROFILE_HIGH = 100, +}; + +/** Video codec types */ +enum VIDEO_CODEC_TYPE { + /** Standard VP8 */ + VIDEO_CODEC_VP8 = 1, + /** Standard H264 */ + VIDEO_CODEC_H264 = 2, + /** Enhanced VP8 */ + VIDEO_CODEC_EVP = 3, + /** Enhanced H264 */ + VIDEO_CODEC_E264 = 4, +}; + +/** Audio equalization band frequencies. */ +enum AUDIO_EQUALIZATION_BAND_FREQUENCY +{ + /** 0: 31 Hz */ + AUDIO_EQUALIZATION_BAND_31 = 0, + /** 1: 62 Hz */ + AUDIO_EQUALIZATION_BAND_62 = 1, + /** 2: 125 Hz */ + AUDIO_EQUALIZATION_BAND_125 = 2, + /** 3: 250 Hz */ + AUDIO_EQUALIZATION_BAND_250 = 3, + /** 4: 500 Hz */ + AUDIO_EQUALIZATION_BAND_500 = 4, + /** 5: 1 kHz */ + AUDIO_EQUALIZATION_BAND_1K = 5, + /** 6: 2 kHz */ + AUDIO_EQUALIZATION_BAND_2K = 6, + /** 7: 4 kHz */ + AUDIO_EQUALIZATION_BAND_4K = 7, + /** 8: 8 kHz */ + AUDIO_EQUALIZATION_BAND_8K = 8, + /** 9: 16 kHz */ + AUDIO_EQUALIZATION_BAND_16K = 9, +}; + +/** Audio reverberation types. */ +enum AUDIO_REVERB_TYPE +{ + /** 0: The level of the dry signal (db). The value is between -20 and 10. */ + AUDIO_REVERB_DRY_LEVEL = 0, // (dB, [-20,10]), the level of the dry signal + /** 1: The level of the early reflection signal (wet signal) (dB). The value is between -20 and 10. */ + AUDIO_REVERB_WET_LEVEL = 1, // (dB, [-20,10]), the level of the early reflection signal (wet signal) + /** 2: The room size of the reflection. The value is between 0 and 100. */ + AUDIO_REVERB_ROOM_SIZE = 2, // ([0,100]), the room size of the reflection + /** 3: The length of the initial delay of the wet signal (ms). The value is between 0 and 200. */ + AUDIO_REVERB_WET_DELAY = 3, // (ms, [0,200]), the length of the initial delay of the wet signal in ms + /** 4: The reverberation strength. The value is between 0 and 100. */ + AUDIO_REVERB_STRENGTH = 4, // ([0,100]), the strength of the reverberation +}; + +/** + * Local voice changer options. + */ +enum VOICE_CHANGER_PRESET { + /** + * The original voice (no local voice change). + */ + VOICE_CHANGER_OFF = 0x00000000, //Turn off the voice changer + /** + * The voice of an old man. + */ + VOICE_CHANGER_OLDMAN = 0x00000001, + /** + * The voice of a little boy. + */ + VOICE_CHANGER_BABYBOY = 0x00000002, + /** + * The voice of a little girl. + */ + VOICE_CHANGER_BABYGIRL = 0x00000003, + /** + * The voice of Zhu Bajie, a character in Journey to the West who has a voice like that of a growling bear. + */ + VOICE_CHANGER_ZHUBAJIE = 0x00000004, + /** + * The ethereal voice. + */ + VOICE_CHANGER_ETHEREAL = 0x00000005, + /** + * The voice of Hulk. + */ + VOICE_CHANGER_HULK = 0x00000006, + /** + * A more vigorous voice. + */ + VOICE_BEAUTY_VIGOROUS = 0x00100001,//7, + /** + * A deeper voice. + */ + VOICE_BEAUTY_DEEP = 0x00100002, + /** + * A mellower voice. + */ + VOICE_BEAUTY_MELLOW = 0x00100003, + /** + * Falsetto. + */ + VOICE_BEAUTY_FALSETTO = 0x00100004, + /** + * A fuller voice. + */ + VOICE_BEAUTY_FULL = 0x00100005, + /** + * A clearer voice. + */ + VOICE_BEAUTY_CLEAR = 0x00100006, + /** + * A more resounding voice. + */ + VOICE_BEAUTY_RESOUNDING = 0x00100007, + /** + * A more ringing voice. + */ + VOICE_BEAUTY_RINGING = 0x00100008, + /** + * A more spatially resonant voice. + */ + VOICE_BEAUTY_SPACIAL = 0x00100009, + /** + * (For male only) A more magnetic voice. Do not use it when the speaker is a female; otherwise, voice distortion occurs. + */ + GENERAL_BEAUTY_VOICE_MALE_MAGNETIC = 0x00200001, + /** + * (For female only) A fresher voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. + */ + GENERAL_BEAUTY_VOICE_FEMALE_FRESH = 0x00200002, + /** + * (For female only) A more vital voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. + */ + GENERAL_BEAUTY_VOICE_FEMALE_VITALITY = 0x00200003 + +}; + +/** Local voice reverberation presets. */ +enum AUDIO_REVERB_PRESET { + /** + * Turn off local voice reverberation, that is, to use the original voice. + */ + AUDIO_REVERB_OFF = 0x00000000, // Turn off audio reverb + /** + * The reverberation style typical of a KTV venue (enhanced). + */ + AUDIO_REVERB_FX_KTV = 0x00100001, + /** + * The reverberation style typical of a concert hall (enhanced). + */ + AUDIO_REVERB_FX_VOCAL_CONCERT = 0x00100002, + /** + * The reverberation style typical of an uncle's voice. + */ + AUDIO_REVERB_FX_UNCLE = 0x00100003, + /** + * The reverberation style typical of a little sister's voice. + */ + AUDIO_REVERB_FX_SISTER = 0x00100004, + /** + * The reverberation style typical of a recording studio (enhanced). + */ + AUDIO_REVERB_FX_STUDIO = 0x00100005, + /** + * The reverberation style typical of popular music (enhanced). + */ + AUDIO_REVERB_FX_POPULAR = 0x00100006, + /** + * The reverberation style typical of R&B music (enhanced). + */ + AUDIO_REVERB_FX_RNB = 0x00100007, + /** + * The reverberation style typical of the vintage phonograph. + */ + AUDIO_REVERB_FX_PHONOGRAPH = 0x00100008, + /** + * The reverberation style typical of popular music. + */ + AUDIO_REVERB_POPULAR = 0x00000001, + /** + * The reverberation style typical of R&B music. + */ + AUDIO_REVERB_RNB = 0x00000002, + /** + * The reverberation style typical of rock music. + */ + AUDIO_REVERB_ROCK = 0x00000003, + /** + * The reverberation style typical of hip-hop music. + */ + AUDIO_REVERB_HIPHOP = 0x00000004, + /** + * The reverberation style typical of a concert hall. + */ + AUDIO_REVERB_VOCAL_CONCERT = 0x00000005, + /** + * The reverberation style typical of a KTV venue. + */ + AUDIO_REVERB_KTV = 0x00000006, + /** + * The reverberation style typical of a recording studio. + */ + AUDIO_REVERB_STUDIO = 0x00000007, + /** + * The reverberation of the virtual stereo. The virtual stereo is an effect that renders the monophonic + * audio as the stereo audio, so that all users in the channel can hear the stereo voice effect. + * To achieve better virtual stereo reverberation, Agora recommends setting `profile` in `setAudioProfile` + * as `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`. + */ + AUDIO_VIRTUAL_STEREO = 0x00200001 +}; +/** Audio codec profile types. The default value is LC_ACC. */ +enum AUDIO_CODEC_PROFILE_TYPE +{ + /** 0: LC-AAC, which is the low-complexity audio codec type. */ + AUDIO_CODEC_PROFILE_LC_AAC = 0, + /** 1: HE-AAC, which is the high-efficiency audio codec type. */ + AUDIO_CODEC_PROFILE_HE_AAC = 1, +}; + +/** Remote audio states. + */ +enum REMOTE_AUDIO_STATE +{ + /** 0: The remote audio is in the default state, probably due to + * #REMOTE_AUDIO_REASON_LOCAL_MUTED (3), + * #REMOTE_AUDIO_REASON_REMOTE_MUTED (5), or + * #REMOTE_AUDIO_REASON_REMOTE_OFFLINE (7). + */ + REMOTE_AUDIO_STATE_STOPPED = 0, // Default state, audio is started or remote user disabled/muted audio stream + /** 1: The first remote audio packet is received. + */ + REMOTE_AUDIO_STATE_STARTING = 1, // The first audio frame packet has been received + /** 2: The remote audio stream is decoded and plays normally, probably + * due to #REMOTE_AUDIO_REASON_NETWORK_RECOVERY (2), + * #REMOTE_AUDIO_REASON_LOCAL_UNMUTED (4), or + * #REMOTE_AUDIO_REASON_REMOTE_UNMUTED (6). + */ + REMOTE_AUDIO_STATE_DECODING = 2, // The first remote audio frame has been decoded or fronzen state ends + /** 3: The remote audio is frozen, probably due to + * #REMOTE_AUDIO_REASON_NETWORK_CONGESTION (1). + */ + REMOTE_AUDIO_STATE_FROZEN = 3, // Remote audio is frozen, probably due to network issue + /** 4: The remote audio fails to start, probably due to + * #REMOTE_AUDIO_REASON_INTERNAL (0). + */ + REMOTE_AUDIO_STATE_FAILED = 4, // Remote audio play failed +}; + +/** Remote audio state reasons. + */ +enum REMOTE_AUDIO_STATE_REASON +{ + /** 0: Internal reasons. + */ + REMOTE_AUDIO_REASON_INTERNAL = 0, + /** 1: Network congestion. + */ + REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1, + /** 2: Network recovery. + */ + REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2, + /** 3: The local user stops receiving the remote audio stream or + * disables the audio module. + */ + REMOTE_AUDIO_REASON_LOCAL_MUTED = 3, + /** 4: The local user resumes receiving the remote audio stream or + * enables the audio module. + */ + REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4, + /** 5: The remote user stops sending the audio stream or disables the + * audio module. + */ + REMOTE_AUDIO_REASON_REMOTE_MUTED = 5, + /** 6: The remote user resumes sending the audio stream or enables the + * audio module. + */ + REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6, + /** 7: The remote user leaves the channel. + */ + REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7, +}; + +/** Remote video states. */ +// enum REMOTE_VIDEO_STATE +// { +// // REMOTE_VIDEO_STATE_STOPPED is not used at this version. Ignore this value. +// // REMOTE_VIDEO_STATE_STOPPED = 0, // Default state, video is started or remote user disabled/muted video stream +// /** 1: The remote video is playing. */ +// REMOTE_VIDEO_STATE_RUNNING = 1, // Running state, remote video can be displayed normally +// /** 2: The remote video is frozen. */ +// REMOTE_VIDEO_STATE_FROZEN = 2, // Remote video is frozen, probably due to network issue. +// }; + +/** The state of the remote video. */ +enum REMOTE_VIDEO_STATE { + /** 0: The remote video is in the default state, probably due to #REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED (3), #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5), or #REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE (7). + */ + REMOTE_VIDEO_STATE_STOPPED = 0, + + /** 1: The first remote video packet is received. + */ + REMOTE_VIDEO_STATE_STARTING = 1, + + /** 2: The remote video stream is decoded and plays normally, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), #REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED (4), #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6), or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY (9). + */ + REMOTE_VIDEO_STATE_DECODING = 2, + + /** 3: The remote video is frozen, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION (1) or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK (8). + */ + REMOTE_VIDEO_STATE_FROZEN = 3, + + /** 4: The remote video fails to start, probably due to #REMOTE_VIDEO_STATE_REASON_INTERNAL (0). + */ + REMOTE_VIDEO_STATE_FAILED = 4 +}; + +/** The reason of the remote video state change. */ +enum REMOTE_VIDEO_STATE_REASON { + /** 0: Internal reasons. + */ + REMOTE_VIDEO_STATE_REASON_INTERNAL = 0, + + /** 1: Network congestion. + */ + REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1, + + /** 2: Network recovery. + */ + REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2, + + /** 3: The local user stops receiving the remote video stream or disables the video module. + */ + REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3, + + /** 4: The local user resumes receiving the remote video stream or enables the video module. + */ + REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4, + + /** 5: The remote user stops sending the video stream or disables the video module. + */ + REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5, + + /** 6: The remote user resumes sending the video stream or enables the video module. + */ + REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6, + + /** 7: The remote user leaves the channel. + */ + REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7, + + /** 8: The remote media stream falls back to the audio-only stream due to poor network conditions. + */ + REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8, + + /** 9: The remote media stream switches back to the video stream after the network conditions improve. + */ + REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9 + +}; + +/** Video frame rates. */ +enum FRAME_RATE +{ + /** 1: 1 fps */ + FRAME_RATE_FPS_1 = 1, + /** 7: 7 fps */ + FRAME_RATE_FPS_7 = 7, + /** 10: 10 fps */ + FRAME_RATE_FPS_10 = 10, + /** 15: 15 fps */ + FRAME_RATE_FPS_15 = 15, + /** 24: 24 fps */ + FRAME_RATE_FPS_24 = 24, + /** 30: 30 fps */ + FRAME_RATE_FPS_30 = 30, + /** 60: 60 fps (Windows and macOS only) */ + FRAME_RATE_FPS_60 = 60, +}; + +/** Video output orientation modes. + */ +enum ORIENTATION_MODE { + /** 0: (Default) Adaptive mode. + + The video encoder adapts to the orientation mode of the video input device. + + - If the width of the captured video from the SDK is greater than the height, the encoder sends the video in landscape mode. The encoder also sends the rotational information of the video, and the receiver uses the rotational information to rotate the received video. + - When you use a custom video source, the output video from the encoder inherits the orientation of the original video. If the original video is in portrait mode, the output video from the encoder is also in portrait mode. The encoder also sends the rotational information of the video to the receiver. + */ + ORIENTATION_MODE_ADAPTIVE = 0, + /** 1: Landscape mode. + + The video encoder always sends the video in landscape mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming. + */ + ORIENTATION_MODE_FIXED_LANDSCAPE = 1, + /** 2: Portrait mode. + + The video encoder always sends the video in portrait mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming. + */ + ORIENTATION_MODE_FIXED_PORTRAIT = 2, +}; + +/** Video degradation preferences when the bandwidth is a constraint. */ +enum DEGRADATION_PREFERENCE { + /** 0: (Default) Degrade the frame rate in order to maintain the video quality. */ + MAINTAIN_QUALITY = 0, + /** 1: Degrade the video quality in order to maintain the frame rate. */ + MAINTAIN_FRAMERATE = 1, + /** 2: (For future use) Maintain a balance between the frame rate and video quality. */ + MAINTAIN_BALANCED = 2, +}; + +/** Stream fallback options. */ +enum STREAM_FALLBACK_OPTIONS +{ + /** 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed. */ + STREAM_FALLBACK_OPTION_DISABLED = 0, + /** 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-stream (low resolution and low bitrate) video. You can set this option only in the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. Nothing happens when you set this in the \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" method. */ + STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW = 1, + /** 2: Under poor uplink network conditions, the published video stream falls back to audio only. + + Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network conditions worsen.*/ + STREAM_FALLBACK_OPTION_AUDIO_ONLY = 2, +}; + + /** Camera capturer configuration. + */ + enum CAPTURER_OUTPUT_PREFERENCE + { + /** 0: (Default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality. + */ + CAPTURER_OUTPUT_PREFERENCE_AUTO = 0, + /** 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". + */ + CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1, + /** 2: Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing. + */ + CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2, + }; + +/** The priority of the remote user. + */ +enum PRIORITY_TYPE +{ + /** 50: The user's priority is high. + */ + PRIORITY_HIGH = 50, + /** 100: (Default) The user's priority is normal. + */ + PRIORITY_NORMAL = 100, +}; + +/** Connection states. */ +enum CONNECTION_STATE_TYPE +{ + /** 1: The SDK is disconnected from Agora's edge server. + + - This is the initial state before calling the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + - The SDK also enters this state when the application calls the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + */ + CONNECTION_STATE_DISCONNECTED = 1, + /** 2: The SDK is connecting to Agora's edge server. + + - When the application calls the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method, the SDK starts to establish a connection to the specified channel, triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, and switches to the #CONNECTION_STATE_CONNECTING state. + - When the SDK successfully joins the channel, it triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_CONNECTED state. + - After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. + */ + CONNECTION_STATE_CONNECTING = 2, + /** 3: The SDK is connected to Agora's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel. + + If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers: + - The \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback (deprecated). + - The \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_RECONNECTING state. + */ + CONNECTION_STATE_CONNECTED = 3, + /** 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. + + - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora's edge server, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback, stays in the #CONNECTION_STATE_RECONNECTING state, and keeps rejoining the channel. + - If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, switches to the #CONNECTION_STATE_FAILED state, and stops rejoining the channel. + */ + CONNECTION_STATE_RECONNECTING = 4, + /** 5: The SDK fails to connect to Agora's edge server or join the channel. + + You must call the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method to leave this state, and call the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method again to rejoin the channel. + + If the SDK is banned from joining the channel by Agora's edge server (through the RESTful API), the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionBanned "onConnectionBanned" (deprecated) and \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callbacks. + */ + CONNECTION_STATE_FAILED = 5, +}; + +/** Reasons for a connection state change. */ +enum CONNECTION_CHANGED_REASON_TYPE +{ + /** 0: The SDK is connecting to Agora's edge server. */ + CONNECTION_CHANGED_CONNECTING = 0, + /** 1: The SDK has joined the channel successfully. */ + CONNECTION_CHANGED_JOIN_SUCCESS = 1, + /** 2: The connection between the SDK and Agora's edge server is interrupted. */ + CONNECTION_CHANGED_INTERRUPTED = 2, + /** 3: The connection between the SDK and Agora's edge server is banned by Agora's edge server. */ + CONNECTION_CHANGED_BANNED_BY_SERVER = 3, + /** 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. */ + CONNECTION_CHANGED_JOIN_FAILED = 4, + /** 5: The SDK has left the channel. */ + CONNECTION_CHANGED_LEAVE_CHANNEL = 5, + /** 6: The connection failed since Appid is not valid. */ + CONNECTION_CHANGED_INVALID_APP_ID = 6, + /** 7: The connection failed since channel name is not valid. */ + CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7, + /** 8: The connection failed since token is not valid, possibly because: + + - The App Certificate for the project is enabled in Console, but you do not use Token when joining the channel. If you enable the App Certificate, you must use a token to join the channel. + - The uid that you specify in the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method is different from the uid that you pass for generating the token. + */ + CONNECTION_CHANGED_INVALID_TOKEN = 8, + /** 9: The connection failed since token is expired. */ + CONNECTION_CHANGED_TOKEN_EXPIRED = 9, + /** 10: The connection is rejected by server. */ + CONNECTION_CHANGED_REJECTED_BY_SERVER = 10, + /** 11: The connection changed to reconnecting since SDK has set a proxy server. */ + CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11, + /** 12: When SDK is in connection failed, the renew token operation will make it connecting. */ + CONNECTION_CHANGED_RENEW_TOKEN = 12, + /** 13: The IP Address of SDK client has changed. i.e., Network type or IP/Port changed by network operator might change client IP address. */ + CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13, + /** 14: Timeout for the keep-alive of the connection between the SDK and Agora's edge server. The connection state changes to CONNECTION_STATE_RECONNECTING(4). */ + CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14, +}; + +/** Network type. */ +enum NETWORK_TYPE +{ + /** -1: The network type is unknown. */ + NETWORK_TYPE_UNKNOWN = -1, + /** 0: The SDK disconnects from the network. */ + NETWORK_TYPE_DISCONNECTED = 0, + /** 1: The network type is LAN. */ + NETWORK_TYPE_LAN = 1, + /** 2: The network type is Wi-Fi(including hotspots). */ + NETWORK_TYPE_WIFI = 2, + /** 3: The network type is mobile 2G. */ + NETWORK_TYPE_MOBILE_2G = 3, + /** 4: The network type is mobile 3G. */ + NETWORK_TYPE_MOBILE_3G = 4, + /** 5: The network type is mobile 4G. */ + NETWORK_TYPE_MOBILE_4G = 5, +}; + +/** States of the last-mile network probe test. */ +enum LASTMILE_PROBE_RESULT_STATE { + /** 1: The last-mile network probe test is complete. */ + LASTMILE_PROBE_RESULT_COMPLETE = 1, + /** 2: The last-mile network probe test is incomplete and the bandwidth estimation is not available, probably due to limited test resources. */ + LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2, + /** 3: The last-mile network probe test is not carried out, probably due to poor network conditions. */ + LASTMILE_PROBE_RESULT_UNAVAILABLE = 3 +}; +/** Audio output routing. */ +enum AUDIO_ROUTE_TYPE { + /** Default. + */ + AUDIO_ROUTE_DEFAULT = -1, + /** Headset. + */ + AUDIO_ROUTE_HEADSET = 0, + /** Earpiece. + */ + AUDIO_ROUTE_EARPIECE = 1, + /** Headset with no microphone. + */ + AUDIO_ROUTE_HEADSET_NO_MIC = 2, + /** Speakerphone. + */ + AUDIO_ROUTE_SPEAKERPHONE = 3, + /** Loudspeaker. + */ + AUDIO_ROUTE_LOUDSPEAKER = 4, + /** Bluetooth headset. + */ + AUDIO_ROUTE_BLUETOOTH = 5, + /** USB peripheral. + */ + AUDIO_ROUTE_USB = 6, + /** HDMI peripheral. + */ + AUDIO_ROUTE_HDMI = 7, + /** DisplayPort peripheral. + */ + AUDIO_ROUTE_DISPLAYPORT = 8, + /** Apple AirPlay. + */ + AUDIO_ROUTE_AIRPLAY = 9, +}; + +#if (defined(__APPLE__) && TARGET_OS_IOS) +/** Audio session restriction. */ +enum AUDIO_SESSION_OPERATION_RESTRICTION { + /** No restriction, the SDK has full control of the audio session operations. */ + AUDIO_SESSION_OPERATION_RESTRICTION_NONE = 0, + /** The SDK does not change the audio session category. */ + AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY = 1, + /** The SDK does not change any setting of the audio session (category, mode, categoryOptions). */ + AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION = 1 << 1, + /** The SDK keeps the audio session active when leaving a channel. */ + AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION = 1 << 2, + /** The SDK does not configure the audio session anymore. */ + AUDIO_SESSION_OPERATION_RESTRICTION_ALL = 1 << 7, +}; +#endif + +#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) +enum CAMERA_DIRECTION { + /** The rear camera. */ + CAMERA_REAR = 0, + /** The front camera. */ + CAMERA_FRONT = 1, +}; +#endif + +/** The uplink or downlink last-mile network probe test result. */ +struct LastmileProbeOneWayResult { + /** The packet loss rate (%). */ + unsigned int packetLossRate; + /** The network jitter (ms). */ + unsigned int jitter; + /* The estimated available bandwidth (bps). */ + unsigned int availableBandwidth; +}; + +/** The uplink and downlink last-mile network probe test result. */ +struct LastmileProbeResult{ + /** The state of the probe test. */ + LASTMILE_PROBE_RESULT_STATE state; + /** The uplink last-mile network probe test result. */ + LastmileProbeOneWayResult uplinkReport; + /** The downlink last-mile network probe test result. */ + LastmileProbeOneWayResult downlinkReport; + /** The round-trip delay time (ms). */ + unsigned int rtt; +}; + +/** Configurations of the last-mile network probe test. */ +struct LastmileProbeConfig { + /** Sets whether or not to test the uplink network. Some users, for example, the audience in a Live-broadcast channel, do not need such a test: + - true: test. + - false: do not test. */ + bool probeUplink; + /** Sets whether or not to test the downlink network: + - true: test. + - false: do not test. */ + bool probeDownlink; + /** The expected maximum sending bitrate (bps) of the local user. The value ranges between 100000 and 5000000. We recommend setting this parameter according to the bitrate value set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". */ + unsigned int expectedUplinkBitrate; + /** The expected maximum receiving bitrate (bps) of the local user. The value ranges between 100000 and 5000000. */ + unsigned int expectedDownlinkBitrate; +}; + +/** Properties of the audio volume information. + + An array containing the user ID and volume information for each speaker. + */ +struct AudioVolumeInfo +{ + /** + User ID of the speaker. The uid of the local user is 0. + */ + uid_t uid; + /** The volume of the speaker. The volume ranges between 0 (lowest volume) and 255 (highest volume). + */ + unsigned int volume; + /** Voice activity status of the local user. + * - 0: The local user is not speaking. + * - 1: The local user is speaking. + * + * @note + * - The `vad` parameter cannot report the voice activity status of the remote users. In the remote users' callback, `vad` = 0. + * - Ensure that you set `report_vad`(true) in the \ref agora::rtc::IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method to enable the voice activity detection of the local user. + */ + unsigned int vad; + /** The channel ID, which indicates which channel the speaker is in. + */ + const char * channelId; +}; + +/** Statistics of the channel. + */ +struct RtcStats +{ + /** + Call duration (s), represented by an aggregate value. + */ + unsigned int duration; + /** + Total number of bytes transmitted, represented by an aggregate value. + */ + unsigned int txBytes; + /** + Total number of bytes received, represented by an aggregate value. + */ + unsigned int rxBytes; + /** Total number of audio bytes sent (bytes), represented + * by an aggregate value. + */ + unsigned int txAudioBytes; + /** Total number of video bytes sent (bytes), represented + * by an aggregate value. + */ + unsigned int txVideoBytes; + /** Total number of audio bytes received (bytes) before + * network countermeasures, represented by an aggregate value. + */ + unsigned int rxAudioBytes; + /** Total number of video bytes received (bytes), + * represented by an aggregate value. + */ + unsigned int rxVideoBytes; + + /** + Transmission bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short txKBitRate; + /** + Receive bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short rxKBitRate; + /** + Audio receive bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short rxAudioKBitRate; + /** + Audio transmission bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short txAudioKBitRate; + /** + Video receive bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short rxVideoKBitRate; + /** + Video transmission bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short txVideoKBitRate; + /** Client-server latency (ms) + */ + unsigned short lastmileDelay; + /** The packet loss rate (%) from the local client to Agora's edge server, + * before using the anti-packet-loss method. + */ + unsigned short txPacketLossRate; + /** The packet loss rate (%) from Agora's edge server to the local client, + * before using the anti-packet-loss method. + */ + unsigned short rxPacketLossRate; + /** Number of users in the channel. + + - Communication profile: The number of users in the channel. + - Live broadcast profile: + + - If the local user is an audience: The number of users in the channel = The number of hosts in the channel + 1. + - If the user is a host: The number of users in the channel = The number of hosts in the channel. + */ + unsigned int userCount; + /** + Application CPU usage (%). + */ + double cpuAppUsage; + /** + System CPU usage (%). + + In the multi-kernel environment, this member represents the average CPU usage. + The value **=** 100 **-** System Idle Progress in Task Manager (%). + */ + double cpuTotalUsage; + /** The round-trip time delay from the client to the local router. + */ + int gatewayRtt; + /** + The memory usage ratio of the app (%). + @note This value is for reference only. Due to system limitations, you may not get the value of this member. + */ + double memoryAppUsageRatio; + /** + The memory usage ratio of the system (%). + @note This value is for reference only. Due to system limitations, you may not get the value of this member. + */ + double memoryTotalUsageRatio; + /** + The memory usage of the app (KB). + @note This value is for reference only. Due to system limitations, you may not get the value of this member. + */ + int memoryAppUsageInKbytes; + RtcStats() + : duration(0) + , txBytes(0) + , rxBytes(0) + , txAudioBytes(0) + , txVideoBytes(0) + , rxAudioBytes(0) + , rxVideoBytes(0) + , txKBitRate(0) + , rxKBitRate(0) + , rxAudioKBitRate(0) + , txAudioKBitRate(0) + , rxVideoKBitRate(0) + , txVideoKBitRate(0) + , lastmileDelay(0) + , txPacketLossRate(0) + , rxPacketLossRate(0) + , userCount(0) + , cpuAppUsage(0) + , cpuTotalUsage(0) + , gatewayRtt(0) + , memoryAppUsageRatio(0) + , memoryTotalUsageRatio(0) + , memoryAppUsageInKbytes(0) {} +}; + +/** Quality change of the local video in terms of target frame rate and target bit rate since last count. + */ +enum QUALITY_ADAPT_INDICATION { + /** The quality of the local video stays the same. */ + ADAPT_NONE = 0, + /** The quality improves because the network bandwidth increases. */ + ADAPT_UP_BANDWIDTH = 1, + /** The quality worsens because the network bandwidth decreases. */ + ADAPT_DOWN_BANDWIDTH = 2, +}; + +/** The error code in CHANNEL_MEDIA_RELAY_ERROR. */ +enum CHANNEL_MEDIA_RELAY_ERROR { + /** 0: The state is normal. + */ + RELAY_OK = 0, + /** 1: An error occurs in the server response. + */ + RELAY_ERROR_SERVER_ERROR_RESPONSE = 1, + /** 2: No server response. You can call the + * \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method to + * leave the channel. + */ + RELAY_ERROR_SERVER_NO_RESPONSE = 2, + /** 3: The SDK fails to access the service, probably due to limited + * resources of the server. + */ + RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3, + /** 4: Fails to send the relay request. + */ + RELAY_ERROR_FAILED_JOIN_SRC = 4, + /** 5: Fails to accept the relay request. + */ + RELAY_ERROR_FAILED_JOIN_DEST = 5, + /** 6: The server fails to receive the media stream. + */ + RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6, + /** 7: The server fails to send the media stream. + */ + RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7, + /** 8: The SDK disconnects from the server due to poor network + * connections. You can call the \ref agora::rtc::IRtcEngine::leaveChannel + * "leaveChannel" method to leave the channel. + */ + RELAY_ERROR_SERVER_CONNECTION_LOST = 8, + /** 9: An internal error occurs in the server. + */ + RELAY_ERROR_INTERNAL_ERROR = 9, + /** 10: The token of the source channel has expired. + */ + RELAY_ERROR_SRC_TOKEN_EXPIRED = 10, + /** 11: The token of the destination channel has expired. + */ + RELAY_ERROR_DEST_TOKEN_EXPIRED = 11, +}; + +/** The event code in CHANNEL_MEDIA_RELAY_EVENT. */ +enum CHANNEL_MEDIA_RELAY_EVENT { + /** 0: The user disconnects from the server due to poor network + * connections. + */ + RELAY_EVENT_NETWORK_DISCONNECTED = 0, + /** 1: The network reconnects. + */ + RELAY_EVENT_NETWORK_CONNECTED = 1, + /** 2: The user joins the source channel. + */ + RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2, + /** 3: The user joins the destination channel. + */ + RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3, + /** 4: The SDK starts relaying the media stream to the destination channel. + */ + RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4, + /** 5: The server receives the video stream from the source channel. + */ + RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5, + /** 6: The server receives the audio stream from the source channel. + */ + RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6, + /** 7: The destination channel is updated. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7, + /** 8: The destination channel update fails due to internal reasons. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8, + /** 9: The destination channel does not change, which means that the + * destination channel fails to be updated. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9, + /** 10: The destination channel name is NULL. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10, + /** 11: The video profile is sent to the server. + */ + RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11, +}; + +/** The state code in CHANNEL_MEDIA_RELAY_STATE. */ +enum CHANNEL_MEDIA_RELAY_STATE { + /** 0: The SDK is initializing. + */ + RELAY_STATE_IDLE = 0, + /** 1: The SDK tries to relay the media stream to the destination channel. + */ + RELAY_STATE_CONNECTING = 1, + /** 2: The SDK successfully relays the media stream to the destination + * channel. + */ + RELAY_STATE_RUNNING = 2, + /** 3: A failure occurs. See the details in code. + */ + RELAY_STATE_FAILURE = 3, +}; + +/** Statistics of the local video stream. + */ +struct LocalVideoStats +{ + /** Bitrate (Kbps) sent in the reported interval, which does not include + * the bitrate of the retransmission video after packet loss. + */ + int sentBitrate; + /** Frame rate (fps) sent in the reported interval, which does not include + * the frame rate of the retransmission video after packet loss. + */ + int sentFrameRate; + /** The encoder output frame rate (fps) of the local video. + */ + int encoderOutputFrameRate; + /** The render output frame rate (fps) of the local video. + */ + int rendererOutputFrameRate; + /** The target bitrate (Kbps) of the current encoder. This value is estimated by the SDK based on the current network conditions. + */ + int targetBitrate; + /** The target frame rate (fps) of the current encoder. + */ + int targetFrameRate; + /** Quality change of the local video in terms of target frame rate and + * target bit rate in this reported interval. See #QUALITY_ADAPT_INDICATION. + */ + QUALITY_ADAPT_INDICATION qualityAdaptIndication; + /** The encoding bitrate (Kbps), which does not include the bitrate of the + * re-transmission video after packet loss. + */ + int encodedBitrate; + /** The width of the encoding frame (px). + */ + int encodedFrameWidth; + /** The height of the encoding frame (px). + */ + int encodedFrameHeight; + /** The value of the sent frames, represented by an aggregate value. + */ + int encodedFrameCount; + /** The codec type of the local video: + * - VIDEO_CODEC_VP8 = 1: VP8. + * - VIDEO_CODEC_H264 = 2: (Default) H.264. + */ + VIDEO_CODEC_TYPE codecType; +}; + +/** Statistics of the remote video stream. + */ +struct RemoteVideoStats +{ + /** + User ID of the remote user sending the video streams. + */ + uid_t uid; + /** **DEPRECATED** Time delay (ms). + * + * In scenarios where audio and video is synchronized, you can use the value of + * `networkTransportDelay` and `jitterBufferDelay` in `RemoteAudioStats` to know the delay statistics of the remote video. + */ + int delay; +/** + Width (pixels) of the video stream. + */ + int width; + /** + Height (pixels) of the video stream. + */ + int height; + /** + Bitrate (Kbps) received since the last count. + */ + int receivedBitrate; + /** The decoder output frame rate (fps) of the remote video. + */ + int decoderOutputFrameRate; + /** The render output frame rate (fps) of the remote video. + */ + int rendererOutputFrameRate; + /** Packet loss rate (%) of the remote video stream after using the anti-packet-loss method. + */ + int packetLossRate; + /** The type of the remote video stream: #REMOTE_VIDEO_STREAM_TYPE + */ + REMOTE_VIDEO_STREAM_TYPE rxStreamType; + /** + The total freeze time (ms) of the remote video stream after the remote user joins the channel. + In a video session where the frame rate is set to no less than 5 fps, video freeze occurs when + the time interval between two adjacent renderable video frames is more than 500 ms. + */ + int totalFrozenTime; + /** + The total video freeze time as a percentage (%) of the total time when the video is available. + */ + int frozenRate; + /** + The total time (ms) when the remote user in the Communication profile or the remote + broadcaster in the Live-broadcast profile neither stops sending the video stream nor + disables the video module after joining the channel. + + @since v3.0.1 + */ + int totalActiveTime; +}; + +/** Audio statistics of the local user */ +struct LocalAudioStats +{ + /** The number of channels. + */ + int numChannels; + /** The sample rate (Hz). + */ + int sentSampleRate; + /** The average sending bitrate (Kbps). + */ + int sentBitrate; +}; + +/** Audio statistics of a remote user */ +struct RemoteAudioStats +{ + /** User ID of the remote user sending the audio streams. + * + */ + uid_t uid; + /** Audio quality received by the user: #QUALITY_TYPE. + */ + int quality; + /** Network delay (ms) from the sender to the receiver. + */ + int networkTransportDelay; + /** Network delay (ms) from the receiver to the jitter buffer. + */ + int jitterBufferDelay; + /** The audio frame loss rate in the reported interval. + */ + int audioLossRate; + /** The number of channels. + */ + int numChannels; + /** The sample rate (Hz) of the received audio stream in the reported + * interval. + */ + int receivedSampleRate; + /** The average bitrate (Kbps) of the received audio stream in the + * reported interval. */ + int receivedBitrate; + /** The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In a session, audio freeze occurs when the audio frame loss rate reaches 4%. + */ + int totalFrozenTime; + /** The total audio freeze time as a percentage (%) of the total time when the audio is available. */ + int frozenRate; + /** The total time (ms) when the remote user in the Communication profile or the remote broadcaster in + the Live-broadcast profile neither stops sending the audio stream nor disables the audio module after joining the channel. + */ + int totalActiveTime; +}; + +/** + * Video dimensions. + */ +struct VideoDimensions { + /** Width (pixels) of the video. */ + int width; + /** Height (pixels) of the video. */ + int height; + VideoDimensions() + : width(640), height(480) + {} + VideoDimensions(int w, int h) + : width(w), height(h) + {} +}; + +/** (Recommended) The standard bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. + + In this mode, the bitrates differ between the live broadcast and communication profiles: + + - Communication profile: The video bitrate is the same as the base bitrate. + - Live broadcast profile: The video bitrate is twice the base bitrate. + + */ +const int STANDARD_BITRATE = 0; + +/** The compatible bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. + + The bitrate remains the same regardless of the channel profile. If you choose this mode in the Live-broadcast profile, the video frame rate may be lower than the set value. + */ +const int COMPATIBLE_BITRATE = -1; + +/** Use the default minimum bitrate. + */ +const int DEFAULT_MIN_BITRATE = -1; + +/** Video encoder configurations. + */ +struct VideoEncoderConfiguration { + /** The video frame dimensions (px) used to specify the video quality and measured by the total number of pixels along a frame's width and height: VideoDimensions. The default value is 640 x 360. + */ + VideoDimensions dimensions; + /** The frame rate of the video: #FRAME_RATE. The default value is 15. + + Note that we do not recommend setting this to a value greater than 30. + */ + FRAME_RATE frameRate; + /** The minimum frame rate of the video. The default value is -1. + */ + int minFrameRate; + /** The video encoding bitrate (Kbps). + + Choose one of the following options: + + - #STANDARD_BITRATE: (Recommended) The standard bitrate. + - The Communication profile: the encoding bitrate equals the base bitrate. + - The Live-broadcast profile: the encoding bitrate is twice the base bitrate. + - #COMPATIBLE_BITRATE: The compatible bitrate: the bitrate stays the same regardless of the profile. + + The Communication profile prioritizes smoothness, while the Live-broadcast profile prioritizes video quality (requiring a higher bitrate). We recommend setting the bitrate mode as #STANDARD_BITRATE to address this difference. + + The following table lists the recommended video encoder configurations, where the base bitrate applies to the Communication profile. Set your bitrate based on this table. If you set a bitrate beyond the proper range, the SDK automatically sets it to within the range. + + @note + In the following table, **Base Bitrate** applies to the Communication profile, and **Live Bitrate** applies to the Live-broadcast profile. + + | Resolution | Frame Rate (fps) | Base Bitrate (Kbps) | Live Bitrate (Kbps) | + |------------------------|------------------|----------------------------------------|----------------------------------------| + | 160 * 120 | 15 | 65 | 130 | + | 120 * 120 | 15 | 50 | 100 | + | 320 * 180 | 15 | 140 | 280 | + | 180 * 180 | 15 | 100 | 200 | + | 240 * 180 | 15 | 120 | 240 | + | 320 * 240 | 15 | 200 | 400 | + | 240 * 240 | 15 | 140 | 280 | + | 424 * 240 | 15 | 220 | 440 | + | 640 * 360 | 15 | 400 | 800 | + | 360 * 360 | 15 | 260 | 520 | + | 640 * 360 | 30 | 600 | 1200 | + | 360 * 360 | 30 | 400 | 800 | + | 480 * 360 | 15 | 320 | 640 | + | 480 * 360 | 30 | 490 | 980 | + | 640 * 480 | 15 | 500 | 1000 | + | 480 * 480 | 15 | 400 | 800 | + | 640 * 480 | 30 | 750 | 1500 | + | 480 * 480 | 30 | 600 | 1200 | + | 848 * 480 | 15 | 610 | 1220 | + | 848 * 480 | 30 | 930 | 1860 | + | 640 * 480 | 10 | 400 | 800 | + | 1280 * 720 | 15 | 1130 | 2260 | + | 1280 * 720 | 30 | 1710 | 3420 | + | 960 * 720 | 15 | 910 | 1820 | + | 960 * 720 | 30 | 1380 | 2760 | + | 1920 * 1080 | 15 | 2080 | 4160 | + | 1920 * 1080 | 30 | 3150 | 6300 | + | 1920 * 1080 | 60 | 4780 | 6500 | + | 2560 * 1440 | 30 | 4850 | 6500 | + | 2560 * 1440 | 60 | 6500 | 6500 | + | 3840 * 2160 | 30 | 6500 | 6500 | + | 3840 * 2160 | 60 | 6500 | 6500 | + + */ + int bitrate; + /** The minimum encoding bitrate (Kbps). + + The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, Agora does not recommend changing this value. + + @note This parameter applies only to the Live-broadcast profile. + */ + int minBitrate; + /** The video orientation mode of the video: #ORIENTATION_MODE. + */ + ORIENTATION_MODE orientationMode; + /** The video encoding degradation preference under limited bandwidth: #DEGRADATION_PREFERENCE. + */ + DEGRADATION_PREFERENCE degradationPreference; + /** Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See #VIDEO_MIRROR_MODE_TYPE + + @note: The SDK disables the mirror mode by default. + */ + VIDEO_MIRROR_MODE_TYPE mirrorMode; + + VideoEncoderConfiguration( + const VideoDimensions& d, FRAME_RATE f, + int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO) + : dimensions(d), frameRate(f), minFrameRate(-1), bitrate(b), + minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m), + degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr) + {} + VideoEncoderConfiguration( + int width, int height, FRAME_RATE f, + int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO) + : dimensions(width, height), frameRate(f), + minFrameRate(-1), bitrate(b), + minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m), + degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr) + {} + VideoEncoderConfiguration() + : dimensions(640, 480) + , frameRate(FRAME_RATE_FPS_15) + , minFrameRate(-1) + , bitrate(STANDARD_BITRATE) + , minBitrate(DEFAULT_MIN_BITRATE) + , orientationMode(ORIENTATION_MODE_ADAPTIVE) + , degradationPreference(MAINTAIN_QUALITY) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + {} +}; + +/** The video and audio properties of the user displaying the video in the CDN live. Agora supports a maximum of 17 transcoding users in a CDN streaming channel. +*/ +typedef struct TranscodingUser { + /** User ID of the user displaying the video in the CDN live. + */ + uid_t uid; + +/** Horizontal position (pixel) of the video frame relative to the top left corner. +*/ + int x; + /** Vertical position (pixel) of the video frame relative to the top left corner. + */ + int y; + /** Width (pixel) of the video frame. The default value is 360. + */ + int width; + /** Height (pixel) of the video frame. The default value is 640. + */ + int height; + + /** The layer index of the video frame. An integer. The value range is [0, 100]. + + - 0: (Default) Bottom layer. + - 100: Top layer. + + @note + - If zOrder is beyond this range, the SDK reports #ERR_INVALID_ARGUMENT. + - As of v2.3, the SDK supports zOrder = 0. + */ + int zOrder; + /** The transparency level of the user's video. The value ranges between 0 and 1.0: + + - 0: Completely transparent + - 1.0: (Default) Opaque + */ + double alpha; + /** The audio channel of the sound. The default value is 0: + + - 0: (Default) Supports dual channels at most, depending on the upstream of the broadcaster. + - 1: The audio stream of the broadcaster uses the FL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 2: The audio stream of the broadcaster uses the FC audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 3: The audio stream of the broadcaster uses the FR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 4: The audio stream of the broadcaster uses the BL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 5: The audio stream of the broadcaster uses the BR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + + @note If your setting is not 0, you may need a specialized player. + */ + int audioChannel; + TranscodingUser() + : uid(0) + , x(0) + , y(0) + , width(0) + , height(0) + , zOrder(0) + , alpha(1.0) + , audioChannel(0) + {} + +} TranscodingUser; + +/** Image properties. + + The properties of the watermark and background images. + */ +typedef struct RtcImage { + RtcImage() : + url(NULL), + x(0), + y(0), + width(0), + height(0) + {} + /** HTTP/HTTPS URL address of the image on the broadcasting video. The maximum length of this parameter is 1024 bytes. */ + const char* url; + /** Horizontal position of the image from the upper left of the broadcasting video. */ + int x; + /** Vertical position of the image from the upper left of the broadcasting video. */ + int y; + /** Width of the image on the broadcasting video. */ + int width; + /** Height of the image on the broadcasting video. */ + int height; +} RtcImage; + +/** A struct for managing CDN live audio/video transcoding settings. +*/ +typedef struct LiveTranscoding { + /** The width of the video in pixels. The default value is 360. + * - When pushing video streams to the CDN, ensure that `width` is at least 64; otherwise, the Agora server adjusts the value to 64. + * - When pushing audio streams to the CDN, set `width` and `height` as 0. + */ + int width; + /** The height of the video in pixels. The default value is 640. + * - When pushing video streams to the CDN, ensure that `height` is at least 64; otherwise, the Agora server adjusts the value to 64. + * - When pushing audio streams to the CDN, set `width` and `height` as 0. + */ + int height; + /** Bitrate of the CDN live output video stream. The default value is 400 Kbps. + + Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range. + */ + int videoBitrate; + /** Frame rate of the output video stream set for the CDN live broadcast. The default value is 15 fps, and the value range is (0,30]. + + @note The Agora server adjusts any value over 30 to 30. + */ + int videoFramerate; + + /** **DEPRECATED** Latency mode: + + - true: Low latency with unassured quality. + - false: (Default) High latency with assured quality. + */ + bool lowLatency; + + /** Video GOP in frames. The default value is 30 fps. + */ + int videoGop; + /** Self-defined video codec profile: #VIDEO_CODEC_PROFILE_TYPE. + + @note If you set this parameter to other values, Agora adjusts it to the default value of 100. + */ + VIDEO_CODEC_PROFILE_TYPE videoCodecProfile; + /** The background color in RGB hex value. Value only. Do not include a preceeding #. For example, 0xFFB6C1 (light pink). The default value is 0x000000 (black). + */ + unsigned int backgroundColor; + /** The number of users in the live broadcast. + */ + unsigned int userCount; + /** TranscodingUser + */ + TranscodingUser *transcodingUsers; + /** Reserved property. Extra user-defined information to send SEI for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes. + + For more information on SEI frame, see [SEI-related questions](https://docs.agora.io/en/faq/sei). + */ + const char *transcodingExtraInfo; + + /** **DEPRECATED** The metadata sent to the CDN live client defined by the RTMP or HTTP-FLV metadata. + */ + const char *metadata; + /** The watermark image added to the CDN live publishing stream. + + Ensure that the format of the image is PNG. Once a watermark image is added, the audience of the CDN live publishing stream can see the watermark image. See RtcImage. + */ + RtcImage* watermark; + /** The background image added to the CDN live publishing stream. + + Once a background image is added, the audience of the CDN live publishing stream can see the background image. See RtcImage. + */ + RtcImage* backgroundImage; + /** Self-defined audio-sample rate: #AUDIO_SAMPLE_RATE_TYPE. + */ + AUDIO_SAMPLE_RATE_TYPE audioSampleRate; + /** Bitrate of the CDN live audio output stream. The default value is 48 Kbps, and the highest value is 128. + */ + int audioBitrate; + /** The numbder of audio channels for the CDN live stream. Agora recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose option 3, 4, or 5: + + - 1: (Default) Mono. + - 2: Stereo. + - 3: Three audio channels. + - 4: Four audio channels. + - 5: Five audio channels. + */ + int audioChannels; + /** Self-defined audio codec profile: #AUDIO_CODEC_PROFILE_TYPE. + */ + + AUDIO_CODEC_PROFILE_TYPE audioCodecProfile; + + + LiveTranscoding() + : width(360) + , height(640) + , videoBitrate(400) + , videoFramerate(15) + , lowLatency(false) + , videoGop(30) + , videoCodecProfile(VIDEO_CODEC_PROFILE_HIGH) + , backgroundColor(0x000000) + , userCount(0) + , transcodingUsers(NULL) + , transcodingExtraInfo(NULL) + , metadata(NULL) + , watermark(NULL) + , backgroundImage(NULL) + , audioSampleRate(AUDIO_SAMPLE_RATE_48000) + , audioBitrate(48) + , audioChannels(1) + , audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC) + {} +} LiveTranscoding; + + /** Camera capturer configuration. + */ + struct CameraCapturerConfiguration{ + + /** Camera capturer preference settings. See: #CAPTURER_OUTPUT_PREFERENCE. */ + CAPTURER_OUTPUT_PREFERENCE preference; + #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) + /** Camera direction settings (for Android/iOS only). See: #CAMERA_DIRECTION. */ + CAMERA_DIRECTION cameraDirection; + #endif + }; + +/** Configuration of the imported live broadcast voice or video stream. + */ +struct InjectStreamConfig { + /** Width of the added stream in the live broadcast. The default value is 0 (same width as the original stream). + */ + int width; + /** Height of the added stream in the live broadcast. The default value is 0 (same height as the original stream). + */ + int height; + /** Video GOP of the added stream in the live broadcast in frames. The default value is 30 fps. + */ + int videoGop; + /** Video frame rate of the added stream in the live broadcast. The default value is 15 fps. + */ + int videoFramerate; + /** Video bitrate of the added stream in the live broadcast. The default value is 400 Kbps. + + @note The setting of the video bitrate is closely linked to the resolution. If the video bitrate you set is beyond a reasonable range, the SDK sets it within a reasonable range. + */ + int videoBitrate; + /** Audio-sample rate of the added stream in the live broadcast: #AUDIO_SAMPLE_RATE_TYPE. The default value is 48000 Hz. + + @note We recommend setting the default value. + */ + AUDIO_SAMPLE_RATE_TYPE audioSampleRate; + /** Audio bitrate of the added stream in the live broadcast. The default value is 48. + + @note We recommend setting the default value. + */ + int audioBitrate; + /** Audio channels in the live broadcast. + + - 1: (Default) Mono + - 2: Two-channel stereo + + @note We recommend setting the default value. + */ + int audioChannels; + + // width / height default set to 0 means pull the stream with its original resolution + InjectStreamConfig() + : width(0) + , height(0) + , videoGop(30) + , videoFramerate(15) + , videoBitrate(400) + , audioSampleRate(AUDIO_SAMPLE_RATE_48000) + , audioBitrate(48) + , audioChannels(1) + {} +}; +/** The definition of ChannelMediaInfo. + */ +struct ChannelMediaInfo { + /** The channel name. + */ + const char* channelName; + /** The token that enables the user to join the channel. + */ + const char* token; + /** The user ID. + */ + uid_t uid; +}; + +/** The definition of ChannelMediaRelayConfiguration. + */ +struct ChannelMediaRelayConfiguration { + /** Pointer to the information of the source channel: ChannelMediaInfo. It contains the following members: + * - `channelName`: The name of the source channel. The default value is `NULL`, which means the SDK applies the name of the current channel. + * - `uid`: ID of the broadcaster whose media stream you want to relay. The default value is 0, which means the SDK generates a random UID. You must set it as 0. + * - `token`: The token for joining the source channel. It is generated with the `channelName` and `uid` you set in `srcInfo`. + * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID. + * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`, and the `uid` must be set as 0. + */ + ChannelMediaInfo *srcInfo; + /** Pointer to the information of the destination channel: ChannelMediaInfo. It contains the following members: + * - `channelName`: The name of the destination channel. + * - `uid`: ID of the broadcaster in the destination channel. The value ranges from 0 to (232-1). To avoid UID conflicts, this `uid` must be different from any other UIDs in the destination channel. The default value is 0, which means the SDK generates a random UID. + * - `token`: The token for joining the destination channel. It is generated with the `channelName` and `uid` you set in `destInfos`. + * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID. + * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`. + */ + ChannelMediaInfo *destInfos; + /** The number of destination channels. The default value is 0, and the + * value range is [0,4). Ensure that the value of this parameter + * corresponds to the number of ChannelMediaInfo structs you define in + * `destInfos`. + */ + int destCount; + + ChannelMediaRelayConfiguration() + : srcInfo(nullptr) + , destInfos(nullptr) + , destCount(0) + {} +}; + +/** **DEPRECATED** Lifecycle of the CDN live video stream. +*/ +enum RTMP_STREAM_LIFE_CYCLE_TYPE +{ + /** Bind to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds. + */ + RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1, + /** Bind to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately. + */ + RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2, +}; + +/** Content hints for screen sharing. +*/ +enum VideoContentHint +{ + /** (Default) No content hint. + */ + CONTENT_HINT_NONE, + /** Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game. + */ + CONTENT_HINT_MOTION, + /** Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slide, or text. + */ + CONTENT_HINT_DETAILS +}; + +/** The relative location of the region to the screen or window. + */ +struct Rectangle +{ + /** The horizontal offset from the top-left corner. + */ + int x; + /** The vertical offset from the top-left corner. + */ + int y; + /** The width of the region. + */ + int width; + /** The height of the region. + */ + int height; + + Rectangle(): x(0), y(0), width(0), height(0) {} + Rectangle(int xx, int yy, int ww, int hh): x(xx), y(yy), width(ww), height(hh) {} +}; + +/** **DEPRECATED** Definition of the rectangular region. */ +typedef struct Rect { + /** Y-axis of the top line. + */ + int top; + /** X-axis of the left line. + */ + int left; + /** Y-axis of the bottom line. + */ + int bottom; + /** X-axis of the right line. + */ + int right; + + Rect(): top(0), left(0), bottom(0), right(0) {} + Rect(int t, int l, int b, int r): top(t), left(l), bottom(b), right(r) {} +} Rect; + +/** The options of the watermark image to be added. */ +typedef struct WatermarkOptions { + /** Sets whether or not the watermark image is visible in the local video preview: + * - true: (Default) The watermark image is visible in preview. + * - false: The watermark image is not visible in preview. + */ + bool visibleInPreview; + /** + * The watermark position in the landscape mode. See Rectangle. + * For detailed information on the landscape mode, see the advanced guide *Video Rotation*. + */ + Rectangle positionInLandscapeMode; + /** + * The watermark position in the portrait mode. See Rectangle. + * For detailed information on the portrait mode, see the advanced guide *Video Rotation*. + */ + Rectangle positionInPortraitMode; + + WatermarkOptions() + : visibleInPreview(true) + , positionInLandscapeMode(0, 0, 0, 0) + , positionInPortraitMode(0, 0, 0, 0) + {} +} WatermarkOptions; + +/** Screen sharing encoding parameters. +*/ +struct ScreenCaptureParameters +{ + /** The maximum encoding dimensions of the shared region in terms of width * height. + + The default value is 1920 * 1080 pixels, that is, 2073600 pixels. Agora uses the value of this parameter to calculate the charges. + + If the aspect ratio is different between the encoding dimensions and screen dimensions, Agora applies the following algorithms for encoding. Suppose the encoding dimensions are 1920 x 1080: + + - If the value of the screen dimensions is lower than that of the encoding dimensions, for example, 1000 * 1000, the SDK uses 1000 * 1000 for encoding. + - If the value of the screen dimensions is higher than that of the encoding dimensions, for example, 2000 * 1500, the SDK uses the maximum value under 1920 * 1080 with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 * 1080. + */ + VideoDimensions dimensions; + /** The frame rate (fps) of the shared region. + + The default value is 5. We do not recommend setting this to a value greater than 15. + */ + int frameRate; + /** The bitrate (Kbps) of the shared region. + + The default value is 0 (the SDK works out a bitrate according to the dimensions of the current screen). + */ + int bitrate; + /** Sets whether or not to capture the mouse for screen sharing: + + - true: (Default) Capture the mouse. + - false: Do not capture the mouse. + */ + bool captureMouseCursor; + + ScreenCaptureParameters() : dimensions(1920, 1080), frameRate(5), bitrate(STANDARD_BITRATE), captureMouseCursor(true) {} + ScreenCaptureParameters(const VideoDimensions& d, int f, int b, bool c) : dimensions(d), frameRate(f), bitrate(b), captureMouseCursor(c) {} + ScreenCaptureParameters(int width, int height, int f, int b, bool c) : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(c) {} +}; + +/** Video display settings of the VideoCanvas class. +*/ +struct VideoCanvas +{ + /** Video display window (view). + */ + view_t view; + /** The rendering mode of the video view. See RENDER_MODE_TYPE + */ + int renderMode; + /** The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @note + - The default value is the empty string "". Use the default value if the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IRtcEngine class. The `VideoCanvas` struct defines the video canvas of the user in the channel. + - If the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IChannel class, set this parameter as the `channelId` of the `IChannel` object. The `VideoCanvas` struct defines the video canvas of the user in the channel with the specified channel ID. + */ + char channelId[MAX_CHANNEL_ID_LENGTH]; + /** The user ID. */ + uid_t uid; + void *priv; // private data (underlying video engine denotes it) + /** The mirror mode of the video view. See VIDEO_MIRROR_MODE_TYPE + @note + - For the mirror mode of the local video view: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. + - For the mirror mode of the remote video view: The SDK disables the mirror mode by default. + */ + VIDEO_MIRROR_MODE_TYPE mirrorMode; + + VideoCanvas() + : view(NULL) + , renderMode(RENDER_MODE_HIDDEN) + , uid(0) + , priv(NULL) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + { + channelId[0] = '\0'; + } + VideoCanvas(view_t v, int m, uid_t u) + : view(v) + , renderMode(m) + , uid(u) + , priv(NULL) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + { + channelId[0] = '\0'; + } + VideoCanvas(view_t v, int m, const char *ch, uid_t u) + : view(v) + , renderMode(m) + , uid(u) + , priv(NULL) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + { + strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH); + channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0'; + } + VideoCanvas(view_t v, int rm, uid_t u, VIDEO_MIRROR_MODE_TYPE mm) + : view(v) + , renderMode(rm) + , uid(u) + , priv(NULL) + , mirrorMode(mm) + { + channelId[0] = '\0'; + } + VideoCanvas(view_t v, int rm, const char *ch, uid_t u, VIDEO_MIRROR_MODE_TYPE mm) + : view(v) + , renderMode(rm) + , uid(u) + , priv(NULL) + , mirrorMode(mm) + { + strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH); + channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0'; + } +}; + +/** Image enhancement options. +*/ +struct BeautyOptions { + /** The contrast level, used with the @p lightening parameter. + */ + enum LIGHTENING_CONTRAST_LEVEL + { + /** Low contrast level. */ + LIGHTENING_CONTRAST_LOW = 0, + /** (Default) Normal contrast level. */ + LIGHTENING_CONTRAST_NORMAL, + /** High contrast level. */ + LIGHTENING_CONTRAST_HIGH + }; + +/** The contrast level, used with the @p lightening parameter. +*/ +LIGHTENING_CONTRAST_LEVEL lighteningContrastLevel; + +/** The brightness level. The value ranges from 0.0 (original) to 1.0. */ +float lighteningLevel; + +/** The sharpness level. The value ranges between 0 (original) and 1. This parameter is usually used to remove blemishes. + */ +float smoothnessLevel; + +/** The redness level. The value ranges between 0 (original) and 1. This parameter adjusts the red saturation level. +*/ +float rednessLevel; + +BeautyOptions(LIGHTENING_CONTRAST_LEVEL contrastLevel, float lightening, float smoothness, float redness) + : lighteningLevel(lightening), + smoothnessLevel(smoothness), + rednessLevel(redness), + lighteningContrastLevel(contrastLevel) {} + +BeautyOptions() + : lighteningLevel(0), + smoothnessLevel(0), + rednessLevel(0), + lighteningContrastLevel(LIGHTENING_CONTRAST_NORMAL) {} +}; + +/** + * The UserInfo struct. + */ +struct UserInfo { + /** + * The user ID. + */ + uid_t uid; + /** + * The user account. + */ + char userAccount[MAX_USER_ACCOUNT_LENGTH]; + UserInfo() + : uid(0) { + userAccount[0] = '\0'; + } +}; + +/** + * IP areas. + */ +enum AREA_CODE { + /** + * Mainland China. + */ + AREA_CODE_CN = (1 << 0), + /** + * North America. + */ + AREA_CODE_NA = (1 << 1), + /** + * Europe. + */ + AREA_CODE_EUR = (1 << 2), + /** + * Asia, excluding mainland China. + */ + AREA_CODE_AS = (1 << 3), + /** + * (Default) Global. + */ + AREA_CODE_GLOBAL = (0xFFFFFFFF) +}; + +enum ENCRYPTION_CONFIG { + /** + * - 1: Force set master key and mode; + * - 0: Not force set, checking whether encryption plugin exists + */ + ENCRYPTION_FORCE_SETTING = (1 << 0), + /** + * - 1: Force not encrypting packet; + * - 0: Not force encrypting; + */ + ENCRYPTION_FORCE_DISABLE_PACKET = (1 << 1) +}; +/** Definition of IPacketObserver. +*/ +class IPacketObserver +{ +public: +/** Definition of Packet. + */ + struct Packet + { + /** Buffer address of the sent or received data. + * @note Agora recommends that the value of buffer is more than 2048 bytes, otherwise, you may meet undefined behaviors such as a crash. + */ + const unsigned char* buffer; + /** Buffer size of the sent or received data. + */ + unsigned int size; + }; + /** Occurs when the local user sends an audio packet. + + @param packet The sent audio packet. See Packet. + @return + - true: The audio packet is sent successfully. + - false: The audio packet is discarded. + */ + virtual bool onSendAudioPacket(Packet& packet) = 0; + /** Occurs when the local user sends a video packet. + + @param packet The sent video packet. See Packet. + @return + - true: The video packet is sent successfully. + - false: The video packet is discarded. + */ + virtual bool onSendVideoPacket(Packet& packet) = 0; + /** Occurs when the local user receives an audio packet. + + @param packet The received audio packet. See Packet. + @return + - true: The audio packet is received successfully. + - false: The audio packet is discarded. + */ + virtual bool onReceiveAudioPacket(Packet& packet) = 0; + /** Occurs when the local user receives a video packet. + + @param packet The received video packet. See Packet. + @return + - true: The video packet is received successfully. + - false: The video packet is discarded. + */ + virtual bool onReceiveVideoPacket(Packet& packet) = 0; +}; + +/** The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application. The application inherits the methods of this interface class to retrieve these callbacks. + + All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling blocking APIs, such as the SendMessage method. Otherwise, the SDK may not work properly. + */ +class IRtcEngineEventHandler +{ +public: + virtual ~IRtcEngineEventHandler() {} + + /** Reports a warning during SDK runtime. + + In most cases, the application can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. For example, when losing connection with the server, the SDK may report #WARN_LOOKUP_CHANNEL_TIMEOUT and automatically try to reconnect. + + @param warn Warning code: #WARN_CODE_TYPE. + @param msg Pointer to the warning message. + */ + virtual void onWarning(int warn, const char* msg) { + (void)warn; + (void)msg; + } + + /** Reports an error during SDK runtime. + + In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue. + + For example, the SDK reports an #ERR_START_CALL error when failing to initialize a call. The application informs the user that the call initialization failed and invokes the \ref IRtcEngine::leaveChannel "leaveChannel" method to leave the channel. + + @param err Error code: #ERROR_CODE_TYPE. + @param msg Pointer to the error message. + */ + virtual void onError(int err, const char* msg) { + (void)err; + (void)msg; + } + + /** Occurs when a user joins a channel. + + This callback notifies the application that a user joins a specified channel when the application calls the \ref IRtcEngine::joinChannel "joinChannel" method. + + The channel name assignment is based on @p channelName specified in the \ref IRtcEngine::joinChannel "joinChannel" method. + + If the @p uid is not specified in the *joinChannel* method, the server automatically assigns a @p uid. + + @param channel Pointer to the channel name. + @param uid User ID of the user joining the channel. + @param elapsed Time elapsed (ms) from the user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + (void)channel; + (void)uid; + (void)elapsed; + } + + /** Occurs when a user rejoins the channel after disconnection due to network problems. + + When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. + + @param channel Pointer to the channel name. + @param uid User ID of the user rejoining the channel. + @param elapsed Time elapsed (ms) from starting to reconnect until the SDK triggers this callback. + */ + virtual void onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + (void)channel; + (void)uid; + (void)elapsed; + } + + /** Occurs when a user leaves the channel. + + This callback notifies the application that a user leaves the channel when the application calls the \ref IRtcEngine::leaveChannel "leaveChannel" method. + + The application retrieves information, such as the call duration and statistics. + + @param stats Pointer to the statistics of the call: RtcStats. + */ + virtual void onLeaveChannel(const RtcStats& stats) { + (void)stats; + } + + /** Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa. + + This callback notifies the application of a user role switch when the application calls the \ref IRtcEngine::setClientRole "setClientRole" method. + + The SDK triggers this callback when the local user switches the user role by calling the \ref agora::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel. + @param oldRole Role that the user switches from: #CLIENT_ROLE_TYPE. + @param newRole Role that the user switches to: #CLIENT_ROLE_TYPE. + */ + virtual void onClientRoleChanged(CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) { + } + + /** Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel. + + - Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users. + - Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend limiting the number of hosts to 17. + + The SDK triggers this callback under one of the following circumstances: + - A remote user/host joins the channel by calling the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + - A remote user switches the user role to the host by calling the \ref agora::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel. + - A remote user/host rejoins the channel after a network interruption. + - The host injects an online media stream into the channel by calling the \ref agora::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method. + + @note In the Live-broadcast profile: + - The host receives this callback when another host joins the channel. + - The audience in the channel receives this callback when a new host joins the channel. + - When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams. + + @param uid User ID of the user or host joining the channel. + @param elapsed Time delay (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onUserJoined(uid_t uid, int elapsed) { + (void)uid; + (void)elapsed; + } + + /** Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + + Reasons why the user is offline: + + - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel. + - Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using the Agora RTM SDK for more reliable offline detection. + + @param uid User ID of the user leaving the channel or going offline. + @param reason Reason why the user is offline: #USER_OFFLINE_REASON_TYPE. + */ + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + (void)uid; + (void)reason; + } + + /** Reports the last mile network quality of the local user once every two seconds before the user joins the channel. + + Last mile refers to the connection between the local device and Agora's edge server. After the application calls the \ref IRtcEngine::enableLastmileTest "enableLastmileTest" method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel. + + @param quality The last mile network quality: #QUALITY_TYPE. + */ + virtual void onLastmileQuality(int quality) { + (void)quality; + } + + /** Reports the last-mile network probe result. + + The SDK triggers this callback within 30 seconds after the app calls the \ref agora::rtc::IRtcEngine::startLastmileProbeTest "startLastmileProbeTest" method. + + @param result The uplink and downlink last-mile network probe test result. See LastmileProbeResult. + */ + virtual void onLastmileProbeResult(const LastmileProbeResult& result) { + (void)result; + } + + /** **DEPRECATED** Occurs when the connection between the SDK and the server is interrupted. + + Deprecated as of v2.3.2. Replaced by the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED)" callback. + + The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established. + + After triggering this callback, the SDK tries reconnecting to the server. You can use this callback to implement pop-up reminders. + + This callback is different from \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost": + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. + + If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. + + */ + virtual void onConnectionInterrupted() {} + + /** Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. + + The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the \ref IRtcEngine::joinChannel "joinChannel" method, whether or not it is in the channel. + + This callback is different from \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted": + + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. + + If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. + + */ + virtual void onConnectionLost() {} + + /** **DEPRECATED** Deprecated as of v2.3.2. Replaced by the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_FAILED, CONNECTION_CHANGED_BANNED_BY_SERVER)" callback. + + Occurs when your connection is banned by the Agora Server. + */ + virtual void onConnectionBanned() {} + + /** Occurs when a method is executed by the SDK. + + @param err The error code (#ERROR_CODE_TYPE) returned by the SDK when a method call fails. If the SDK returns 0, then the method call is successful. + @param api Pointer to the method executed by the SDK. + @param result Pointer to the result of the method call. + */ + virtual void onApiCallExecuted(int err, const char* api, const char* result) { + (void)err; + (void)api; + (void)result; + } + + /** Occurs when the token expires. + + After a token is specified by calling the \ref IRtcEngine::joinChannel "joinChannel" method, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server. + + This callback notifies the app to generate a new token and call joinChannel to rejoin the channel with the new token. + */ + virtual void onRequestToken() { + } + + /** Occurs when the token expires in 30 seconds. + + The user becomes offline if the token used in the \ref IRtcEngine::joinChannel "joinChannel" method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the \ref IRtcEngine::renewToken "renewToken" method to pass the new token to the SDK. + + @param token Pointer to the token that expires in 30 seconds. + */ + virtual void onTokenPrivilegeWillExpire(const char* token) { + (void)token; + } + + /** **DEPRECATED** Reports the statistics of the audio stream from each remote user/host. + + Deprecated as of v2.3.2. Use the \ref agora::rtc::IRtcEngineEventHandler::onRemoteAudioStats "onRemoteAudioStats" callback instead. + + The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple users/hosts sending audio streams, the SDK triggers this callback as many times. + + @param uid User ID of the speaker. + @param quality Audio quality of the user: #QUALITY_TYPE. + @param delay Time delay (ms) of sending the audio packet from the sender to the receiver, including the time delay of audio sampling pre-processing, transmission, and the jitter buffer. + @param lost Packet loss rate (%) of the audio packet sent from the sender to the receiver. + */ + virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) { + (void)uid; + (void)quality; + (void)delay; + (void)lost; + } + + /** Reports the statistics of the current call. + + The SDK triggers this callback once every two seconds after the user joins the channel. + + @param stats Statistics of the IRtcEngine: RtcStats. + */ + virtual void onRtcStats(const RtcStats& stats) { + (void)stats; + } + + /** Reports the last mile network quality of each user in the channel once every two seconds. + + Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times. + + @param uid User ID. The network quality of the user with this @p uid is reported. If @p uid is 0, the local network quality is reported. + @param txQuality Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. @p txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 * 480 and a frame rate of 15 fps in the Live-broadcast profile, but may be inadequate for resolutions higher than 1280 * 720. See #QUALITY_TYPE. + @param rxQuality Downlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE. + */ + virtual void onNetworkQuality(uid_t uid, int txQuality, int rxQuality) { + (void)uid; + (void)txQuality; + (void)rxQuality; + } + + /** Reports the statistics of the local video stream. + * + * The SDK triggers this callback once every two seconds for each + * user/host. If there are multiple users/hosts in the channel, the SDK + * triggers this callback as many times. + * + * @note + * If you have called the + * \ref agora::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" + * method, the \ref onLocalVideoStats() "onLocalVideoStats" callback + * reports the statistics of the high-video + * stream (high bitrate, and high-resolution video stream). + * + * @param stats Statistics of the local video stream. See LocalVideoStats. + */ + virtual void onLocalVideoStats(const LocalVideoStats& stats) { + (void)stats; + } + + /** Reports the statistics of the video stream from each remote user/host. + * + * The SDK triggers this callback once every two seconds for each remote + * user/host. If a channel includes multiple remote users, the SDK + * triggers this callback as many times. + * + * @param stats Statistics of the remote video stream. See + * RemoteVideoStats. + */ + virtual void onRemoteVideoStats(const RemoteVideoStats& stats) { + (void)stats; + } + + /** Reports the statistics of the local audio stream. + * + * The SDK triggers this callback once every two seconds. + * + * @param stats The statistics of the local audio stream. + * See LocalAudioStats. + */ + virtual void onLocalAudioStats(const LocalAudioStats& stats) { + (void)stats; + } + + /** Reports the statistics of the audio stream from each remote user/host. + + This callback replaces the \ref agora::rtc::IRtcEngineEventHandler::onAudioQuality "onAudioQuality" callback. + + The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. + + @param stats Pointer to the statistics of the received remote audio streams. See RemoteAudioStats. + */ + virtual void onRemoteAudioStats(const RemoteAudioStats& stats) { + (void)stats; + } + + /** Occurs when the local audio state changes. + * + * This callback indicates the state change of the local audio stream, + * including the state of the audio recording and encoding, and allows + * you to troubleshoot issues when exceptions occur. + * + * @note + * When the state is #LOCAL_AUDIO_STREAM_STATE_FAILED (3), see the `error` + * parameter for details. + * + * @param state State of the local audio. See #LOCAL_AUDIO_STREAM_STATE. + * @param error The error information of the local audio. + * See #LOCAL_AUDIO_STREAM_ERROR. + */ + virtual void onLocalAudioStateChanged(LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) { + (void)state; + (void)error; + } + + /** Occurs when the remote audio state changes. + + This callback indicates the state change of the remote audio stream. + @note This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + + @param uid ID of the remote user whose audio state changes. + @param state State of the remote audio. See #REMOTE_AUDIO_STATE. + @param reason The reason of the remote audio state change. + See #REMOTE_AUDIO_STATE_REASON. + @param elapsed Time elapsed (ms) from the local user calling the + \ref IRtcEngine::joinChannel "joinChannel" method until the SDK + triggers this callback. + */ + virtual void onRemoteAudioStateChanged(uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) { + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + + /** Reports which users are speaking, the speakers' volume and whether the local user is speaking. + + This callback reports the IDs and volumes of the loudest speakers (at most 3 users) at the moment in the channel, and whether the local user is speaking. + + By default, this callback is disabled. You can enable it by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. + Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not. + + The SDK triggers two independent `onAudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers. + For more information, see the detailed parameter descriptions. + + @note + - To enable the voice activity detection of the local user, ensure that you set `report_vad`(true) in the `enableAudioVolumeIndication` method. + - Calling the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method affects the SDK's behavior: + - If the local user calls the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method, the SDK stops triggering the local user's callback. + - 20 seconds after a remote speaker calls the *muteLocalAudioStream* method, the remote speakers' callback excludes this remote user's information; 20 seconds after all remote users call the *muteLocalAudioStream* method, the SDK stops triggering the remote speakers' callback. + - An empty @p speakers array in the *onAudioVolumeIndication* callback suggests that no remote user is speaking at the moment. + + @param speakers A pointer to AudioVolumeInfo: + - In the local user's callback, this struct contains the following members: + - `uid` = 0, + - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and + - `vad`, which reports the voice activity status of the local user. + - In the remote speakers' callback, this array contains the following members: + - `uid` of the remote speaker, + - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and + - `vad` = 0. + + An empty speakers array in the callback indicates that no remote user is speaking at the moment. + @param speakerNumber Total number of speakers. The value range is [0, 3]. + - In the local user’s callback, `speakerNumber` = 1, regardless of whether the local user speaks or not. + - In the remote speakers' callback, the callback reports the IDs and volumes of the three loudest speakers when there are more than three remote users in the channel, and `speakerNumber` = 3. + @param totalVolume Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume). + - In the local user’s callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of the local user. + - In the remote speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of all the remote speakers. + */ + virtual void onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume) { + (void)speakers; + (void)speakerNumber; + (void)totalVolume; + } + + /** Reports which user is the loudest speaker. + + If the user enables the audio volume indication by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method, this callback returns the @p uid of the active speaker detected by the audio volume detection module of the SDK. + + @note + - To receive this callback, you need to call the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. + - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. + + @param uid User ID of the active speaker. A @p uid of 0 represents the local user. + */ + virtual void onActiveSpeaker(uid_t uid) { + (void)uid; + } + + /** **DEPRECATED** Occurs when the video stops playing. + + The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing. + + Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_STOPPED(0) in the \ref agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead. + */ + virtual void onVideoStopped() {} + + /** Occurs when the first local video frame is displayed/rendered on the local video view. + + @param width Width (px) of the first local video frame. + @param height Height (px) of the first local video frame. + @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + If you call the \ref IRtcEngine::startPreview "startPreview" method before calling the *joinChannel* method, then @p elapsed is the time elapsed from calling the *startPreview* method until the SDK triggers this callback. + */ + virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) { + (void)width; + (void)height; + (void)elapsed; + } + + /** Occurs when the first remote video frame is received and decoded. + * + * @deprecated v2.9.0 + * + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STARTING (1) + * - #REMOTE_VIDEO_STATE_DECODING (2) + * + * This callback is triggered in either of the following scenarios: + * + * - The remote user joins the channel and sends the video stream. + * - The remote user stops sending the video stream and re-sends it after + * 15 seconds. Reasons for such an interruption include: + * - The remote user leaves the channel. + * - The remote user drops offline. + * - The remote user calls the + * \ref agora::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" + * method to stop sending the video stream. + * - The remote user calls the + * \ref agora::rtc::IRtcEngine::disableVideo "disableVideo" method to + * disable video. + * + * The application can configure the user view settings in this callback. + * + * @param uid User ID of the remote user sending the video stream. + * @param width Width (px) of the video stream. + * @param height Height (px) of the video stream. + * @param elapsed Time elapsed (ms) from the local user calling the + * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK + * triggers this callback. + */ + virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) { + (void)uid; + (void)width; + (void)height; + (void)elapsed; + } + + /** Occurs when the first remote video frame is rendered. + + The SDK triggers this callback when the first frame of the remote video is displayed in the user's video window. The application can retrieve the time elapsed from a user joining the channel until the first video frame is displayed. + + @param uid User ID of the remote user sending the video stream. + @param width Width (px) of the video frame. + @param height Height (px) of the video stream. + @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) { + (void)uid; + (void)width; + (void)height; + (void)elapsed; + } + + /** @deprecated This method is deprecated from v3.0.0, use the \ref agora::rtc::IRtcEngineEventHandler::onRemoteAudioStateChanged "onRemoteAudioStateChanged" callback instead. + + Occurs when a remote user's audio stream playback pauses/resumes. + + The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method. + + @note This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + + @param uid User ID of the remote user. + @param muted Whether the remote user's audio stream is muted/unmuted: + - true: Muted. + - false: Unmuted. + */ + virtual void onUserMuteAudio(uid_t uid, bool muted) { + (void)uid; + (void)muted; + } + + /** Occurs when a remote user's video stream playback pauses/resumes. + * + * You can also use the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STOPPED (0) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). + * - #REMOTE_VIDEO_STATE_DECODING (2) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). + * + * The SDK triggers this callback when the remote user stops or resumes + * sending the video stream by calling the + * \ref agora::rtc::IRtcEngine::muteLocalVideoStream + * "muteLocalVideoStream" method. + * + * @note This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * + * @param uid User ID of the remote user. + * @param muted Whether the remote user's video stream playback is + * paused/resumed: + * - true: Paused. + * - false: Resumed. + */ + virtual void onUserMuteVideo(uid_t uid, bool muted) { + (void)uid; + (void)muted; + } + + /** Occurs when a specific remote user enables/disables the video + * module. + * + * @deprecated v2.9.0 + * + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STOPPED (0) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). + * - #REMOTE_VIDEO_STATE_DECODING (2) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). + * + * Once the video module is disabled, the remote user can only use a + * voice call. The remote user cannot send or receive any video from + * other users. + * + * The SDK triggers this callback when the remote user enables or disables + * the video module by calling the + * \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" or + * \ref agora::rtc::IRtcEngine::disableVideo "disableVideo" method. + * + * @note This callback returns invalid when the number of users in a + * channel exceeds 20. + * + * @param uid User ID of the remote user. + * @param enabled Whether the remote user enables/disables the video + * module: + * - true: Enable. The remote user can enter a video session. + * - false: Disable. The remote user can only enter a voice session, and + * cannot send or receive any video stream. + */ + virtual void onUserEnableVideo(uid_t uid, bool enabled) { + (void)uid; + (void)enabled; + } + + /** Occurs when the audio device state changes. + + This callback notifies the application that the system's audio device state is changed. For example, a headset is unplugged from the device. + + @param deviceId Pointer to the device ID. + @param deviceType Device type: #MEDIA_DEVICE_TYPE. + @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE. + */ + virtual void onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) { + (void)deviceId; + (void)deviceType; + (void)deviceState; + } + + /** Occurs when the volume of the playback device, microphone, or application changes. + + @param deviceType Device type: #MEDIA_DEVICE_TYPE. + @param volume Volume of the device. The value ranges between 0 and 255. + @param muted + - true: The audio device is muted. + - false: The audio device is not muted. + */ + virtual void onAudioDeviceVolumeChanged(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) { + (void)deviceType; + (void)volume; + (void)muted; + } + + /** **DEPRECATED** Occurs when the camera turns on and is ready to capture the video. + + If the camera fails to turn on, fix the error reported in the \ref IRtcEngineEventHandler::onError "onError" callback. + + Deprecated as of v2.4.1. Use #LOCAL_VIDEO_STREAM_STATE_CAPTURING (1) in the \ref agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead. + */ + virtual void onCameraReady() {} + + /** Occurs when the camera focus area changes. + + The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocusPositionInPreview method. + + @note This callback is for Android and iOS only. + + @param x x coordinate of the changed camera focus area. + @param y y coordinate of the changed camera focus area. + @param width Width of the changed camera focus area. + @param height Height of the changed camera focus area. + */ + virtual void onCameraFocusAreaChanged(int x, int y, int width, int height) { + (void)x; + (void)y; + (void)width; + (void)height; + } +#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) + /** + * Reports the face detection result of the local user. Applies to Android and iOS only. + * @since v3.0.1 + * + * Once you enable face detection by calling \ref IRtcEngine::enableFaceDetection "enableFaceDetection"(true), you can get the following information on the local user in real-time: + * - The width and height of the local video. + * - The position of the human face in the local video. + * - The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face. + * + * @note + * - If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device. + * - The SDK stops triggering this callback when a human face is in close proximity to the screen. + * - On Android, the `distance` value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for + * accurate calculation. + * @param imageWidth The width (px) of the local video. + * @param imageHeight The height (px) of the local video. + * @param vecRectangle The position and size of the human face on the local video: + * - `x`: The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, + * the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin. + * - `y`: The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, + * the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin. + * - `width`: The width (px) of the human face in the captured video. + * - `height`: The height (px) of the human face in the captured video. + * @param vecDistance The distance (cm) between the human face and the screen. + * @param numFaces The number of faces detected. If the value is 0, it means that no human face is detected. + */ + virtual void onFacePositionChanged(int imageWidth, int imageHeight, Rectangle* vecRectangle, int* vecDistance, int numFaces){ + (void)imageWidth; + (void)imageHeight; + (void)vecRectangle; + (void)vecDistance; + (void)numFaces; + } +#endif + /** Occurs when the camera exposure area changes. + + The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method. + + @note This callback is for Android and iOS only. + + @param x x coordinate of the changed camera exposure area. + @param y y coordinate of the changed camera exposure area. + @param width Width of the changed camera exposure area. + @param height Height of the changed camera exposure area. + */ + virtual void onCameraExposureAreaChanged(int x, int y, int width, int height) { + (void)x; + (void)y; + (void)width; + (void)height; + } + + /** Occurs when the audio mixing file playback finishes. + + **DEPRECATED** use onAudioMixingStateChanged instead. + + You can start an audio mixing file playback by calling the \ref IRtcEngine::startAudioMixing "startAudioMixing" method. The SDK triggers this callback when the audio mixing file playback finishes. + + If the *startAudioMixing* method call fails, an error code returns in the \ref IRtcEngineEventHandler::onError "onError" callback. + + */ + virtual void onAudioMixingFinished() { + } + + /** Occurs when the state of the local user's audio mixing file changes. + + When you call the \ref IRtcEngine::startAudioMixing "startAudioMixing" method and the state of audio mixing file changes, the SDK triggers this callback. + - When the audio mixing file plays, pauses playing, or stops playing, this callback returns 710, 711, or 713 in @p state, and 0 in @p errorCode. + - When exceptions occur during playback, this callback returns 714 in @p state and an error in @p errorCode. + - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701. + + @param state The state code. See #AUDIO_MIXING_STATE_TYPE. + @param errorCode The error code. See #AUDIO_MIXING_ERROR_TYPE. + */ + virtual void onAudioMixingStateChanged(AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode){ + } + /** Occurs when a remote user starts audio mixing. + + When a remote user calls \ref IRtcEngine::startAudioMixing "startAudioMixing" to play the background music, the SDK reports this callback. + */ + virtual void onRemoteAudioMixingBegin() { + } + /** Occurs when a remote user finishes audio mixing. + */ + virtual void onRemoteAudioMixingEnd() { + } + + /** Occurs when the local audio effect playback finishes. + + The SDK triggers this callback when the local audio effect file playback finishes. + + @param soundId ID of the local audio effect. Each local audio effect has a unique ID. + */ + virtual void onAudioEffectFinished(int soundId) { + } + + + /** + Occurs when the SDK decodes the first remote audio frame for playback. + + @deprecated v3.0.0 + + This callback is deprecated. Use `onRemoteAudioStateChanged` instead. + + This callback is triggered in either of the following scenarios: + + - The remote user joins the channel and sends the audio stream. + - The remote user stops sending the audio stream and re-sends it after 15 seconds. Reasons for such an interruption include: + - The remote user leaves channel. + - The remote user drops offline. + - The remote user calls the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method to stop sending the local audio stream. + - The remote user calls the \ref agora::rtc::IRtcEngine::disableAudio "disableAudio" method to disable audio. + + @param uid User ID of the remote user sending the audio stream. + @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onFirstRemoteAudioDecoded(uid_t uid, int elapsed) { + (void)uid; + (void)elapsed; + } + + /** Occurs when the video device state changes. + + @note On a Windows device with an external camera for video capturing, the video disables once the external camera is unplugged. + + @param deviceId Pointer to the device ID of the video device that changes state. + @param deviceType Device type: #MEDIA_DEVICE_TYPE. + @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE. + */ + virtual void onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) { + (void)deviceId; + (void)deviceType; + (void)deviceState; + } + + /** Occurs when the local video stream state changes. + + This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. + + @note For some device models, the SDK will not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment. + + @param localVideoState State type #LOCAL_VIDEO_STREAM_STATE. When the state is LOCAL_VIDEO_STREAM_STATE_FAILED (3), see the `error` parameter for details. + @param error The detailed error information: #LOCAL_VIDEO_STREAM_ERROR. + */ + virtual void onLocalVideoStateChanged(LOCAL_VIDEO_STREAM_STATE localVideoState, LOCAL_VIDEO_STREAM_ERROR error) { + (void)localVideoState; + (void)error; + } + + /** Occurs when the video size or rotation of a specified user changes. + + @param uid User ID of the remote user or local user (0) whose video size or rotation changes. + @param width New width (pixels) of the video. + @param height New height (pixels) of the video. + @param rotation New rotation of the video [0 to 360). + */ + virtual void onVideoSizeChanged(uid_t uid, int width, int height, int rotation) { + (void)uid; + (void)width; + (void)height; + (void)rotation; + } + /** Occurs when the remote video state changes. + @note This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + + @param uid ID of the remote user whose video state changes. + @param state State of the remote video. See #REMOTE_VIDEO_STATE. + @param reason The reason of the remote video state change. See + #REMOTE_VIDEO_STATE_REASON. + @param elapsed Time elapsed (ms) from the local user calling the + \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method until the + SDK triggers this callback. + */ + virtual void onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) { + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + + /** Occurs when a specified remote user enables/disables the local video + * capturing function. + * + * @deprecated v2.9.0 + * + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STOPPED (0) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). + * - #REMOTE_VIDEO_STATE_DECODING (2) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). + * + * This callback is only applicable to the scenario when the user only + * wants to watch the remote video without sending any video stream to the + * other user. + * + * The SDK triggers this callback when the remote user resumes or stops + * capturing the video stream by calling the + * \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method. + * + * @param uid User ID of the remote user. + * @param enabled Whether the specified remote user enables/disables the + * local video capturing function: + * - true: Enable. Other users in the channel can see the video of this + * remote user. + * - false: Disable. Other users in the channel can no longer receive the + * video stream from this remote user, while this remote user can still + * receive the video streams from other users. + */ + virtual void onUserEnableLocalVideo(uid_t uid, bool enabled) { + (void)uid; + (void)enabled; + } + +// virtual void onStreamError(int streamId, int code, int parameter, const char* message, size_t length) {} + /** Occurs when the local user receives the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param data Pointer to the data received by the local user. + @param length Length of the data in bytes. + */ + virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length) { + (void)uid; + (void)streamId; + (void)data; + (void)length; + } + + /** Occurs when the local user does not receive the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param code Error code: #ERROR_CODE_TYPE. + @param missed Number of lost messages. + @param cached Number of incoming cached messages when the data stream is interrupted. + */ + virtual void onStreamMessageError(uid_t uid, int streamId, int code, int missed, int cached) { + (void)uid; + (void)streamId; + (void)code; + (void)missed; + (void)cached; + } + + /** Occurs when the media engine loads.*/ + virtual void onMediaEngineLoadSuccess() { + } + /** Occurs when the media engine call starts.*/ + virtual void onMediaEngineStartCallSuccess() { + } + + /** Occurs when the state of the media stream relay changes. + * + * The SDK returns the state of the current media relay with any error + * message. + * + * @param state The state code in #CHANNEL_MEDIA_RELAY_STATE. + * @param code The error code in #CHANNEL_MEDIA_RELAY_ERROR. + */ + virtual void onChannelMediaRelayStateChanged(CHANNEL_MEDIA_RELAY_STATE state,CHANNEL_MEDIA_RELAY_ERROR code) { + } + + /** Reports events during the media stream relay. + * + * @param code The event code in #CHANNEL_MEDIA_RELAY_EVENT. + */ + virtual void onChannelMediaRelayEvent(CHANNEL_MEDIA_RELAY_EVENT code) { + } + + /** Occurs when the engine sends the first local audio frame. + + @param elapsed Time elapsed (ms) from the local user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. + */ + virtual void onFirstLocalAudioFrame(int elapsed) { + (void)elapsed; + } + + /** Occurs when the engine receives the first audio frame from a specific remote user. + + @deprecated v3.0.0 + + This callback is deprecated. Use `onRemoteAudioStateChanged` instead. + + @param uid User ID of the remote user. + @param elapsed Time elapsed (ms) from the remote user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. + */ + virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) { + (void)uid; + (void)elapsed; + } + + /** + Occurs when the state of the RTMP streaming changes. + + The SDK triggers this callback to report the result of the local user calling the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" or \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. + + This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the *errCode* parameter. + + @param url The RTMP URL address. + @param state The RTMP streaming state. See: #RTMP_STREAM_PUBLISH_STATE. + @param errCode The detailed error information for streaming. See: #RTMP_STREAM_PUBLISH_ERROR. + */ + virtual void onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { + (void) url; + (void) state; + (void) errCode; + } + + /** @deprecated This method is deprecated, use the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback instead. + + Reports the result of calling the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. (CDN live only.) + + @param url The RTMP URL address. + @param error Error code: #ERROR_CODE_TYPE. Main errors include: + - #ERR_OK (0): The publishing succeeds. + - #ERR_FAILED (1): The publishing fails. + - #ERR_INVALID_ARGUMENT (2): Invalid argument used. If, for example, you did not call \ref agora::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" to configure LiveTranscoding before calling \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl", the SDK reports #ERR_INVALID_ARGUMENT. + - #ERR_TIMEDOUT (10): The publishing timed out. + - #ERR_ALREADY_IN_USE (19): The chosen URL address is already in use for CDN live streaming. + - #ERR_RESOURCE_LIMITED (22): The backend system does not have enough resources for the CDN live streaming. + - #ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH (130): You cannot publish an encrypted stream. + - #ERR_PUBLISH_STREAM_CDN_ERROR (151) + - #ERR_PUBLISH_STREAM_NUM_REACH_LIMIT (152) + - #ERR_PUBLISH_STREAM_NOT_AUTHORIZED (153) + - #ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR (154) + - #ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED (156) + */ + virtual void onStreamPublished(const char *url, int error) { + (void)url; + (void)error; + } + /** @deprecated This method is deprecated, use the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback instead. + + Reports the result of calling the \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. (CDN live only.) + + This callback indicates whether you have successfully removed an RTMP stream from the CDN. + + @param url The RTMP URL address. + */ + virtual void onStreamUnpublished(const char *url) { + (void)url; + } +/** Occurs when the publisher's transcoding is updated. + * + * When the `LiveTranscoding` class in the \ref agora::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information to the local host. + * + * @note If you call the `setLiveTranscoding` method to set the LiveTranscoding class for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + * + */ + virtual void onTranscodingUpdated() { + } + /** Occurs when a voice or video stream URL address is added to a live broadcast. + + @param url Pointer to the URL address of the externally injected stream. + @param uid User ID. + @param status State of the externally injected stream: #INJECT_STREAM_STATUS. + */ + virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) { + (void)url; + (void)uid; + (void)status; + } + + /** Occurs when the local audio route changes. + + The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device. + + @note This callback is for Android and iOS only. + + @param routing Audio output routing. See: #AUDIO_ROUTE_TYPE. + */ + virtual void onAudioRouteChanged(AUDIO_ROUTE_TYPE routing) { + (void)routing; + } + + /** Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve. + + If you call \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" and set *option* as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the + published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. + @note If the local stream fallbacks to the audio-only stream, the remote user receives the \ref IRtcEngineEventHandler::onUserMuteVideo "onUserMuteVideo" callback. + + @param isFallbackOrRecover Whether the published stream falls back to audio-only or switches back to the video: + - true: The published stream falls back to audio-only due to poor network conditions. + - false: The published stream switches back to the video after the network conditions improve. + */ + virtual void onLocalPublishFallbackToAudioOnly(bool isFallbackOrRecover) { + (void)isFallbackOrRecover; + } + + /** Occurs when the remote media stream falls back to audio-only stream + * due to poor network conditions or switches back to the video stream + * after the network conditions improve. + * + * If you call + * \ref IRtcEngine::setRemoteSubscribeFallbackOption + * "setRemoteSubscribeFallbackOption" and set + * @p option as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this + * callback when the remote media stream falls back to audio-only mode due + * to poor uplink conditions, or when the remote media stream switches + * back to the video after the uplink network condition improves. + * + * @note Once the remote media stream switches to the low stream due to + * poor network conditions, you can monitor the stream switch between a + * high and low stream in the RemoteVideoStats callback. + * + * @param uid ID of the remote user sending the stream. + * @param isFallbackOrRecover Whether the remotely subscribed media stream + * falls back to audio-only or switches back to the video: + * - true: The remotely subscribed media stream falls back to audio-only + * due to poor network conditions. + * - false: The remotely subscribed media stream switches back to the + * video stream after the network conditions improved. + */ + virtual void onRemoteSubscribeFallbackToAudioOnly(uid_t uid, bool isFallbackOrRecover) { + (void)uid; + (void)isFallbackOrRecover; + } + + /** Reports the transport-layer statistics of each remote audio stream. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteAudioStats() "onRemoteAudioStats" callback. + * + * This callback reports the transport-layer statistics, such as the + * packet loss rate and network time delay, once every two seconds after + * the local user receives an audio packet from a remote user. + * + * @param uid User ID of the remote user sending the audio packet. + * @param delay Network time delay (ms) from the remote user sending the + * audio packet to the local user. + * @param lost Packet loss rate (%) of the audio packet sent from the + * remote user. + * @param rxKBitRate Received bitrate (Kbps) of the audio packet sent + * from the remote user. + */ + virtual void onRemoteAudioTransportStats( + uid_t uid, unsigned short delay, unsigned short lost, + unsigned short rxKBitRate) { + (void)uid; + (void)delay; + (void)lost; + (void)rxKBitRate; + } + + /** Reports the transport-layer statistics of each remote video stream. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStats() "onRemoteVideoStats" callback. + * + * This callback reports the transport-layer statistics, such as the + * packet loss rate and network time delay, once every two seconds after + * the local user receives a video packet from a remote user. + * + * @param uid User ID of the remote user sending the video packet. + * @param delay Network time delay (ms) from the remote user sending the + * video packet to the local user. + * @param lost Packet loss rate (%) of the video packet sent from the + * remote user. + * @param rxKBitRate Received bitrate (Kbps) of the video packet sent + * from the remote user. + */ + virtual void onRemoteVideoTransportStats( + uid_t uid, unsigned short delay, unsigned short lost, + unsigned short rxKBitRate) { + (void)uid; + (void)delay; + (void)lost; + (void)rxKBitRate; + } + + /** Occurs when the microphone is enabled/disabled. + * + * @deprecated v2.9.0 + * + * The \ref onMicrophoneEnabled() "onMicrophoneEnabled" callback is + * deprecated. Use #LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or + * #LOCAL_AUDIO_STREAM_STATE_RECORDING (1) in the + * \ref onLocalAudioStateChanged() "onLocalAudioStateChanged" callback + * instead. + * + * The SDK triggers this callback when the local user resumes or stops + * capturing the local audio stream by calling the + * \ref agora::rtc::IRtcEngine::enableLocalAudio "enbaleLocalAudio" method. + * + * @param enabled Whether the microphone is enabled/disabled: + * - true: Enabled. + * - false: Disabled. + */ + virtual void onMicrophoneEnabled(bool enabled) { + (void)enabled; + } + /** Occurs when the connection state between the SDK and the server changes. + + @param state See #CONNECTION_STATE_TYPE. + @param reason See #CONNECTION_CHANGED_REASON_TYPE. + */ + virtual void onConnectionStateChanged( + CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) { + (void)state; + (void)reason; + } + + /** Occurs when the local network type changes. + + When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions. + + @param type See #NETWORK_TYPE. + */ + virtual void onNetworkTypeChanged(NETWORK_TYPE type) { + (void)type; + } + /** Occurs when the local user successfully registers a user account by calling the \ref agora::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method or joins a channel by calling the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method.This callback reports the user ID and user account of the local user. + + @param uid The ID of the local user. + @param userAccount The user account of the local user. + */ + virtual void onLocalUserRegistered(uid_t uid, const char* userAccount) { + (void)uid; + (void)userAccount; + } + /** Occurs when the SDK gets the user ID and user account of the remote user. + + After a remote user joins the channel, the SDK gets the UID and user account of the remote user, + caches them in a mapping table object (`userInfo`), and triggers this callback on the local client. + + @param uid The ID of the remote user. + @param info The `UserInfo` object that contains the user ID and user account of the remote user. + */ + virtual void onUserInfoUpdated(uid_t uid, const UserInfo& info) { + (void)uid; + (void)info; + } +}; + +/** +* Video device collection methods. + + The IVideoDeviceCollection interface class retrieves the video device information. +*/ +class IVideoDeviceCollection +{ +protected: + virtual ~IVideoDeviceCollection(){} +public: + /** Retrieves the total number of the indexed video devices in the system. + + @return Total number of the indexed video devices: + */ + virtual int getCount() = 0; + + /** Retrieves a specified piece of information about an indexed video device. + + @param index The specified index of the video device that must be less than the return value of \ref IVideoDeviceCollection::getCount "getCount". + @param deviceName Pointer to the video device name. + @param deviceId Pointer to the video device ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Sets the device with the device ID. + + @param deviceId Device ID of the device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Releases all IVideoDeviceCollection resources. + */ + virtual void release() = 0; +}; + +/** Video device management methods. + + The IVideoDeviceManager interface class tests the video device interfaces. Instantiate an AVideoDeviceManager class to retrieve an IVideoDeviceManager interface. +*/ +class IVideoDeviceManager +{ +protected: + virtual ~IVideoDeviceManager(){} +public: + + /** Enumerates the video devices. + + This method returns an IVideoDeviceCollection object including all video devices in the system. With the IVideoDeviceCollection object, the application can enumerate the video devices. The application must call the \ref IVideoDeviceCollection::release "release" method to release the returned object after using it. + + @return + - An IVideoDeviceCollection object including all video devices in the system: Success. + - NULL: Failure. + */ + virtual IVideoDeviceCollection* enumerateVideoDevices() = 0; + + /** Starts the video-capture device test. + + This method tests whether the video-capture device works properly. Before calling this method, ensure that you have already called the \ref IRtcEngine::enableVideo "enableVideo" method, and the window handle (*hwnd*) parameter is valid. + + @param hwnd The window handle used to display the screen. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startDeviceTest(view_t hwnd) = 0; + + /** Stops the video-capture device test. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopDeviceTest() = 0; + + /** Sets a device with the device ID. + + @param deviceId Pointer to the video-capture device ID. Call the \ref IVideoDeviceManager::enumerateVideoDevices "enumerateVideoDevices" method to retrieve it. + + @note Plugging or unplugging the device does not change the device ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the video-capture device that is in use. + + @param deviceId Pointer to the video-capture device ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Releases all IVideoDeviceManager resources. + */ + virtual void release() = 0; +}; + +/** Audio device collection methods. + +The IAudioDeviceCollection interface class retrieves device-related information. +*/ +class IAudioDeviceCollection +{ +protected: + virtual ~IAudioDeviceCollection(){} +public: + + /** Retrieves the total number of audio playback or audio recording devices. + + @note You must first call the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" or \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method before calling this method to return the number of audio playback or audio recording devices. + + @return Number of audio playback or audio recording devices. + */ + virtual int getCount() = 0; + + /** Retrieves a specified piece of information about an indexed audio device. + + @param index The specified index that must be less than the return value of \ref IAudioDeviceCollection::getCount "getCount". + @param deviceName Pointer to the audio device name. + @param deviceId Pointer to the audio device ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Specifies a device with the device ID. + + @param deviceId Pointer to the device ID of the device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Sets the volume of the application. + + @param volume Application volume. The value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setApplicationVolume(int volume) = 0; + + /** Retrieves the volume of the application. + + @param volume Pointer to the application volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getApplicationVolume(int& volume) = 0; + + /** Mutes the application. + + @param mute Sets whether to mute/unmute the application: + - true: Mute the application. + - false: Unmute the application. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setApplicationMute(bool mute) = 0; + /** Gets the mute state of the application. + + @param mute Pointer to whether the application is muted/unmuted. + - true: The application is muted. + - false: The application is not muted. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int isApplicationMute(bool& mute) = 0; + + /** Releases all IAudioDeviceCollection resources. + */ + virtual void release() = 0; +}; +/** Audio device management methods. + + The IAudioDeviceManager interface class allows for audio device interface testing. Instantiate an AAudioDeviceManager class to retrieve the IAudioDeviceManager interface. +*/ +class IAudioDeviceManager +{ +protected: + virtual ~IAudioDeviceManager(){} +public: + + /** Enumerates the audio playback devices. + + This method returns an IAudioDeviceCollection object that includes all audio playback devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio playback devices. + + @note The application must call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it. + + @return + - Success: Returns an IAudioDeviceCollection object that includes all audio playback devices in the system. For wireless Bluetooth headset devices with master and slave headsets, the master headset is the playback device. + - Returns NULL: Failure. + */ + virtual IAudioDeviceCollection* enumeratePlaybackDevices() = 0; + + /** Enumerates the audio recording devices. + + This method returns an IAudioDeviceCollection object that includes all audio recording devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio recording devices. + + @note The application needs to call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it. + + @return + - Returns an IAudioDeviceCollection object that includes all audio recording devices in the system: Success. + - Returns NULL: Failure. + */ + virtual IAudioDeviceCollection* enumerateRecordingDevices() = 0; + + /** Sets the audio playback device using the device ID. + + @note Plugging or unplugging the audio device does not change the device ID. + + @param deviceId Device ID of the audio playback device, retrieved by calling the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Sets the audio recording device using the device ID. + + @param deviceId Device ID of the audio recording device, retrieved by calling the \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method. + + @note Plugging or unplugging the audio device does not change the device ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Starts the audio playback device test. + + This method tests if the playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly. + + @param testAudioFilePath Pointer to the path of the audio file for the audio playback device test in UTF-8: + - Supported file formats: wav, mp3, m4a, and aac. + - Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz. + + @return + - 0: Success, and you can hear the sound of the specified audio file. + - < 0: Failure. + */ + virtual int startPlaybackDeviceTest(const char* testAudioFilePath) = 0; + + /** Stops the audio playback device test. + + This method stops testing the audio playback device. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startPlaybackDeviceTest "startPlaybackDeviceTest" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopPlaybackDeviceTest() = 0; + + /** Sets the volume of the audio playback device. + + @param volume Sets the volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackDeviceVolume(int volume) = 0; + + /** Retrieves the volume of the audio playback device. + + @param volume Pointer to the audio playback device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDeviceVolume(int *volume) = 0; + + /** Sets the volume of the microphone. + + @param volume Sets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingDeviceVolume(int volume) = 0; + + /** Retrieves the volume of the microphone. + + @param volume Pointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDeviceVolume(int *volume) = 0; + + /** Mutes the audio playback device. + + @param mute Sets whether to mute/unmute the audio playback device: + - true: Mutes. + - false: Unmutes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackDeviceMute(bool mute) = 0; + /** Retrieves the mute status of the audio playback device. + + @param mute Pointer to whether the audio playback device is muted/unmuted. + - true: Muted. + - false: Unmuted. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDeviceMute(bool *mute) = 0; + /** Mutes/Unmutes the microphone. + + @param mute Sets whether to mute/unmute the microphone: + - true: Mutes. + - false: Unmutes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingDeviceMute(bool mute) = 0; + + /** Retrieves the microphone's mute status. + + @param mute Pointer to whether the microphone is muted/unmuted. + - true: Muted. + - false: Unmuted. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDeviceMute(bool *mute) = 0; + + /** Starts the microphone test. + + This method tests whether the microphone works properly. Once the test starts, the SDK uses the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback to notify the application with the volume information. + + @param indicationInterval Interval period (ms) of the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback cycle. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startRecordingDeviceTest(int indicationInterval) = 0; + + /** Stops the microphone test. + + This method stops the microphone test. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startRecordingDeviceTest "startRecordingDeviceTest" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopRecordingDeviceTest() = 0; + + /** Retrieves the audio playback device associated with the device ID. + + @param deviceId Pointer to the ID of the audio playback device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the audio playback device information associated with the device ID and device name. + + @param deviceId Pointer to the device ID of the audio playback device. + @param deviceName Pointer to the device name of the audio playback device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the audio recording device associated with the device ID. + + @param deviceId Pointer to the device ID of the audio recording device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the audio recording device information associated with the device ID and device name. + + @param deviceId Pointer to the device ID of the recording audio device. + @param deviceName Pointer to the device name of the recording audio device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Starts the audio device loopback test. + + This method tests whether the local audio devices are working properly. After calling this method, the microphone captures the local audio and plays it through the speaker. The \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns the local audio volume information at the set interval. + + @note This method tests the local audio devices and does not report the network conditions. + + @param indicationInterval The time interval (ms) at which the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startAudioDeviceLoopbackTest(int indicationInterval) = 0; + + /** Stops the audio device loopback test. + + @note Ensure that you call this method to stop the loopback test after calling the \ref IAudioDeviceManager::startAudioDeviceLoopbackTest "startAudioDeviceLoopbackTest" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopAudioDeviceLoopbackTest() = 0; + + /** Releases all IAudioDeviceManager resources. + */ + virtual void release() = 0; +}; + +/** Definition of RtcEngineContext. +*/ +struct RtcEngineContext +{ + /** The IRtcEngineEventHandler object. + */ + IRtcEngineEventHandler* eventHandler; + /** + * The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id). + * Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only one `IRtcEngine` instance. To change your App ID, call `release` to destroy the current `IRtcEngine` instance and then call `createAgoraRtcEngine` + * and `initialize` to create an `IRtcEngine` instance with the new App ID. + */ + const char* appId; + // For android, it the context(Activity or Application + // for windows,Video hot plug device + /** The video window handle. Once set, this parameter enables you to plug + * or unplug the video devices while they are powered. + */ + void* context; + /** + * The area of connection. This advanced feature applies to scenarios that have regional restrictions. + * + * You can use the bitwise OR operator (|) to specify multiple areas. For details, see #AREA_CODE. + * + * After specifying the area of connection: + * - When the app that integrates the Agora SDK is used within the specified area, it connects to the Agora servers within the specified area under normal circumstances. + * - When the app that integrates the Agora SDK is used out of the specified area, it connects to the Agora servers either in the specified area or in the area where the app is located. + */ + int areaCode; + RtcEngineContext() + :eventHandler(NULL) + ,appId(NULL) + ,context(NULL) + ,areaCode(rtc::AREA_CODE_GLOBAL) + {} +}; + +/** Definition of IMetadataObserver +*/ +class IMetadataObserver +{ +public: + /** Metadata type of the observer. + @note We only support video metadata for now. + */ + enum METADATA_TYPE + { + /** -1: the metadata type is unknown. + */ + UNKNOWN_METADATA = -1, + /** 0: the metadata type is video. + */ + VIDEO_METADATA = 0, + }; + + struct Metadata + { + /** The User ID. + + - For the receiver: the ID of the user who sent the metadata. + - For the sender: ignore it. + */ + unsigned int uid; + /** Buffer size of the sent or received Metadata. + */ + unsigned int size; + /** Buffer address of the sent or received Metadata. + */ + unsigned char *buffer; + /** Time statmp of the frame following the metadata. + */ + long long timeStampMs; + }; + + virtual ~IMetadataObserver() {}; + + /** Occurs when the SDK requests the maximum size of the Metadata. + + The metadata includes the following parameters: + - `uid`: ID of the user who sends the metadata. + - `size`: The size of the sent or received metadata. + - `buffer`: The sent or received metadata. + - `timeStampMs`: The timestamp of the metadata. + + The SDK triggers this callback after you successfully call the \ref agora::rtc::IRtcEngine::registerMediaMetadataObserver "registerMediaMetadataObserver" method. You need to specify the maximum size of the metadata in the return value of this callback. + + @return The maximum size of the buffer of the metadata that you want to use. The highest value is 1024 bytes. Ensure that you set the return value. + */ + virtual int getMaxMetadataSize() = 0; + + /** Occurs when the SDK is ready to receive and send metadata. + + @note Ensure that the size of the metadata does not exceed the value set in the \ref agora::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback. + + @param metadata The Metadata to be sent. + @return + - true: Send. + - false: Do not send. + */ + virtual bool onReadyToSendMetadata(Metadata &metadata) = 0; + + /** Occurs when the local user receives the metadata. + + @param metadata The received Metadata. + */ + virtual void onMetadataReceived(const Metadata &metadata) = 0; +}; + +/** IRtcEngine is the base interface class of the Agora SDK that provides the main Agora SDK methods invoked by your application. + +Enable the Agora SDK's communication functionality through the creation of an IRtcEngine object, then call the methods of this object. + */ +class IRtcEngine +{ +protected: + virtual ~IRtcEngine() {} +public: + + /** Initializes the Agora service. + * + * Unless otherwise specified, all the methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread. + * + * @note Ensure that you call the + * \ref agora::rtc::IRtcEngine::createAgoraRtcEngine + * "createAgoraRtcEngine" and \ref agora::rtc::IRtcEngine::initialize + * "initialize" methods before calling any other APIs. + * + * @param context Pointer to the RTC engine context. See RtcEngineContext. + * + * @return + * - 0: Success. + * - < 0: Failure. + * - `ERR_INVALID_APP_ID (101)`: The app ID is invalid. Check if it is in the correct format. + */ + virtual int initialize(const RtcEngineContext& context) = 0; + + /** Releases all IRtcEngine resources. + + @note + - If you want to create a new `IRtcEngine` instance after releasing the current one, + ensure that you wait till this method is executed. + - Do not immediately uninstall the SDK's dynamic library after the call, or it may cause a crash due to the SDK clean-up thread not quitting. + + @param sync + - true: (Synchronous call) The result returns after the IRtcEngine resources are released. The application should not call this method in the SDK generated callbacks. Otherwise, the SDK must wait for the callbacks to return to recover the associated IRtcEngine resources, resulting in a deadlock. The SDK automatically detects the deadlock and converts this method into an asynchronous call, causing the test to take additional time. + - false: (Asynchronous call) The result returns immediately, even when the IRtcEngine resources have not been released. The SDK releases all resources. + */ + AGORA_CPP_API static void release (bool sync = false); + + /** Sets the channel profile of the Agora IRtcEngine. + + The Agora IRtcEngine differentiates channel profiles and applies optimization algorithms accordingly. + For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast. + + @warning + - To ensure the quality of real-time communication, we recommend that all users in a channel use the same channel profile. + - Call this method before calling \ref IRtcEngine::joinChannel "joinChannel" . You cannot set the channel profile once you have joined the channel. + + @param profile The channel profile of the Agora IRtcEngine. See #CHANNEL_PROFILE_TYPE + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setChannelProfile(CHANNEL_PROFILE_TYPE profile) = 0; + + /** Sets the role of the user, such as a host or an audience (default), before joining a channel in a live broadcast. + + This method can be used to switch the user role in a live broadcast after the user joins a channel. + + In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful \ref agora::rtc::IRtcEngine::setClientRole "setClientRole" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onClientRoleChanged "onClientRoleChanged" + - The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" or \ref agora::rtc::IRtcEngineEventHandler::onUserOffline "onUserOffline" (BECOME_AUDIENCE) + + @note + This method applies only to the Live-broadcast profile. + + @param role Sets the role of the user. See #CLIENT_ROLE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setClientRole(CLIENT_ROLE_TYPE role) = 0; + + /** Joins a channel with the user ID. + + Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other. + + + You must call the \ref IRtcEngine::leaveChannel "leaveChannel" method to exit the current call before entering another channel. + + A successful \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" + - The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. + + When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onRejoinChannelSuccess "onRejoinChannelSuccess" callback on the local client. + + @note A channel does not accept duplicate uids, such as two users with the same @p uid. If you set @p uid as 0, the system automatically assigns a @p uid. If you want to join a channel from different devices, ensure that each device has a different uid. + @warning Ensure that the App ID used for creating the token is the same App ID used by the \ref IRtcEngine::initialize "initialize" method for initializing the RTC engine. Otherwise, the CDN live streaming may fail. + + @param token Pointer to the token generated by the application server. In most circumstances, a static App ID suffices. For added security, use a Channel Key. + - If the user uses a static App ID, *token* is optional and can be set as NULL. + - If the user uses a Channel Key, Agora issues an additional App Certificate for you to generate a user key based on the algorithm and App Certificate for user authentication on the server. + @param channelId Pointer to the unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + @param info (Optional) Pointer to additional information about the channel. This parameter can be set to NULL or contain channel related information. Other users in the channel will not receive this message. + @param uid (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to 232-1. The @p uid must be unique. If a @p uid is not assigned (or set to 0), the SDK assigns and returns a @p uid in the \ref IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. Your application must record and maintain the returned *uid* since the SDK does not do so. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannel(const char* token, const char* channelId, const char* info, uid_t uid) = 0; + /** Switches to a different channel. + * + * This method allows the audience of a Live-broadcast channel to switch + * to a different channel. + * + * After the user successfully switches to another channel, the + * \ref agora::rtc::IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" + * and \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess + * "onJoinChannelSuccess" callbacks are triggered to indicate that the + * user has left the original channel and joined a new one. + * + * @note + * This method applies to the audience role in a Live-broadcast channel + * only. + * + * @param token The token generated at your server: + * - For low-security requirements: You can use the temporary token + * generated in Console. For details, see + * [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-temporary-token). + * - For high-security requirements: Use the token generated at your + * server. For details, see + * [Get a token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-token). + * @param channelId Unique channel name for the AgoraRTC session in the + * string format. The string length must be less than 64 bytes. Supported + * character scopes are: + * - All lowercase English letters: a to z. + * - All uppercase English letters: A to Z. + * - All numeric characters: 0 to 9. + * - The space character. + * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int switchChannel(const char* token, const char* channelId) = 0; + + /** Allows a user to leave a channel, such as hanging up or exiting a call. + + After joining a channel, the user must call the *leaveChannel* method to end the call before joining another channel. + + This method returns 0 if the user leaves the channel and releases all resources related to the call. + + This method call is asynchronous, and the user has not left the channel when the method call returns. Once the user leaves the channel, the SDK triggers the \ref IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" callback. + + A successful \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" + - The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserOffline "onUserOffline" , if the user leaving the channel is in the Communication channel, or is a BROADCASTER in the Live Broadcast profile. + + @note + - If you call the \ref IRtcEngine::release "release" method immediately after the *leaveChannel* method, the *leaveChannel* process interrupts, and the \ref IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" callback is not triggered. + - If you call the *leaveChannel* method during a CDN live streaming, the SDK triggers the \ref IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int leaveChannel() = 0; + + /** Gets a new token when the current token expires after a period of time. + + The `token` expires after a period of time once the token schema is enabled when: + + - The SDK triggers the \ref IRtcEngineEventHandler::onTokenPrivilegeWillExpire "onTokenPrivilegeWillExpire" callback, or + - The \ref IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" reports CONNECTION_CHANGED_TOKEN_EXPIRED(9). + + The application should call this method to get the new `token`. Failure to do so will result in the SDK disconnecting from the server. + + @param token Pointer to the new token. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int renewToken(const char* token) = 0; + + /** Retrieves the pointer to the device manager object. + + @param iid ID of the interface. + @param inter Pointer to the *DeviceManager* object. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + + /** Registers a user account. + + Once registered, the user account can be used to identify the local user when the user joins the channel. + After the user successfully registers a user account, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" callback on the local client, + reporting the user ID and user account of the local user. + + To join a channel with a user account, you can choose either of the following: + + - Call the \ref agora::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method to create a user account, and then the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel. + - Call the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel. + + The difference between the two is that for the former, the time elapsed between calling the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method + and joining the channel is shorter than the latter. + + @note + - Ensure that you set the `userAccount` parameter. Otherwise, this method does not take effect. + - Ensure that the value of the `userAccount` parameter is unique in the channel. + - To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + + @param appId The App ID of your project. + @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerLocalUserAccount( + const char* appId, const char* userAccount) = 0; + /** Joins the channel with a user account. + + After the user successfully joins the channel, the SDK triggers the following callbacks: + + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" and \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" . + The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" and \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. + + @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. + If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + + @param token The token generated at your server: + - For low-security requirements: You can use the temporary token generated at Console. For details, see [Get a temporary toke](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-temporary-token). + - For high-security requirements: Set it as the token generated at your server. For details, see [Get a token](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-token). + @param channelId The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannelWithUserAccount(const char* token, + const char* channelId, + const char* userAccount) = 0; + + /** Gets the user information by passing in the user account. + + After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them + in a mapping table object (`userInfo`), and triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client. + + After receiving the o\ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback, you can call this method to get the user ID of the + remote user from the `userInfo` object by passing in the user account. + + @param userAccount The user account of the user. Ensure that you set this parameter. + @param [in,out] userInfo A userInfo object that identifies the user: + - Input: A userInfo object. + - Output: A userInfo object that contains the user account and user ID of the user. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getUserInfoByUserAccount(const char* userAccount, UserInfo* userInfo) = 0; + /** Gets the user information by passing in the user ID. + + After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, + caches them in a mapping table object (`userInfo`), and triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client. + + After receiving the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback, you can call this method to get the user account of the remote user + from the `userInfo` object by passing in the user ID. + + @param uid The user ID of the remote user. Ensure that you set this parameter. + @param[in,out] userInfo A userInfo object that identifies the user: + - Input: A userInfo object. + - Output: A userInfo object that contains the user account and user ID of the user. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getUserInfoByUid(uid_t uid, UserInfo* userInfo) = 0; + + /** **DEPRECATED** Starts an audio call test. + + This method is deprecated as of v2.4.0. + + This method starts an audio call test to check whether the audio devices (for example, headset and speaker) and the network connection are working properly. + + To conduct the test: + + - The user speaks and the recording is played back within 10 seconds. + - If the user can hear the recording within 10 seconds, the audio devices and network connection are working properly. + + @note + - After calling this method, always call the \ref IRtcEngine::stopEchoTest "stopEchoTest" method to end the test. Otherwise, the application cannot run the next echo test. + - In the Live-broadcast profile, only the hosts can call this method. If the user switches from the Communication to Live-broadcast profile, the user must call the \ref IRtcEngine::setClientRole "setClientRole" method to change the user role from the audience (default) to the host before calling this method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startEchoTest() = 0; + + /** Starts an audio call test. + + This method starts an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly. + + In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly. + + @note + - Call this method before joining a channel. + - After calling this method, call the \ref IRtcEngine::stopEchoTest "stopEchoTest" method to end the test. Otherwise, the app cannot run the next echo test, or call the \ref IRtcEngine::joinChannel "joinChannel" method. + - In the Live-broadcast profile, only a host can call this method. + @param intervalInSeconds The time interval (s) between when you speak and when the recording plays back. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startEchoTest(int intervalInSeconds) = 0; + + /** Stops the audio call test. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopEchoTest() = 0; + + /** Enables the video module. + + Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode. If this method is called during an audio call, the audio mode switches to the video mode. To disable the video module, call the \ref IRtcEngine::disableVideo "disableVideo" method. + + A successful \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (true) callback on the remote client. + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately: + - \ref IRtcEngine::enableLocalVideo "enableLocalVideo": Whether to enable the camera to create the local video stream. + - \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream": Whether to publish the local video stream. + - \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream": Whether to subscribe to and play the remote video stream. + - \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams": Whether to subscribe to and play all remote video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableVideo() = 0; + + /** Disables the video module. + + This method can be called before joining a channel or during a call. If this method is called before joining a channel, the call starts in audio mode. If this method is called during a video call, the video mode switches to the audio mode. To enable the video module, call the \ref IRtcEngine::enableVideo "enableVideo" method. + + A successful \ref agora::rtc::IRtcEngine::disableVideo "disableVideo" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (false) callback on the remote client. + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately: + - \ref IRtcEngine::enableLocalVideo "enableLocalVideo": Whether to enable the camera to create the local video stream. + - \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream": Whether to publish the local video stream. + - \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream": Whether to subscribe to and play the remote video stream. + - \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams": Whether to subscribe to and play all remote video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int disableVideo() = 0; + + /** **DEPRECATED** Sets the video profile. + + This method is deprecated as of v2.3. Use the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method instead. + + Each video profile includes a set of parameters, such as the resolution, frame rate, and bitrate. If the camera device does not support the specified resolution, the SDK automatically chooses a suitable camera resolution, keeping the encoder resolution specified by the *setVideoProfile* method. + + @note + - If you do not need to set the video profile after joining the channel, call this method before the \ref IRtcEngine::enableVideo "enableVideo" method to reduce the render time of the first video frame. + - Always set the video profile before calling the \ref IRtcEngine::joinChannel "joinChannel" or \ref IRtcEngine::startPreview "startPreview" method. + + @param profile Sets the video profile. See #VIDEO_PROFILE_TYPE. + @param swapWidthAndHeight Sets whether to swap the width and height of the video stream: + - true: Swap the width and height. + - false: (Default) Do not swap the width and height. + The width and height of the output video are consistent with the set video profile. + @note Since the landscape or portrait mode of the output video can be decided directly by the video profile, We recommend setting *swapWidthAndHeight* to *false* (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVideoProfile(VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight) = 0; + + /** Sets the video encoder configuration. + + Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation. + + The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found. + + @note If you do not need to set the video encoder configuration after joining the channel, you can call this method before the \ref IRtcEngine::enableVideo "enableVideo" method to reduce the render time of the first video frame. + + @param config Sets the local video encoder configuration. See VideoEncoderConfiguration. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVideoEncoderConfiguration(const VideoEncoderConfiguration& config) = 0; + /** Sets the camera capture configuration. + + For a video call or live broadcast, generally the SDK controls the camera output parameters. When the default camera capturer settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration: + + - If the resolution or frame rate of the captured raw video data are higher than those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration", processing video frames requires extra CPU and RAM usage and degrades performance. We recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1 to avoid such problems. + - If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1 to optimize CPU and RAM usage. + - If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2. + + @note Call this method before enabling the local camera. That said, you can call this method before calling \ref agora::rtc::IRtcEngine::joinChannel "joinChannel", \ref agora::rtc::IRtcEngine::enableVideo "enableVideo", or \ref IRtcEngine::enableLocalVideo "enableLocalVideo", depending on which method you use to turn on your local camera. + + @param config Sets the camera capturer configuration. See CameraCapturerConfiguration. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) = 0; + + /** Initializes the local video view. + + This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream. + + Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. + The binding is still valid after the user leaves the channel, which means that the window still displays. To unbind the view, set the *view* in VideoCanvas to NULL. + + @note + - Call this method before joining a channel. + - During a call, you can call this method as many times as necessary to update the display mode of the local video view. + @param canvas Pointer to the local video view and settings. See VideoCanvas. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setupLocalVideo(const VideoCanvas& canvas) = 0; + + /** Initializes the video view of a remote user. + + This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. + + Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view. + + The application specifies the uid of the remote video in this method before the remote user joins the channel. If the remote uid is unknown to the application, set it after the application receives the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback. + If the Video Recording function is enabled, the Video Recording Service joins the channel as a dummy client, causing other clients to also receive the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback. Do not bind the dummy client to the application view because the dummy client does not send any video streams. If your application does not recognize the dummy client, bind the remote user to the view when the SDK triggers the \ref IRtcEngineEventHandler::onFirstRemoteVideoDecoded "onFirstRemoteVideoDecoded" callback. + To unbind the remote user from the view, set the view in VideoCanvas to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user. + + @note To update the rendering or mirror mode of the remote video view during a call, use the \ref IRtcEngine::setRemoteRenderMode "setRemoteRenderMode" method. + + @param canvas Pointer to the remote video view and settings. See VideoCanvas. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setupRemoteVideo(const VideoCanvas& canvas) = 0; + + /** Starts the local video preview before joining the channel. + + Before calling this method, you must: + + - Call the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" method to set up the local preview window and configure the attributes. + - Call the \ref IRtcEngine::enableVideo "enableVideo" method to enable video. + + @note Once the startPreview method is called to start the local video preview, if you leave the channel by calling the \ref IRtcEngine::leaveChannel "leaveChannel" method, the local video preview remains until you call the \ref IRtcEngine::stopPreview "stopPreview" method to disable it. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startPreview() = 0; + + /** Prioritizes a remote user's stream. + + Use this method with the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. + + @note The Agora SDK supports setting @p userPriority as high for one user only. + + @param uid The ID of the remote user. + @param userPriority Sets the priority of the remote user. See #PRIORITY_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteUserPriority(uid_t uid, PRIORITY_TYPE userPriority) = 0; + + /** Stops the local video preview and disables video. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopPreview() = 0; + + /** Enables the audio module. + + The audio mode is enabled by default. + + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. You can call this method either before or after joining a channel. + - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately: + - \ref IRtcEngine::enableLocalAudio "enableLocalAudio": Whether to enable the microphone to create the local audio stream. + - \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream": Whether to publish the local audio stream. + - \ref IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream": Whether to subscribe to and play the remote audio stream. + - \ref IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams": Whether to subscribe to and play all remote audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableAudio() = 0; + + /** Disables/Re-enables the local audio function. + + The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capturing. + + This method does not affect receiving or playing the remote audio streams,and enableLocalAudio(false) is applicable to scenarios where the user wants to + receive remote audio streams without sending any audio stream to other users in the channel. + + The SDK triggers the \ref IRtcEngineEventHandler::onMicrophoneEnabled "onMicrophoneEnabled" callback once the local audio function is disabled or enabled. + + @note + This method is different from the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method: + - \ref agora::rtc::IRtcEngine::enableLocalAudio "enableLocalAudio": Disables/Re-enables the local audio capturing and processing. + If you disable or re-enable local audio recording using the `enableLocalAudio` method, the local user may hear a pause in the remote audio playback. + - \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream": Sends/Stops sending the local audio streams. + + @param enabled Sets whether to disable/re-enable the local audio function: + - true: (Default) Re-enable the local audio function, that is, to start the local audio capturing device (for example, the microphone). + - false: Disable the local audio function, that is, to stop local audio capturing. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableLocalAudio(bool enabled) = 0; + + /** Disables the audio module. + + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. You can call this method either before or after joining a channel. + - This method resets the internal engine and takes some time to take effect. We recommend using the \ref agora::rtc::IRtcEngine::enableLocalAudio "enableLocalAudio" and \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" methods to capture, process, and send the local audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int disableAudio() = 0; + + /** Sets the audio parameters and application scenarios. + + @note + - The *setAudioProfile* method must be called before the \ref IRtcEngine::joinChannel "joinChannel" method. + - In the Communication and Live-broadcast profiles, the bitrate may be different from your settings due to network self-adaptation. + - In scenarios requiring high-quality audio, for example, a music teaching scenario, we recommend setting profile as AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) and scenario as AUDIO_SCENARIO_GAME_STREAMING (3). + + @param profile Sets the sample rate, bitrate, encoding mode, and the number of channels. See #AUDIO_PROFILE_TYPE. + @param scenario Sets the audio application scenario. See #AUDIO_SCENARIO_TYPE. + Under different audio scenarios, the device uses different volume tracks, + i.e. either the in-call volume or the media volume. For details, see + [What is the difference between the in-call volume and the media volume?](https://docs.agora.io/en/faq/system_volume). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) = 0; + /** Stops/Resumes sending the local audio stream. + + A successful \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserMuteAudio "onUserMuteAudio" callback on the remote client. + @note + - When @p mute is set as @p true, this method does not disable the microphone, which does not affect any ongoing recording. + - If you call \ref agora::rtc::IRtcEngine::setChannelProfile "setChannelProfile" after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. Therefore, we recommend calling this method after the `setChannelProfile` method. + + @param mute Sets whether to send/stop sending the local audio stream: + - true: Stops sending the local audio stream. + - false: (Default) Sends the local audio stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteLocalAudioStream(bool mute) = 0; + /** Stops/Resumes receiving all remote users' audio streams. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams. + - true: Stops receiving all remote users' audio streams. + - false: (Default) Receives all remote users' audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteAudioStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' audio streams by default. + + You can call this method either before or after joining a channel. If you call `setDefaultMuteAllRemoteAudioStreams (true)` after joining a channel, the remote audio streams of all subsequent users are not received. + + @note If you want to resume receiving the audio stream, call \ref agora::rtc::IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream (false)", + and specify the ID of the remote user whose audio stream you want to receive. + To receive the audio streams of multiple remote users, call `muteRemoteAudioStream (false)` as many times. + Calling `setDefaultMuteAllRemoteAudioStreams (false)` resumes receiving the audio streams of subsequent users only. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams by default: + - true: Stops receiving all remote users' audio streams by default. + - false: (Default) Receives all remote users' audio streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteAudioStreams(bool mute) = 0; + + /** Adjusts the playback volume of a specified remote user. + + You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user. + + @note + - Call this method after joining a channel. + - The playback volume here refers to the mixed volume of a specified remote user. + - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. + + @param uid The ID of the remote user. + @param volume The playback volume of the specified remote user. The value ranges from 0 to 100: + - 0: Mute. + - 100: Original volume. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustUserPlaybackSignalVolume(unsigned int uid, int volume) = 0; + /** Stops/Resumes receiving a specified remote user's audio stream. + + @note If you called the \ref agora::rtc::IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method and set @p mute as @p true to stop receiving all remote users' audio streams, call the *muteAllRemoteAudioStreams* method and set @p mute as @p false before calling this method. The *muteAllRemoteAudioStreams* method sets all remote audio streams, while the *muteRemoteAudioStream* method sets a specified remote audio stream. + + @param userId User ID of the specified remote user sending the audio. + @param mute Sets whether to receive/stop receiving a specified remote user's audio stream: + - true: Stops receiving the specified remote user's audio stream. + - false: (Default) Receives the specified remote user's audio stream. + + @return + - 0: Success. + - < 0: Failure. + + */ + virtual int muteRemoteAudioStream(uid_t userId, bool mute) = 0; + /** Stops/Resumes sending the local video stream. + + A successful \ref agora::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserMuteVideo "onUserMuteVideo" callback on the remote client. + + @note + - When set to *true*, this method does not disable the camera which does not affect the retrieval of the local video streams. This method executes faster than the \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method which controls the sending of the local video stream. + - If you call \ref agora::rtc::IRtcEngine::setChannelProfile "setChannelProfile" after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. Therefore, we recommend calling this method after the `setChannelProfile` method. + + @param mute Sets whether to send/stop sending the local video stream: + - true: Stop sending the local video stream. + - false: (Default) Send the local video stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteLocalVideoStream(bool mute) = 0; + /** Enables/Disables the local video capture. + + This method disables or re-enables the local video capturer, and does not affect receiving the remote video stream. + + After you call the \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" method, the local video capturer is enabled by default. You can call \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local video capturer. If you want to re-enable it, call \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo(true)". + + After the local video capturer is successfully disabled or re-enabled, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserEnableLocalVideo "onUserEnableLocalVideo" callback on the remote client. + + @note This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + + @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender: + - true: (Default) Re-enable the local video. + - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of the other remote users. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableLocalVideo(bool enabled) = 0; + /** Stops/Resumes receiving all video stream from a specified remote user. + + @param mute Sets whether to receive/stop receiving all remote users' video streams: + - true: Stop receiving all remote users' video streams. + - false: (Default) Receive all remote users' video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' video streams by default. + + You can call this method either before or after joining a channel. If you call `setDefaultMuteAllRemoteVideoStreams (true)` after joining a channel, the remote video streams of all subsequent users are not received. + + @note If you want to resume receiving the video stream, call \ref agora::rtc::IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream (false)", and specify the ID of the remote user whose video stream you want to receive. To receive the video streams of multiple remote users, call `muteRemoteVideoStream (false)` as many times. Calling `setDefaultMuteAllRemoteVideoStreams (false)` resumes receiving the video streams of subsequent users only. + + @param mute Sets whether to receive/stop receiving all remote users' video streams by default: + - true: Stop receiving all remote users' video streams by default. + - false: (Default) Receive all remote users' video streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving the video stream from a specified remote user. + + @note If you called the \ref agora::rtc::IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method and set @p mute as @p true to stop receiving all remote video streams, call the *muteAllRemoteVideoStreams* method and set @p mute as @p false before calling this method. + + @param userId User ID of the specified remote user. + @param mute Sets whether to stop/resume receiving the video stream from a specified remote user: + - true: Stop receiving the specified remote user's video stream. + - false: (Default) Receive the specified remote user's video stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteRemoteVideoStream(uid_t userId, bool mute) = 0; + /** Sets the stream type of the remote video. + + Under limited network conditions, if the publisher has not disabled the dual-stream mode using `enableDualStreamMode(false)`, + the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or + the low-video stream (the low resolution, and low bitrate video stream). + + By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. + This method allows the app to adjust the corresponding video stream type based on the size of the video window to + reduce the bandwidth and resources. + + The aspect ratio of the low-video stream is the same as the high-quality video stream. Once the resolution of the high-quality video + stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + + The method result returns in the \ref agora::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. + + @param userId ID of the remote user sending the video stream. + @param streamType Sets the video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVideoStreamType(uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + /** Sets the default stream type of remote videos. + + Under limited network conditions, if the publisher has not disabled the dual-stream mode using `enableDualStreamMode(false)`, + the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or + the low-video stream (the low resolution, and low bitrate video stream). + + By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. + This method allows the app to adjust the corresponding video stream type based on the size of the video window to + reduce the bandwidth and resources. The aspect ratio of the low-video stream is the same as the high-quality video stream. + Once the resolution of the high-quality video + stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + + The method result returns in the \ref agora::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. + + @param streamType Sets the default video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + + /** Enables the \ref agora::rtc::IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback at a set time interval to report on which users are speaking and the speakers' volume. + + Once this method is enabled, the SDK returns the volume indication in the \ref agora::rtc::IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback at the set time interval, whether or not any user is speaking in the channel. + + @param interval Sets the time interval between two consecutive volume indications: + - ≤ 0: Disables the volume indication. + - > 0: Time interval (ms) between two consecutive volume indications. We recommend setting @p interval > 200 ms. Do not set @p interval < 10 ms, or the *onAudioVolumeIndication* callback will not be triggered. + @param smooth Smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3. + @param report_vad + + - true: Enable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the `onAudioVolumeIndication` callback reports the voice activity status of the local user. + - false: (Default) Disable the voice activity detection of the local user. Once it is disabled, the `vad` parameter of the `onAudioVolumeIndication` callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableAudioVolumeIndication(int interval, int smooth, bool report_vad) = 0; + /** @deprecated Starts an audio recording. + + Use \ref IRtcEngine::startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) "startAudioRecording"2 instead. + + The SDK allows recording during a call. Supported formats: + + - .wav: Large file size with high fidelity. + - .aac: Small file size with low fidelity. + + This method has a fixed sample rate of 32 kHz. + + Ensure that the directory to save the recording file exists and is writable. + This method is usually called after the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + The recording automatically stops when the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method is called. + + @param filePath Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. + @param quality Sets the audio recording quality. See #AUDIO_RECORDING_QUALITY_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) = 0; + + /** Starts an audio recording on the client. + * + * The SDK allows recording during a call. After successfully calling this method, you can record the audio of all the users in the channel and get an audio recording file. + * Supported formats of the recording file are as follows: + * - .wav: Large file size with high fidelity. + * - .aac: Small file size with low fidelity. + * + * @note + * - Ensure that the directory you use to save the recording file exists and is writable. + * - This method is usually called after the `joinChannel` method. The recording automatically stops when you call the `leaveChannel` method. + * - For better recording effects, set quality as #AUDIO_RECORDING_QUALITY_MEDIUM or #AUDIO_RECORDING_QUALITY_HIGH when `sampleRate` is 44.1 kHz or 48 kHz. + * + * @param filePath Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8, such as c:/music/audio.aac. + * @param sampleRate Sample rate (kHz) of the recording file. Supported values are as follows: + * - 16 + * - (Default) 32 + * - 44.1 + * - 48 + * @param quality Sets the audio recording quality. See #AUDIO_RECORDING_QUALITY_TYPE. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) = 0; + /** Stops an audio recording on the client. + + You can call this method before calling the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method else, the recording automatically stops when the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method is called. + + @return + - 0: Success + - < 0: Failure. + */ + virtual int stopAudioRecording() = 0; + /** Starts playing and mixing the music file. + + This method mixes the specified local audio file with the audio stream from the microphone, or replaces the microphone's audio stream with the specified local audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. This method also supports online music playback. + + When the audio mixing file playback finishes after calling this method, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onAudioMixingFinished "onAudioMixingFinished" callback. + + A successful \ref agora::rtc::IRtcEngine::startAudioMixing "startAudioMixing" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged "onAudioMixingStateChanged" (PLAY) callback on the local client. + + When the audio mixing file playback finishes, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged "onAudioMixingStateChanged" (STOPPED) callback on the local client. + @note + - Call this method after joining a channel, otherwise issues may occur. + - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701. + - If you want to play an online music file, ensure that the time interval between calling this method is more than 100 ms, or the AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL(702) error code occurs. + @param filePath Pointer to the absolute path (including the suffixes of the filename) of the local or online audio file to mix, for example, c:/music/audio.mp4. Supported audio formats: 3GP, ASF, ADTS, AVI, MP3, MP4, MPEG-4, SAMI, and WAVE. For more information, see [Supported Media Formats in Media Foundation](https://docs.microsoft.com/en-us/windows/desktop/medfound/supported-media-formats-in-media-foundation). + @param loopback Sets which user can hear the audio mixing: + - true: Only the local user can hear the audio mixing. + - false: Both users can hear the audio mixing. + @param replace Sets the audio mixing content: + - true: Only publish the specified audio file. The audio stream from the microphone is not published. + - false: The local audio file is mixed with the audio stream from the microphone. + @param cycle Sets the number of playback loops: + - Positive integer: Number of playback loops. + - `-1`: Infinite playback loops. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startAudioMixing(const char* filePath, bool loopback, bool replace, int cycle) = 0; + /** Stops playing and mixing the music file. + + Call this method when you are in a channel. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopAudioMixing() = 0; + /** Pauses playing and mixing the music file. + + Call this method when you are in a channel. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pauseAudioMixing() = 0; + /** Resumes playing and mixing the music file. + + Call this method when you are in a channel. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int resumeAudioMixing() = 0; + /** **DEPRECATED** Agora does not recommend using this method. + + Sets the high-quality audio preferences. Call this method and set all parameters before joining a channel. + + Do not call this method again after joining a channel. + + @param fullband Sets whether to enable/disable full-band codec (48-kHz sample rate). Not compatible with SDK versions before v1.7.4: + - true: Enable full-band codec. + - false: Disable full-band codec. + @param stereo Sets whether to enable/disable stereo codec. Not compatible with SDK versions before v1.7.4: + - true: Enable stereo codec. + - false: Disable stereo codec. + @param fullBitrate Sets whether to enable/disable high-bitrate mode. Recommended in voice-only mode: + - true: Enable high-bitrate mode. + - false: Disable high-bitrate mode. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setHighQualityAudioParameters(bool fullband, bool stereo, bool fullBitrate) = 0; + /** Adjusts the volume during audio mixing. + + Call this method when you are in a channel. + + @note Calling this method does not affect the volume of audio effect file playback invoked by the \ref agora::rtc::IRtcEngine::playEffect "playEffect" method. + + @param volume Audio mixing volume. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustAudioMixingVolume(int volume) = 0; + /** Adjusts the audio mixing volume for local playback. + + @note Call this method when you are in a channel. + + @param volume Audio mixing volume for local playback. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustAudioMixingPlayoutVolume(int volume) = 0; + /** Retrieves the audio mixing volume for local playback. + + This method helps troubleshoot audio volume related issues. + + @note Call this method when you are in a channel. + + @return + - ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100]. + - < 0: Failure. + */ + virtual int getAudioMixingPlayoutVolume() = 0; + /** Adjusts the audio mixing volume for publishing (for remote users). + + @note Call this method when you are in a channel. + + @param volume Audio mixing volume for publishing. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustAudioMixingPublishVolume(int volume) = 0; + /** Retrieves the audio mixing volume for publishing. + + This method helps troubleshoot audio volume related issues. + + @note Call this method when you are in a channel. + + @return + - ≥ 0: The audio mixing volume for publishing, if this method call succeeds. The value range is [0,100]. + - < 0: Failure. + */ + virtual int getAudioMixingPublishVolume() = 0; + + /** Retrieves the duration (ms) of the music file. + + Call this method when you are in a channel. + + @return + - ≥ 0: The audio mixing duration, if this method call succeeds. + - < 0: Failure. + */ + virtual int getAudioMixingDuration() = 0; + /** Retrieves the playback position (ms) of the music file. + + Call this method when you are in a channel. + + @return + - ≥ 0: The current playback position of the audio mixing, if this method call succeeds. + - < 0: Failure. + */ + virtual int getAudioMixingCurrentPosition() = 0; + /** Sets the playback position of the music file to a different starting position (the default plays from the beginning). + + @param pos The playback starting position (ms) of the music file. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setAudioMixingPosition(int pos /*in ms*/) = 0; + /** Sets the pitch of the local music file. + * @since v3.0.1 + * + * When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only. + * + * @note + * Call this method after calling `startAudioMixing`. + * + * @param pitch Sets the pitch of the local music file by chromatic scale. The default value is 0, + * which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between + * consecutive values is a chromatic value. The greater the absolute value of this parameter, the + * higher or lower the pitch of the local music file. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int setAudioMixingPitch(int pitch) = 0; + /** Retrieves the volume of the audio effects. + + The value ranges between 0.0 and 100.0. + + @return + - ≥ 0: Volume of the audio effects, if this method call succeeds. + + - < 0: Failure. + */ + virtual int getEffectsVolume() = 0; + /** Sets the volume of the audio effects. + + @param volume Sets the volume of the audio effects. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEffectsVolume(int volume) = 0; + /** Sets the volume of a specified audio effect. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @param volume Sets the volume of the specified audio effect. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVolumeOfEffect(int soundId, int volume) = 0; + +#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) + /** + * Enables/Disables face detection for the local user. Applies to Android and iOS only. + * @since v3.0.1 + * + * Once face detection is enabled, the SDK triggers the \ref IRtcEngineEventHandler::onFacePositionChanged "onFacePositionChanged" callback + * to report the face information of the local user, which includes the following aspects: + * - The width and height of the local video. + * - The position of the human face in the local video. + * - The distance between the human face and the device screen. + * + * @param enable Determines whether to enable the face detection function for the local user: + * - true: Enable face detection. + * - false: (Default) Disable face detection. + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int enableFaceDetection(bool enable) = 0; +#endif + /** Plays a specified local or online audio effect file. + + This method allows you to set the loop count, pitch, pan, and gain of the audio effect file, as well as whether the remote user can hear the audio effect. + + To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time. + + @param soundId ID of the specified audio effect. Each audio effect has a unique ID. + + @note + - If the audio effect is preloaded into the memory through the \ref IRtcEngine::preloadEffect "preloadEffect" method, the value of @p soundID must be the same as that in the *preloadEffect* method. + - Playing multiple online audio effect files simultaneously is not supported on macOS and Windows. + + @param filePath Specifies the absolute path (including the suffixes of the filename) to the local audio effect file or the URL of the online audio effect file, for example, c:/music/audio.mp4. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav. + @param loopCount Sets the number of times the audio effect loops: + - 0: Play the audio effect once. + - 1: Play the audio effect twice. + - -1: Play the audio effect in an indefinite loop until the \ref IRtcEngine::stopEffect "stopEffect" or \ref IRtcEngine::stopAllEffects "stopAllEffects" method is called. + @param pitch Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. + @param pan Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0: + - 0.0: The audio effect displays ahead. + - 1.0: The audio effect displays to the right. + - -1.0: The audio effect displays to the left. + @param gain Sets the volume of the audio effect. The value ranges between 0 and 100 (default). The lower the value, the lower the volume of the audio effect. + @param publish Sets whether or not to publish the specified audio effect to the remote stream: + - true: The locally played audio effect is published to the Agora Cloud and the remote users can hear it. + - false: The locally played audio effect is not published to the Agora Cloud and the remote users cannot hear it. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int playEffect(int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false) = 0; + /** Stops playing a specified audio effect. + + @param soundId ID of the audio effect to stop playing. Each audio effect has a unique ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopEffect(int soundId) = 0; + /** Stops playing all audio effects. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopAllEffects() = 0; + + /** Preloads a specified audio effect file into the memory. + + @note This method does not support online audio effect files. + + To ensure smooth communication, limit the size of the audio effect file. We recommend using this method to preload the audio effect before calling the \ref IRtcEngine::joinChannel "joinChannel" method. + + Supported audio formats: mp3, aac, m4a, 3gp, and wav. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @param filePath Pointer to the absolute path of the audio effect file. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int preloadEffect(int soundId, const char* filePath) = 0; + /** Releases a specified preloaded audio effect from the memory. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int unloadEffect(int soundId) = 0; + /** Pauses a specified audio effect. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pauseEffect(int soundId) = 0; + /** Pauses all audio effects. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pauseAllEffects() = 0; + /** Resumes playing a specified audio effect. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int resumeEffect(int soundId) = 0; + /** Resumes playing all audio effects. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int resumeAllEffects() = 0; + /** Enables/Disables stereo panning for remote users. + + Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling \ref agora::rtc::IRtcEngine::setRemoteVoicePosition "setRemoteVoicePosition". + + @param enabled Sets whether or not to enable stereo panning for remote users: + - true: enables stereo panning. + - false: disables stereo panning. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableSoundPositionIndication(bool enabled) = 0; + /** Sets the sound position and gain of a remote user. + + When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. + + @note + - For this method to work, enable stereo panning for remote users by calling the \ref agora::rtc::IRtcEngine::enableSoundPositionIndication "enableSoundPositionIndication" method before joining a channel. + - This method requires hardware support. For the best sound positioning, we recommend using a stereo speaker. + + @param uid The ID of the remote user. + @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: + - 0.0: the remote sound comes from the front. + - -1.0: the remote sound comes from the left. + - 1.0: the remote sound comes from the right. + @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVoicePosition(uid_t uid, double pan, double gain) = 0; + + /** Changes the voice pitch of the local speaker. + + @param pitch Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoicePitch(double pitch) = 0; + /** Sets the local voice equalization effect. + + @param bandFrequency Sets the band frequency. The value ranges between 0 and 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. See #AUDIO_EQUALIZATION_BAND_FREQUENCY. + @param bandGain Sets the gain of each band in dB. The value ranges between -15 and 15. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) = 0; + /** Sets the local voice reverberation. + + v2.4.0 adds the \ref agora::rtc::IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset" method, a more user-friendly method for setting the local voice reverberation. You can use this method to set the local reverberation effect, such as pop music, R&B, rock music, and hip-hop. + + @param reverbKey Sets the reverberation key. See #AUDIO_REVERB_TYPE. + @param value Sets the value of the reverberation key. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value) = 0; + /** Sets the local voice changer option. + + This method can be used to set the local voice effect for users in a Communication channel or broadcasters in a live broadcast channel. + Voice changer options include the following voice effects: + + - `VOICE_CHANGER_XXX`: Changes the local voice to an old man, a little boy, or the Hulk. Applies to the voice talk scenario. + - `VOICE_BEAUTY_XXX`: Beautifies the local voice by making it sound more vigorous, resounding, or adding spacial resonance. Applies to the voice talk and singing scenario. + - `GENERAL_VOICE_BEAUTY_XXX`: Adds gender-based beautification effect to the local voice. Applies to the voice talk scenario. + - For a male voice: Adds magnetism to the voice. + - For a female voice: Adds freshness or vitality to the voice. + + @note + - To achieve better voice effect quality, Agora recommends setting the profile parameter in `setAudioProfile` as `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`. + - This method works best with the human voice, and Agora does not recommend using it for audio containing music and a human voice. + - Do not use this method with `setLocalVoiceReverbPreset`, because the method called later overrides the one called earlier. For detailed considerations, see the advanced guide *Voice Changer and Reverberation*. + + @param voiceChanger Sets the local voice changer option. The default value is `VOICE_CHANGER_OFF`, which means the original voice. See details in #VOICE_CHANGER_PRESET. + Gender-based beatification effect works best only when assigned a proper gender: + - For male: `GENERAL_BEAUTY_VOICE_MALE_MAGNETIC`. + - For female: `GENERAL_BEAUTY_VOICE_FEMALE_FRESH` or `GENERAL_BEAUTY_VOICE_FEMALE_VITALITY`. + Failure to do so can lead to voice distortion. + + @return + - 0: Success. + - < 0: Failure. Check if the enumeration is properly set. + */ + virtual int setLocalVoiceChanger(VOICE_CHANGER_PRESET voiceChanger) = 0; + /** Sets the local voice reverberation option, including the virtual stereo. + * + * This method sets the local voice reverberation for users in a Communication channel or broadcasters in a Live-broadcast channel. + * After successfully calling this method, all users in the channel can hear the voice with reverberation. + * + * @note + * - When calling this method with enumerations that begin with `AUDIO_REVERB_FX`, ensure that you set profile in `setAudioProfile` as + * `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`; otherwise, this methods cannot set the corresponding voice reverberation option. + * - When calling this method with `AUDIO_VIRTUAL_STEREO`, Agora recommends setting the `profile` parameter in `setAudioProfile` as `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`. + * - This method works best with the human voice, and Agora does not recommend using it for audio containing music and a human voice. + * - Do not use this method with `setLocalVoiceChanger`, because the method called later overrides the one called earlier. + * For detailed considerations, see the advanced guide *Voice Changer and Reverberation*. + + @param reverbPreset The local voice reverberation option. The default value is `AUDIO_REVERB_OFF`, + which means the original voice. See #AUDIO_REVERB_PRESET. + To achieve better voice effects, Agora recommends the enumeration whose name begins with `AUDIO_REVERB_FX`. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceReverbPreset(AUDIO_REVERB_PRESET reverbPreset) = 0; + + /** Specifies an SDK output log file. + + The log file records all SDK operations during runtime. If it does not exist, the SDK creates one. + + @note + - The default log file is located at: `C: \Users\\AppData\Local\Agora\`. + - Ensure that you call this method immediately after calling the \ref agora::rtc::IRtcEngine::initialize "initialize" method, otherwise the output log may not be complete. + + @param filePath File path of the log file. The string of the log file is in UTF-8. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLogFile(const char* filePath) = 0; + /** Sets the output log level of the SDK. + + You can use one or a combination of the log filter levels. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level. + + If you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING. + + @param filter Sets the log filter level. See #LOG_FILTER_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLogFilter(unsigned int filter) = 0; + /** Sets the log file size (KB). + + The SDK has two log files, each with a default size of 512 KB. If you set @p fileSizeInBytes as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files. + + @param fileSizeInKBytes The SDK log file size (KB). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLogFileSize(unsigned int fileSizeInKBytes) = 0; + /** + @deprecated This method is deprecated, use the \ref IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode"2 method instead. + Sets the local video display mode. + + This method can be called multiple times during a call to change the display mode. + + @param renderMode Sets the local video display mode. See #RENDER_MODE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalRenderMode(RENDER_MODE_TYPE renderMode) = 0; + /** Updates the display mode of the local video view. + + @since v3.0.0 + + After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream. + + @note + - Ensure that you have called the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" method to initialize the local video view before calling this method. + - During a call, you can call this method as many times as necessary to update the display mode of the local video view. + @param renderMode The rendering mode of the local video view. See #RENDER_MODE_TYPE. + @param mirrorMode + - The mirror mode of the local video view. See #VIDEO_MIRROR_MODE_TYPE. + - **Note**: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** + @deprecated This method is deprecated, use the \ref IRtcEngine::setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setRemoteRenderMode"2 method instead. + Sets the video display mode of a specified remote user. + + This method can be called multiple times during a call to change the display mode. + + @param userId ID of the remote user. + @param renderMode Sets the video display mode. See #RENDER_MODE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode) = 0; + /** Updates the display mode of the video view of a remote user. + + @since v3.0.0 + After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees. + + @note + - Ensure that you have called the \ref IRtcEngine::setupRemoteVideo "setupRemoteVideo" method to initialize the remote video view before calling this method. + - During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user. + + @param userId The ID of the remote user. + @param renderMode The rendering mode of the remote video view. See #RENDER_MODE_TYPE. + @param mirrorMode + - The mirror mode of the remote video view. See #VIDEO_MIRROR_MODE_TYPE. + - **Note**: The SDK disables the mirror mode by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** + @deprecated This method is deprecated, use the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" + or \ref IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode" method instead. + + Sets the local video mirror mode. + + You must call this method before calling the \ref agora::rtc::IRtcEngine::startPreview "startPreview" method, otherwise the mirror mode will not work. + + @warning + - Call this method after calling the \ref agora::rtc::IRtcEngine::setupLocalVideo "setupLocalVideo" method to initialize the local video view. + - During a call, you can call this method as many times as necessary to update the mirror mode of the local video view. + + @param mirrorMode Sets the local video mirror mode. See #VIDEO_MIRROR_MODE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** Sets the stream mode to the single-stream (default) or dual-stream mode. (Live broadcast only.) + + If the dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution and high-bitrate video stream), or the low stream (low-resolution and low-bitrate video stream). + + @param enabled Sets the stream mode: + - true: Dual-stream mode. + - false: (Default) Single-stream mode. + */ + virtual int enableDualStreamMode(bool enabled) = 0; + /** Sets the external audio source. Please call this method before \ref agora::rtc::IRtcEngine::joinChannel "joinChannel". + + @param enabled Sets whether to enable/disable the external audio source: + - true: Enables the external audio source. + - false: (Default) Disables the external audio source. + @param sampleRate Sets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param channels Sets the number of audio channels of the external audio source: + - 1: Mono. + - 2: Stereo. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels) = 0; + /** Sets the external audio sink. + * This method applies to scenarios where you want to use external audio + * data for playback. After enabling the external audio sink, you can call + * the \ref agora::media::IMediaEngine::pullAudioFrame "pullAudioFrame" method to pull the remote audio data, process + * it, and play it with the audio effects that you want. + * + * @note + * Once you enable the external audio sink, the app will not retrieve any + * audio data from the + * \ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback. + * + * @param enabled + * - true: Enables the external audio sink. + * - false: (Default) Disables the external audio sink. + * @param sampleRate Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. + * @param channels Sets the number of audio channels of the external + * audio sink: + * - 1: Mono. + * - 2: Stereo. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels) = 0; + /** Sets the audio recording format for the \ref agora::media::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" callback. + + + @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onRecordAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param channel Sets the number of audio channels (@p channels) returned in the *onRecordAudioFrame* callback: + - 1: Mono + - 2: Stereo + @param mode Sets the use mode (see #RAW_AUDIO_FRAME_OP_MODE_TYPE) of the *onRecordAudioFrame* callback. + @param samplesPerCall Sets the number of samples returned in the *onRecordAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming. + + + @note The SDK triggers the `onRecordAudioFrame` callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` × `channel`). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) = 0; + /** Sets the audio playback format for the \ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback. + + + @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onPlaybackAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param channel Sets the number of channels (@p channels) returned in the *onPlaybackAudioFrame* callback: + - 1: Mono + - 2: Stereo + @param mode Sets the use mode (see #RAW_AUDIO_FRAME_OP_MODE_TYPE) of the *onPlaybackAudioFrame* callback. + @param samplesPerCall Sets the number of samples returned in the *onPlaybackAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming. + + @note The SDK triggers the `onPlaybackAudioFrame` callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` × `channel`). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) = 0; + /** Sets the mixed audio format for the \ref agora::media::IAudioFrameObserver::onMixedAudioFrame "onMixedAudioFrame" callback. + + + @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onMixedAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param samplesPerCall Sets the number of samples (`samples`) returned in the *onMixedAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming. + + @note The SDK triggers the `onMixedAudioFrame` callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` × `channels`). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setMixedAudioFrameParameters(int sampleRate, int samplesPerCall) = 0; + /** Adjusts the recording volume. + + @param volume Recording volume. To avoid echoes and + improve call quality, Agora recommends setting the value of volume between + 0 and 100. If you need to set the value higher than 100, contact + support@agora.io first. + - 0: Mute. + - 100: Original volume. + + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustRecordingSignalVolume(int volume) = 0; + /** Adjusts the playback volume of all remote users. + + @note + - This method adjusts the playback volume that is the mixed volume of all remote users. + - (Since v2.3.2) To mute the local audio playback, call both the `adjustPlaybackSignalVolume` and \ref IRtcEngine::adjustAudioMixingVolume "adjustAudioMixingVolume" methods and set the volume as `0`. + + @param volume The playback volume of all remote users. To avoid echoes and + improve call quality, Agora recommends setting the value of volume between + 0 and 100. If you need to set the value higher than 100, contact + support@agora.io first. + - 0: Mute. + - 100: Original volume. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustPlaybackSignalVolume(int volume) = 0; + + /** + @deprecated This method is deprecated. As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. + Enables interoperability with the Agora Web SDK. + + @note + - This method applies only to the Live-broadcast profile. In the Communication profile, interoperability with the Agora Web SDK is enabled by default. + - If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. + + @param enabled Sets whether to enable/disable interoperability with the Agora Web SDK: + - true: Enable. + - false: (Default) Disable. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableWebSdkInteroperability(bool enabled) = 0; + //only for live broadcast + /** **DEPRECATED** Sets the preferences for the high-quality video. (Live broadcast only). + + This method is deprecated as of v2.4.0. + + @param preferFrameRateOverImageQuality Sets the video quality preference: + - true: Frame rate over image quality. + - false: (Default) Image quality over frame rate. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVideoQualityParameters(bool preferFrameRateOverImageQuality) = 0; + /** Sets the fallback option for the published video stream based on the network conditions. + + If `option` is set as #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK will: + + - Disable the upstream video but enable audio only when the network conditions deteriorate and cannot support both video and audio. + - Re-enable the video when the network conditions improve. + + When the published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onLocalPublishFallbackToAudioOnly "onLocalPublishFallbackToAudioOnly" callback. + + @note Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the published video stream falls back to audio only. + + @param option Sets the fallback option for the published video stream: + - #STREAM_FALLBACK_OPTION_DISABLED (0): (Default) No fallback behavior for the published video stream when the uplink network condition is poor. The stream quality is not guaranteed. + - #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2): The published video stream falls back to audio only when the uplink network condition is poor. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option) = 0; + /** Sets the fallback option for the remotely subscribed video stream based on the network conditions. + + The default setting for `option` is #STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW (1), where the remotely subscribed video stream falls back to the low-stream video (low resolution and low bitrate) under poor downlink network conditions. + + If `option` is set as #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve. + + When the remotely subscribed video stream falls back to audio only or when the audio-only stream switches back to the video stream, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onRemoteSubscribeFallbackToAudioOnly "onRemoteSubscribeFallbackToAudioOnly" callback. + + @param option Sets the fallback option for the remotely subscribed video stream. See #STREAM_FALLBACK_OPTIONS. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option) = 0; + +#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) + /** Switches between front and rear cameras. + + @note This method is for Android and iOS only. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int switchCamera() = 0; + /// @cond + /** Switches between front and rear cameras. + + @note This method is for Android and iOS only. + @note This method is private. + + @param direction Sets the camera to be used: + - CAMERA_DIRECTION.CAMERA_REAR: Use the rear camera. + - CAMERA_DIRECTION.CAMERA_FRONT: Use the front camera. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int switchCamera(CAMERA_DIRECTION direction) = 0; + /// @endcond + /** Sets the default audio playback route. + + This method sets whether the received audio is routed to the earpiece or speakerphone by default before joining a channel. + If a user does not call this method, the audio is routed to the earpiece by default. If you need to change the default audio route after joining a channel, call the \ref IRtcEngine::setEnableSpeakerphone "setEnableSpeakerphone" method. + + The default setting for each profile: + - Communication: In a voice call, the default audio route is the earpiece. In a video call, the default audio route is the speakerphone. If a user who is in the Communication profile calls + the \ref IRtcEngine.disableVideo "disableVideo" method or if the user calls + the \ref IRtcEngine.muteLocalVideoStream "muteLocalVideoStream" and + \ref IRtcEngine.muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" methods, the + default audio route switches back to the earpiece automatically. + - Live Broadcast: Speakerphone. + + @note + - This method is for Android and iOS only. + - This method is applicable only to the Communication profile. + - For iOS, this method only works in a voice call. + - Call this method before calling the \ref IRtcEngine::joinChannel "joinChannel" method. + + @param defaultToSpeaker Sets the default audio route: + - true: Route the audio to the speakerphone. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the speakerphone. + - false: (Default) Route the audio to the earpiece. If a headset is plugged in, the audio is routed to the headset. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultAudioRouteToSpeakerphone(bool defaultToSpeaker) = 0; + /** Enables/Disables the audio playback route to the speakerphone. + + This method sets whether the audio is routed to the speakerphone or earpiece. + + See the default audio route explanation in the \ref IRtcEngine::setDefaultAudioRouteToSpeakerphone "setDefaultAudioRouteToSpeakerphone" method and check whether it is necessary to call this method. + + @note + - This method is for Android and iOS only. + - Ensure that you have successfully called the \ref IRtcEngine::joinChannel "joinChannel" method before calling this method. + - After calling this method, the SDK returns the \ref IRtcEngineEventHandler::onAudioRouteChanged "onAudioRouteChanged" callback to indicate the changes. + - This method does not take effect if a headset is used. + + @param speakerOn Sets whether to route the audio to the speakerphone or earpiece: + - true: Route the audio to the speakerphone. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the speakerphone. + - false: Route the audio to the earpiece. If a headset is plugged in, the audio is routed to the headset. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEnableSpeakerphone(bool speakerOn) = 0; + /** Enables in-ear monitoring (for Android and iOS only). + @param enabled Determines whether to enable in-ear monitoring. + - true: Enable. + - false: (Default) Disable. + + * @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableInEarMonitoring(bool enabled) = 0; + /** Sets the volume of the in-ear monitor. + + @param volume Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default). + + @note This method is for Android and iOS only. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setInEarMonitoringVolume(int volume) = 0; + /** Checks whether the speakerphone is enabled. + + @note This method is for Android and iOS only. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual bool isSpeakerphoneEnabled() = 0; +#endif + +#if (defined(__APPLE__) && TARGET_OS_IOS) + /** Sets the audio session’s operational restriction. + + The SDK and the app can both configure the audio session by default. The app may occasionally use other apps or third-party components to manipulate the audio session and restrict the SDK from doing so. This method allows the app to restrict the SDK’s manipulation of the audio session. + + You can call this method at any time to return the control of the audio sessions to the SDK. + + @note + - This method is for iOS only. + - This method restricts the SDK’s manipulation of the audio session. Any operation to the audio session relies solely on the app, other apps, or third-party components. + + @param restriction The operational restriction (bit mask) of the SDK on the audio session. See #AUDIO_SESSION_OPERATION_RESTRICTION. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setAudioSessionOperationRestriction(AUDIO_SESSION_OPERATION_RESTRICTION restriction) = 0; +#endif + +#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) || defined(_WIN32) + /** Enables loopback recording. + + If you enable loopback recording, the output of the sound card is mixed into the audio stream sent to the other end. + + @param enabled Sets whether to enable/disable loopback recording. + - true: Enable loopback recording. + - false: (Default) Disable loopback recording. + @param deviceName Pointer to the device name of the sound card. The default value is NULL (the default sound card). + + @note + - This method is for macOS and Windows only. + - macOS does not support loopback recording of the default sound card. If you need to use this method, please use a virtual sound card and pass its name to the deviceName parameter. Agora has tested and recommends using soundflower. + + */ + virtual int enableLoopbackRecording(bool enabled, const char* deviceName = NULL) = 0; + +#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) + /** Shares the whole or part of a screen by specifying the display ID. + + @note This method is for macOS only. + + @param displayId The display ID of the screen to be shared. This parameter specifies which screen you want to share. + @param regionRect (Optional) Sets the relative location of the region to the screen. NIL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. + @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters. + + + @return + - 0: Success. + - < 0: Failure: + - #ERR_INVALID_ARGUMENT: the argument is invalid. + */ + virtual int startScreenCaptureByDisplayId(unsigned int displayId, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0; +#endif + +#if defined(_WIN32) + /** Shares the whole or part of a screen by specifying the screen rect. + + @param screenRect Sets the relative location of the screen to the virtual screen. For information on how to get screenRect, see the advanced guide *Share Screen*. + @param regionRect (Optional) Sets the relative location of the region to the screen. NULL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. + @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_INVALID_ARGUMENT : the argument is invalid. + */ + virtual int startScreenCaptureByScreenRect(const Rectangle& screenRect, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0; +#endif + + /** Shares the whole or part of a window by specifying the window ID. + + Since v3.0.0, this method supports sharing with common Windows platforms. Agora tests the mainstream Windows applications, see details as follows: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OS versionSoftwareSoftware nameWhether support
win10Chrome76.0.3809.100No
Office Word18.1903.1152.0Yes
Office ExcelNo
Office PPTNo
WPS Word11.1.0.9145Yes
WPS Excel
WPS PPT
Media Player (come with the system)AllYes
win8ChromeAllYes
Office WordAllYes
Office Excel
Office PPT
WPS Word11.1.0.9098Yes
WPS Excel
WPS PPT
Media Player(come with the system)AllYes
win7Chrome73.0.3683.103No
Office WordAllYes
Office Excel
Office PPT
WPS Word11.1.0.9098No
WPS Excel
WPS PPT
Media Player(come with the system)AllNo
+ + @param windowId The ID of the window to be shared. For information on how to get the windowId, see the advanced guide *Share Screen*. + @param regionRect (Optional) The relative location of the region to the window. NULL/NIL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window. + @param captureParams Window sharing encoding parameters. See ScreenCaptureParameters. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_INVALID_ARGUMENT: the argument is invalid. + */ + virtual int startScreenCaptureByWindowId(view_t windowId, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0; + + /** Sets the content hint for screen sharing. + + A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithm to different types of content. + + @param contentHint Sets the content hint for screen sharing. See VideoContentHint. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setScreenCaptureContentHint(VideoContentHint contentHint) = 0; + + /** Updates the screen sharing parameters. + + @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_NOT_READY: no screen or windows is being shared. + */ + virtual int updateScreenCaptureParameters(const ScreenCaptureParameters& captureParams) = 0; + + /** Updates the screen sharing region. + + @param regionRect Sets the relative location of the region to the screen or window. NULL means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_NOT_READY: no screen or window is being shared. + */ + virtual int updateScreenCaptureRegion(const Rectangle& regionRect) = 0; + + /** Stop screen sharing. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopScreenCapture() = 0; + +#if defined(__APPLE__) + typedef unsigned int WindowIDType; +#elif defined(_WIN32) + typedef HWND WindowIDType; +#endif + + /** **DEPRECATED** Starts screen sharing. + + This method is deprecated as of v2.4.0. See the following methods instead: + + - \ref agora::rtc::IRtcEngine::startScreenCaptureByDisplayId "startScreenCaptureByDisplayId" + - \ref agora::rtc::IRtcEngine::startScreenCaptureByScreenRect "startScreenCaptureByScreenRect" + - \ref agora::rtc::IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId" + + This method shares the whole screen, specified window, or specified region: + + - Whole screen: Set @p windowId as 0 and @p rect as NULL. + - Specified window: Set @p windowId as a value other than 0. Each window has a @p windowId that is not 0. + - Specified region: Set @p windowId as 0 and @p rect not as NULL. In this case, you can share the specified region, for example by dragging the mouse or implementing your own logic. + + @note The specified region is a region on the whole screen. Currently, sharing a specified region in a specific window is not supported. + *captureFreq* is the captured frame rate once the screen-sharing function is enabled. The mandatory value ranges between 1 fps and 15 fps. + + @param windowId Sets the screen sharing area. See WindowIDType. + @param captureFreq (Mandatory) The captured frame rate. The value ranges between 1 fps and 15 fps. + @param rect Specifies the screen-sharing region. @p rect is valid when @p windowsId is set as 0. When @p rect is set as NULL, the whole screen is shared. + @param bitrate The captured bitrate. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startScreenCapture(WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate) = 0; + + /** **DEPRECATED** Updates the screen capture region. + + @param rect Specifies the required region inside the screen or window. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int updateScreenCaptureRegion(const Rect *rect) = 0; +#endif + + /** Retrieves the current call ID. + + When a user joins a channel on a client, a @p callId is generated to identify the call from the client. Feedback methods, such as \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain", must be called after the call ends to submit feedback to the SDK. + + The \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain" methods require the @p callId parameter retrieved from the *getCallId* method during a call. @p callId is passed as an argument into the \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain" methods after the call ends. + + @param callId Pointer to the current call ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getCallId(agora::util::AString& callId) = 0; + + /** Allows a user to rate a call after the call ends. + + @param callId Pointer to the ID of the call, retrieved from the \ref IRtcEngine::getCallId "getCallId" method. + @param rating Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the #ERR_INVALID_ARGUMENT (2) error returns. + @param description (Optional) Pointer to the description of the rating, with a string length of less than 800 bytes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int rate(const char* callId, int rating, const char* description) = 0; + + /** Allows a user to complain about the call quality after a call ends. + + @param callId Pointer to the ID of the call, retrieved from the \ref IRtcEngine::getCallId "getCallId" method. + @param description (Optional) Pointer to the description of the complaint, with a string length of less than 800 bytes. + + @return + - 0: Success. + - < 0: Failure. + + */ + virtual int complain(const char* callId, const char* description) = 0; + + /** Retrieves the SDK version number. + + @param build Pointer to the build number. + @return The version of the current SDK in the string format. For example, 2.3.1. + */ + virtual const char* getVersion(int* build) = 0; + + /** Enables the network connection quality test. + + This method tests the quality of the users' network connections and is disabled by default. + + Before a user joins a channel or before an audience switches to a host, call this method to check the uplink network quality. + + This method consumes additional network traffic, and hence may affect communication quality. + + Call the \ref IRtcEngine::disableLastmileTest "disableLastmileTest" method to disable this test after receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" callback, and before joining a channel. + + @note + - Do not call any other methods before receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" callback. Otherwise, the callback may be interrupted by other methods, and hence may not be triggered. + - A host should not call this method after joining a channel (when in a call). + - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the \ref agora::rtc::IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. After you join the channel, whether you have called the `disableLastmileTest` method or not, the SDK automatically stops consuming the bandwidth. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableLastmileTest() = 0; + + /** Disables the network connection quality test. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int disableLastmileTest() = 0; + + /** Starts the last-mile network probe test. + + This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). + + Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. + Once this method is enabled, the SDK returns the following callbacks: + - \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality": the SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience. + - \ref IRtcEngineEventHandler::onLastmileProbeResult "onLastmileProbeResult": the SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. + + @note + - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with enableLastmileTest. + - Do not call other methods before receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" and \ref IRtcEngineEventHandler::onLastmileProbeResult "onLastmileProbeResult" callbacks. Otherwise, the callbacks may be interrupted. + - In the Live-broadcast profile, a host should not call this method after joining a channel. + + @param config Sets the configurations of the last-mile network probe test. See LastmileProbeConfig. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startLastmileProbeTest(const LastmileProbeConfig& config) = 0; + + /** Stops the last-mile network probe test. */ + virtual int stopLastmileProbeTest() = 0; + + /** Retrieves the warning or error description. + + @param code Warning code or error code returned in the \ref agora::rtc::IRtcEngineEventHandler::onWarning "onWarning" or \ref agora::rtc::IRtcEngineEventHandler::onError "onError" callback. + + @return #WARN_CODE_TYPE or #ERROR_CODE_TYPE. + */ + virtual const char* getErrorDescription(int code) = 0; + + /** Enables built-in encryption with an encryption password before users join a channel. + + All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel. + + If an encryption password is not specified, the encryption functionality will be disabled. + + @note + - Do not use this method for CDN live streaming. + - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. + + @param secret Pointer to the encryption password. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionSecret(const char* secret) = 0; + + /** Sets the built-in encryption mode. + + The Agora SDK supports built-in encryption, which is set to the @p aes-128-xts mode by default. Call this method to use other encryption modes. + + All users in the same channel must use the same encryption mode and password. + + Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. + + @note Call the \ref IRtcEngine::setEncryptionSecret "setEncryptionSecret" method to enable the built-in encryption function before calling this method. + + @param encryptionMode Pointer to the set encryption mode: + - "aes-128-xts": (Default) 128-bit AES encryption, XTS mode. + - "aes-128-ecb": 128-bit AES encryption, ECB mode. + - "aes-256-xts": 256-bit AES encryption, XTS mode. + - "": When encryptionMode is set as NULL, the encryption mode is set as "aes-128-xts" by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionMode(const char* encryptionMode) = 0; + + /** Registers a packet observer. + + The Agora SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission. + + @note + - The size of the packet sent to the network after processing should not exceed 1200 bytes, otherwise, the packet may fail to be sent. + - Ensure that both receivers and senders call this method, otherwise, you may meet undefined behaviors such as no voice and black screen. + - When you use CDN live streaming, recording or storage functions, Agora doesn't recommend calling this method. + + @param observer Pointer to the registered packet observer. See IPacketObserver. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerPacketObserver(IPacketObserver* observer) = 0; + + /** Creates a data stream. + + Each user can create up to five data streams during the lifecycle of the IRtcEngine. + + @note Set both the @p reliable and @p ordered parameters to true or false. Do not set one as true and the other as false. + + @param streamId Pointer to the ID of the created data stream. + @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds: + - true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, an error is reported to the application. + - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. + @param ordered Sets whether or not the recipients receive the data stream in the sent order: + - true: The recipients receive the data stream in the sent order. + - false: The recipients do not receive the data stream in the sent order. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int createDataStream(int* streamId, bool reliable, bool ordered) = 0; + + /** Sends data stream messages to all users in a channel. + + The SDK has the following restrictions on this method: + - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB. + - Each client can send up to 6 kB of data per second. + - Each user can have up to five data streams simultaneously. + + A successful \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method call triggers the + \ref agora::rtc::IRtcEngineEventHandler::onStreamMessage "onStreamMessage" callback on the remote client, from which the remote user gets the stream message. + + A failed \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method call triggers the + \ref agora::rtc::IRtcEngineEventHandler::onStreamMessage "onStreamMessage" callback on the remote client. + @note This method applies only to the Communication profile or to the hosts in the Live-broadcast profile. If an audience in the Live-broadcast profile calls this method, the audience may be switched to a host. + @param streamId ID of the sent data stream, returned in the \ref IRtcEngine::createDataStream "createDataStream" method. + @param data Pointer to the sent data. + @param length Length of the sent data. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0; + + /** Publishes the local stream to a specified CDN live RTMP address. (CDN live only.) + + The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback. + + The \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of adding a local stream to the CDN. + @note + - Ensure that the user joins the channel before calling this method. + - Ensure that you enable the RTMP Converter service before using this function. See *Prerequisites* in the advanced guide *Push Streams to CDN*. + - This method adds only one stream RTMP URL address each time it is called. + - This method applies to Live Broadcast only. + + @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. + @param transcodingEnabled Sets whether transcoding is enabled/disabled: + - true: Enable transcoding. To [transcode](https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#transcoding) the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. If you set this parameter as `true`, ensure that you call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method before this method. + - false: Disable transcoding. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0. + - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream. + */ + virtual int addPublishStreamUrl(const char *url, bool transcodingEnabled) = 0; + + /** Removes an RTMP stream from the CDN. (CDN live only.) + + This method removes the RTMP URL address (added by the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method) from a CDN live stream. The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamUnpublished "onStreamUnpublished" callback. + + The \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of removing an RTMP stream from the CDN. + @note + - This method removes only one RTMP URL address each time it is called. + - The RTMP URL address must not contain special characters, such as Chinese language characters. + - This method applies to Live Broadcast only. + + @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removePublishStreamUrl(const char *url) = 0; + + /** Sets the video layout and audio settings for CDN live. (CDN live only.) + + The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onTranscodingUpdated "onTranscodingUpdated" callback when you call the `setLiveTranscoding` method to update the transcoding setting. + + @note + - This method applies to Live Broadcast only. + - Ensure that you enable the RTMP Converter service before using this function. See *Prerequisites* in the advanced guide *Push Streams to CDN*. + - If you call the `setLiveTranscoding` method to update the transcoding setting for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + + @param transcoding Sets the CDN live audio/video transcoding settings. See LiveTranscoding. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLiveTranscoding(const LiveTranscoding &transcoding) = 0; + + /** **DEPRECATED** Adds a watermark image to the local video or CDN live stream. + + This method is deprecated from v2.9.1. Use \ref agora::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark"2 instead. + + This method adds a PNG watermark image to the local video stream for the recording device, channel audience, and CDN live audience to view and capture. + + To add the PNG file to the CDN live publishing stream, see the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method. + + @param watermark Pointer to the watermark image to be added to the local video stream. See RtcImage. + + @note + - The URL descriptions are different for the local video and CDN live streams: + - In a local video stream, `url` in RtcImage refers to the absolute path of the added watermark image file in the local video stream. + - In a CDN live stream, `url` in RtcImage refers to the URL address of the added watermark image in the CDN live broadcast. + - The source file of the watermark image must be in the PNG file format. If the width and height of the PNG file differ from your settings in this method, the PNG file will be cropped to conform to your settings. + - The Agora SDK supports adding only one watermark image onto a local video or CDN live stream. The newly added watermark image replaces the previous one. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int addVideoWatermark(const RtcImage& watermark) = 0; + + /** Adds a watermark image to the local video. + + This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included), + and the recording device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one. + + The watermark position depends on the settings in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method: + - If the orientation mode of the encoding video is #ORIENTATION_MODE_FIXED_LANDSCAPE, or the landscape mode in #ORIENTATION_MODE_ADAPTIVE, the watermark uses the landscape orientation. + - If the orientation mode of the encoding video is #ORIENTATION_MODE_FIXED_PORTRAIT, or the portrait mode in #ORIENTATION_MODE_ADAPTIVE, the watermark uses the portrait orientation. + - When setting the watermark position, the region must be less than the dimensions set in the `setVideoEncoderConfiguration` method. Otherwise, the watermark image will be cropped. + + @note + - Ensure that you have called the \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" method to enable the video module before calling this method. + - If you only want to add a watermark image to the local video for the audience in the CDN live broadcast channel to see and capture, you can call this method or the \ref agora::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method. + - This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray. + - If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings. + - If you have enabled the local video preview by calling the \ref agora::rtc::IRtcEngine::startPreview "startPreview" method, you can use the `visibleInPreview` member in the WatermarkOptions class to set whether or not the watermark is visible in preview. + - If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer. + + @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path. + @param options Pointer to the watermark's options to be added. See WatermarkOptions for more infomation. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) = 0; + + /** Removes the watermark image from the video stream added by the \ref agora::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int clearVideoWatermarks() = 0; + + /** @since v3.0.0 + + Enables/Disables image enhancement and sets the options. + + @note + - Call this method after calling the enableVideo method. + - Currently this method does not apply for macOS. + + @param enabled Sets whether or not to enable image enhancement: + - true: enables image enhancement. + - false: disables image enhancement. + @param options Sets the image enhancement option. See BeautyOptions. + */ + virtual int setBeautyEffectOptions(bool enabled, BeautyOptions options) = 0; + + /** Adds a voice or video stream URL address to a live broadcast. + + The \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback returns the inject status. If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. + + The \ref agora::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method call triggers the following callbacks: + - The local client: + - \ref agora::rtc::IRtcEngineEventHandler::onStreamInjectedStatus "onStreamInjectedStatus" , with the state of the injecting the online stream. + - \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + - The remote client: + - \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + + @note + - Ensure that you enable the RTMP Converter service before using this function. See *Prerequisites* in the advanced guide *Push Streams to CDN*. + - This method applies to the Native SDK v2.4.1 and later. + - This method applies to the Live-Broadcast profile only. + - You can inject only one media stream into the channel at the same time. + + @param url Pointer to the URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and HTTP-FLV. + - Supported audio codec type: AAC. + - Supported video codec type: H264 (AVC). + @param config Pointer to the InjectStreamConfig object that contains the configuration of the added voice or video stream. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid. + - #ERR_NOT_READY (3): The user is not in the channel. + - #ERR_NOT_SUPPORTED (4): The channel profile is not live broadcast. Call the \ref agora::rtc::IRtcEngine::setChannelProfile "setChannelProfile" method and set the channel profile to live broadcast before calling this method. + - #ERR_NOT_INITIALIZED (7): The SDK is not initialized. Ensure that the IRtcEngine object is initialized before calling this method. + */ + virtual int addInjectStreamUrl(const char* url, const InjectStreamConfig& config) = 0; + /** Starts to relay media streams across channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" and + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callbacks, and these callbacks return the + * state and events of the media stream relay. + * - If the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback returns + * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the broadcaster starts + * sending data to the destination channel. + * - If the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream + * relay. + * + * @note + * - Call this method after the \ref joinChannel() "joinChannel" method. + * - This method takes effect only when you are a broadcaster in a + * Live-broadcast channel. + * - After a successful method call, if you want to call this method + * again, ensure that you call the + * \ref stopChannelMediaRelay() "stopChannelMediaRelay" method to quit the + * current relay. + * - Contact sales-us@agora.io before implementing this function. + * - We do not support string user accounts in this API. + * + * @param configuration The configuration of the media stream relay: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int startChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Updates the channels for media stream relay. After a successful + * \ref startChannelMediaRelay() "startChannelMediaRelay" method call, if + * you want to relay the media stream to more channels, or leave the + * current relay channel, you can call the + * \ref updateChannelMediaRelay() "updateChannelMediaRelay" method. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback with the + * #RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code. + * + * @note + * Call this method after the + * \ref startChannelMediaRelay() "startChannelMediaRelay" method to update + * the destination channel. + * + * @param configuration The media stream relay configuration: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int updateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Stops the media stream relay. + * + * Once the relay stops, the broadcaster quits all the destination + * channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback. If the callback returns + * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the broadcaster successfully + * stops the relay. + * + * @note + * If the method call fails, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback with the + * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or + * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the + * channel by calling the \ref leaveChannel() "leaveChannel" method, and + * the media stream relay automatically stops. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int stopChannelMediaRelay() = 0; + + /** Removes the voice or video stream URL address from a live broadcast. + + This method removes the URL address (added by the \ref IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method) from the live broadcast. + + @note If this method is called successfully, the SDK triggers the \ref IRtcEngineEventHandler::onUserOffline "onUserOffline" callback and returns a stream uid of 666. + + @param url Pointer to the URL address of the added stream to be removed. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removeInjectStreamUrl(const char* url) = 0; + virtual bool registerEventHandler(IRtcEngineEventHandler *eventHandler) = 0; + virtual bool unregisterEventHandler(IRtcEngineEventHandler *eventHandler) = 0; + /** Gets the current connection state of the SDK. + + @return #CONNECTION_STATE_TYPE. + */ + virtual CONNECTION_STATE_TYPE getConnectionState() = 0; + + /** Registers the metadata observer. + + Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the \ref agora::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback. + This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. + + @note + - Call this method before the joinChannel method. + - This method applies to the Live-broadcast channel profile. + + @param observer The IMetadataObserver class. See the definition of IMetadataObserver for details. + @param type See \ref IMetadataObserver::METADATA_TYPE "METADATA_TYPE". The SDK supports VIDEO_METADATA (0) only for now. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerMediaMetadataObserver(IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type) = 0; + /** Provides technical preview functionalities or special customizations by configuring the SDK with JSON options. + + The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way. + + @param parameters Sets the parameter as a JSON string in the specified format. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setParameters(const char* parameters) = 0; +}; + + +class IRtcEngineParameter +{ +public: + virtual ~IRtcEngineParameter () {} + /** + * Releases all IRtcEngineParameter resources. + */ + virtual void release() = 0; + + /** Sets the bool value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setBool(const char* key, bool value) = 0; + + /** Sets the int value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setInt(const char* key, int value) = 0; + + /** Sets the unsigned int value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setUInt(const char* key, unsigned int value) = 0; + + /** Sets the double value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setNumber(const char* key, double value) = 0; + + /** Sets the string value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the set value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setString(const char* key, const char* value) = 0; + + /** Sets the object value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the set value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setObject(const char* key, const char* value) = 0; + + /** Retrieves the bool value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getBool(const char* key, bool& value) = 0; + + /** Retrieves the int value of the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getInt(const char* key, int& value) = 0; + + /** Retrieves the unsigned int value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getUInt(const char* key, unsigned int& value) = 0; + + /** Retrieves the double value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getNumber(const char* key, double& value) = 0; + + /** Retrieves the string value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getString(const char* key, agora::util::AString& value) = 0; + + /** Retrieves a child object value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getObject(const char* key, agora::util::AString& value) = 0; + + /** Retrieves the array value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getArray(const char* key, agora::util::AString& value) = 0; + + /** Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options. + + @param parameters Pointer to the set parameters in a JSON string. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setParameters(const char* parameters) = 0; + + /** Sets the profile to control the RTC engine. + + @param profile Pointer to the set profile. + @param merge Sets whether to merge the profile data with the original value: + - true: Merge the profile data with the original value. + - false: Do not merge the profile data with the original value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setProfile(const char* profile, bool merge) = 0; + + virtual int convertPath(const char* filePath, agora::util::AString& value) = 0; +}; + +class AAudioDeviceManager : public agora::util::AutoPtr +{ +public: + AAudioDeviceManager(IRtcEngine* engine) + { + queryInterface(engine, AGORA_IID_AUDIO_DEVICE_MANAGER); + } +}; + +class AVideoDeviceManager : public agora::util::AutoPtr +{ +public: + AVideoDeviceManager(IRtcEngine* engine) + { + queryInterface(engine, AGORA_IID_VIDEO_DEVICE_MANAGER); + } +}; + +class AParameter : public agora::util::AutoPtr +{ +public: + AParameter(IRtcEngine& engine) { initialize(&engine); } + AParameter(IRtcEngine* engine) { initialize(engine); } + AParameter(IRtcEngineParameter* p) :agora::util::AutoPtr(p) {} +private: + bool initialize(IRtcEngine* engine) + { + IRtcEngineParameter* p = NULL; + if (engine && !engine->queryInterface(AGORA_IID_RTC_ENGINE_PARAMETER, (void**)&p)) + reset(p); + return p != NULL; + } +}; +/** **DEPRECATED** The RtcEngineParameters class is deprecated, use the IRtcEngine class instead. +*/ +class RtcEngineParameters +{ +public: + RtcEngineParameters(IRtcEngine& engine) + :m_parameter(&engine){} + RtcEngineParameters(IRtcEngine* engine) + :m_parameter(engine){} + + + int enableLocalVideo(bool enabled) { + return setParameters("{\"rtc.video.capture\":%s,\"che.video.local.capture\":%s,\"che.video.local.render\":%s,\"che.video.local.send\":%s}", enabled ? "true" : "false", enabled ? "true" : "false", enabled ? "true" : "false", enabled ? "true" : "false"); + } + + + + int muteLocalVideoStream(bool mute) { + return setParameters("{\"rtc.video.mute_me\":%s,\"che.video.local.send\":%s}", mute ? "true" : "false", mute ? "false" : "true"); + } + + + int muteAllRemoteVideoStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.video.mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + + int setDefaultMuteAllRemoteVideoStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.video.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + int muteRemoteVideoStream(uid_t uid, bool mute) { + return setObject("rtc.video.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute ? "true" : "false"); + } + + + int setPlaybackDeviceVolume(int volume) {// [0,255] + return m_parameter ? m_parameter->setInt("che.audio.output.volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) { + return startAudioRecording(filePath, 32000, quality); + } + + int startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else + return -ERR_INVALID_ARGUMENT; +#endif + return setObject("che.audio.start_recording", "{\"filePath\":\"%s\",\"sampleRate\":%d,\"quality\":%d}", filePath, sampleRate, quality); + } + + + int stopAudioRecording() { + return m_parameter ? m_parameter->setBool("che.audio.stop_recording", true) : -ERR_NOT_INITIALIZED; + } + + + int startAudioMixing(const char* filePath, bool loopback, bool replace, int cycle) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else + return -ERR_INVALID_ARGUMENT; +#endif + return setObject("che.audio.start_file_as_playout", "{\"filePath\":\"%s\",\"loopback\":%s,\"replace\":%s,\"cycle\":%d}", + filePath, + loopback?"true":"false", + replace?"true":"false", + cycle); + } + + + int stopAudioMixing() { + return m_parameter ? m_parameter->setBool("che.audio.stop_file_as_playout", true) : -ERR_NOT_INITIALIZED; + } + + + int pauseAudioMixing() { + return m_parameter ? m_parameter->setBool("che.audio.pause_file_as_playout", true) : -ERR_NOT_INITIALIZED; + } + + + int resumeAudioMixing() { + return m_parameter ? m_parameter->setBool("che.audio.pause_file_as_playout", false) : -ERR_NOT_INITIALIZED; + } + + + int adjustAudioMixingVolume(int volume) { + int ret = adjustAudioMixingPlayoutVolume(volume); + if (ret == 0) { + adjustAudioMixingPublishVolume(volume); + } + return ret; + } + + + int adjustAudioMixingPlayoutVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int getAudioMixingPlayoutVolume() { + int volume = 0; + int r = m_parameter ? m_parameter->getInt("che.audio.get_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED; + if (r == 0) + r = volume; + return r; + } + + + int adjustAudioMixingPublishVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_publish_volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int getAudioMixingPublishVolume() { + int volume = 0; + int r = m_parameter ? m_parameter->getInt("che.audio.get_file_as_playout_publish_volume", volume) : -ERR_NOT_INITIALIZED; + if (r == 0) + r = volume; + return r; + } + + + int getAudioMixingDuration() { + int duration = 0; + int r = m_parameter ? m_parameter->getInt("che.audio.get_mixing_file_length_ms", duration) : -ERR_NOT_INITIALIZED; + if (r == 0) + r = duration; + return r; + } + + + int getAudioMixingCurrentPosition() { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + int pos = 0; + int r = m_parameter->getInt("che.audio.get_mixing_file_played_ms", pos); + if (r == 0) + r = pos; + return r; + } + + int setAudioMixingPosition(int pos /*in ms*/) { + return m_parameter ? m_parameter->setInt("che.audio.mixing.file.position", pos) : -ERR_NOT_INITIALIZED; + } + + int setAudioMixingPitch(int pitch) { + if (!m_parameter) { + return -ERR_NOT_INITIALIZED; + } + if (pitch > 12 || pitch < -12) { + return -ERR_INVALID_ARGUMENT; + } + return m_parameter->setInt("che.audio.set_playout_file_pitch_semitones", pitch); + } + + int getEffectsVolume() { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + int volume = 0; + int r = m_parameter->getInt("che.audio.game_get_effects_volume", volume); + if (r == 0) + r = volume; + return r; + } + + + int setEffectsVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.game_set_effects_volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int setVolumeOfEffect(int soundId, int volume) { + return setObject( + "che.audio.game_adjust_effect_volume", + "{\"soundId\":%d,\"gain\":%d}", + soundId, volume); + } + + + int playEffect(int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false) { +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else if (!filePath) + filePath = ""; +#endif + return setObject( + "che.audio.game_play_effect", + "{\"soundId\":%d,\"filePath\":\"%s\",\"loopCount\":%d, \"pitch\":%lf,\"pan\":%lf,\"gain\":%d, \"send2far\":%d}", + soundId, filePath, loopCount, pitch, pan, gain, publish); + } + + + int stopEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_stop_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int stopAllEffects() { + return m_parameter ? m_parameter->setBool( + "che.audio.game_stop_all_effects", true) : -ERR_NOT_INITIALIZED; + } + + + int preloadEffect(int soundId, char* filePath) { + return setObject( + "che.audio.game_preload_effect", + "{\"soundId\":%d,\"filePath\":\"%s\"}", + soundId, filePath); + } + + + int unloadEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_unload_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int pauseEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_pause_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int pauseAllEffects() { + return m_parameter ? m_parameter->setBool( + "che.audio.game_pause_all_effects", true) : -ERR_NOT_INITIALIZED; + } + + + int resumeEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_resume_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int resumeAllEffects() { + return m_parameter ? m_parameter->setBool( + "che.audio.game_resume_all_effects", true) : -ERR_NOT_INITIALIZED; + } + + + int enableSoundPositionIndication(bool enabled) { + return m_parameter ? m_parameter->setBool( + "che.audio.enable_sound_position", enabled) : -ERR_NOT_INITIALIZED; + } + + + int setRemoteVoicePosition(uid_t uid, double pan, double gain) { + return setObject("che.audio.game_place_sound_position", "{\"uid\":%u,\"pan\":%lf,\"gain\":%lf}", uid, pan, gain); + } + + + int setLocalVoicePitch(double pitch) { + return m_parameter ? m_parameter->setInt( + "che.audio.morph.pitch_shift", + static_cast(pitch * 100)) : -ERR_NOT_INITIALIZED; + } + + int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) { + return setObject( + "che.audio.morph.equalization", + "{\"index\":%d,\"gain\":%d}", + static_cast(bandFrequency), bandGain); + } + + int setLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value) { + return setObject( + "che.audio.morph.reverb", + "{\"key\":%d,\"value\":%d}", + static_cast(reverbKey), value); + } + + + int setLocalVoiceChanger(VOICE_CHANGER_PRESET voiceChanger) { + if(voiceChanger == 0x00000000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.voice_changer", static_cast(voiceChanger)) : -ERR_NOT_INITIALIZED; + } + else if(voiceChanger > 0x00000000 && voiceChanger < 0x00100000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.voice_changer", static_cast(voiceChanger)) : -ERR_NOT_INITIALIZED; + } + else if(voiceChanger > 0x00100000 && voiceChanger < 0x00200000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.voice_changer", static_cast(voiceChanger - 0x00100000 + 6)) : -ERR_NOT_INITIALIZED; + } + else if(voiceChanger > 0x00200000 && voiceChanger < 0x00300000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.beauty_voice", static_cast(voiceChanger - 0x00200000)) : -ERR_NOT_INITIALIZED; + } + else + { + return -ERR_NOT_INITIALIZED; + } + } + + + int setLocalVoiceReverbPreset(AUDIO_REVERB_PRESET reverbPreset) { + if(reverbPreset == 0x00000000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.reverb_preset", static_cast(reverbPreset)) : -ERR_NOT_INITIALIZED; + } + else if(reverbPreset > 0x00000000 && reverbPreset < 0x00100000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.reverb_preset", static_cast(reverbPreset + 8)) : -ERR_NOT_INITIALIZED; + } + else if(reverbPreset > 0x00100000 && reverbPreset < 0x00200000) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.reverb_preset", static_cast(reverbPreset - 0x00100000)) : -ERR_NOT_INITIALIZED; + } + else if(reverbPreset > 0x00200000 && reverbPreset < 0x00200002) + { + return m_parameter ? m_parameter->setInt("che.audio.morph.virtual_stereo", static_cast(reverbPreset - 0x00200000)) : -ERR_NOT_INITIALIZED; + } + else + { + return -ERR_NOT_INITIALIZED; + } + } + + /** **DEPRECATED** Use \ref IRtcEngine::disableAudio "disableAudio" instead. Disables the audio function in the channel. + + @return + - 0: Success. + - < 0: Failure. + */ + int pauseAudio() { + return m_parameter ? m_parameter->setBool("che.pause.audio", true) : -ERR_NOT_INITIALIZED; + } + + + int resumeAudio() { + return m_parameter ? m_parameter->setBool("che.pause.audio", false) : -ERR_NOT_INITIALIZED; + } + + + int setHighQualityAudioParameters(bool fullband, bool stereo, bool fullBitrate) { + return setObject("che.audio.codec.hq", "{\"fullband\":%s,\"stereo\":%s,\"fullBitrate\":%s}", fullband ? "true" : "false", stereo ? "true" : "false", fullBitrate ? "true" : "false"); + } + + + int adjustRecordingSignalVolume(int volume) {//[0, 400]: e.g. 50~0.5x 100~1x 400~4x + if (volume < 0) + volume = 0; + else if (volume > 400) + volume = 400; + return m_parameter ? m_parameter->setInt("che.audio.record.signal.volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int adjustPlaybackSignalVolume(int volume) {//[0, 400] + if (volume < 0) + volume = 0; + else if (volume > 400) + volume = 400; + return m_parameter ? m_parameter->setInt("che.audio.playout.signal.volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int enableAudioVolumeIndication(int interval, int smooth, bool report_vad) { // in ms: <= 0: disable, > 0: enable, interval in ms + if (interval < 0) + interval = 0; + return setObject("che.audio.volume_indication", "{\"interval\":%d,\"smooth\":%d,\"vad\":%d}", interval, smooth, report_vad); + } + + + int muteLocalAudioStream(bool mute) { + return setParameters("{\"rtc.audio.mute_me\":%s,\"che.audio.mute_me\":%s}", mute ? "true" : "false", mute ? "true" : "false"); + } + // mute/unmute all peers. unmute will clear all muted peers specified mutePeer() interface + + + int muteRemoteAudioStream(uid_t uid, bool mute) { + return setObject("rtc.audio.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute?"true":"false"); + } + + + int muteAllRemoteAudioStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.audio.mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + int setDefaultMuteAllRemoteAudioStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.audio.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + int setExternalAudioSource(bool enabled, int sampleRate, int channels) { + if (enabled) + return setParameters("{\"che.audio.external_capture\":true,\"che.audio.external_capture.push\":true,\"che.audio.set_capture_raw_audio_format\":{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d}}", sampleRate, channels, RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_WRITE); + else + return setParameters("{\"che.audio.external_capture\":false,\"che.audio.external_capture.push\":false}"); + } + + + int setExternalAudioSink(bool enabled, int sampleRate, int channels) { + if (enabled) + return setParameters("{\"che.audio.external_render\":true,\"che.audio.external_render.pull\":true,\"che.audio.set_render_raw_audio_format\":{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d}}", sampleRate, channels, RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY); + else + return setParameters("{\"che.audio.external_render\":false,\"che.audio.external_render.pull\":false}"); + } + + + int setLogFile(const char* filePath) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else if (!filePath) + filePath = ""; +#endif + return m_parameter->setString("rtc.log_file", filePath); + } + + + int setLogFilter(unsigned int filter) { + return m_parameter ? m_parameter->setUInt("rtc.log_filter", filter&LOG_FILTER_MASK) : -ERR_NOT_INITIALIZED; + } + + + int setLogFileSize(unsigned int fileSizeInKBytes) { + return m_parameter ? m_parameter->setUInt("rtc.log_size", fileSizeInKBytes) : -ERR_NOT_INITIALIZED; + } + + + int setLocalRenderMode(RENDER_MODE_TYPE renderMode) { + return setRemoteRenderMode(0, renderMode); + } + + + int setRemoteRenderMode(uid_t uid, RENDER_MODE_TYPE renderMode) { + return setParameters("{\"che.video.render_mode\":[{\"uid\":%u,\"renderMode\":%d}]}", uid, renderMode); + } + + + int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + return m_parameter->setInt("che.video.camera_capture_mode", (int)config.preference); + } + + + int enableDualStreamMode(bool enabled) { + return setParameters("{\"rtc.dual_stream_mode\":%s,\"che.video.enableLowBitRateStream\":%d}", enabled ? "true" : "false", enabled ? 1 : 0); + } + + + int setRemoteVideoStreamType(uid_t uid, REMOTE_VIDEO_STREAM_TYPE streamType) { + return setParameters("{\"rtc.video.set_remote_video_stream\":{\"uid\":%u,\"stream\":%d}, \"che.video.setstream\":{\"uid\":%u,\"stream\":%d}}", uid, streamType, uid, streamType); +// return setObject("rtc.video.set_remote_video_stream", "{\"uid\":%u,\"stream\":%d}", uid, streamType); + } + + + int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) { + return m_parameter ? m_parameter->setInt("rtc.video.set_remote_default_video_stream_type", streamType) : -ERR_NOT_INITIALIZED; + } + + + int setRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) { + return setObject("che.audio.set_capture_raw_audio_format", "{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d,\"samplesPerCall\":%d}", sampleRate, channel, mode, samplesPerCall); + } + + int setPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) { + return setObject("che.audio.set_render_raw_audio_format", "{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d,\"samplesPerCall\":%d}", sampleRate, channel, mode, samplesPerCall); + } + + int setMixedAudioFrameParameters(int sampleRate, int samplesPerCall) { + return setObject("che.audio.set_mixed_raw_audio_format", "{\"sampleRate\":%d,\"samplesPerCall\":%d}", sampleRate, samplesPerCall); + } + + + int enableWebSdkInteroperability(bool enabled) {//enable interoperability with zero-plugin web sdk + return setParameters("{\"rtc.video.web_h264_interop_enable\":%s,\"che.video.web_h264_interop_enable\":%s}", enabled ? "true" : "false", enabled ? "true" : "false"); + } + + //only for live broadcast + + int setVideoQualityParameters(bool preferFrameRateOverImageQuality) { + return setParameters("{\"rtc.video.prefer_frame_rate\":%s,\"che.video.prefer_frame_rate\":%s}", preferFrameRateOverImageQuality ? "true" : "false", preferFrameRateOverImageQuality ? "true" : "false"); + } + + + int setLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + const char *value; + switch (mirrorMode) { + case VIDEO_MIRROR_MODE_AUTO: + value = "default"; + break; + case VIDEO_MIRROR_MODE_ENABLED: + value = "forceMirror"; + break; + case VIDEO_MIRROR_MODE_DISABLED: + value = "disableMirror"; + break; + default: + return -ERR_INVALID_ARGUMENT; + } + return m_parameter->setString("che.video.localViewMirrorSetting", value); + } + + + int setLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option) { + return m_parameter ? m_parameter->setInt("rtc.local_publish_fallback_option", option) : -ERR_NOT_INITIALIZED; + } + + + int setRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option) { + return m_parameter ? m_parameter->setInt("rtc.remote_subscribe_fallback_option", option) : -ERR_NOT_INITIALIZED; + } + +#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) || defined(_WIN32) + + int enableLoopbackRecording(bool enabled, const char* deviceName = NULL) { + if (!deviceName) { + return setParameters("{\"che.audio.loopback.recording\":%s}", enabled ? "true" : "false"); + } + else { + return setParameters("{\"che.audio.loopback.deviceName\":\"%s\",\"che.audio.loopback.recording\":%s}", deviceName, enabled ? "true" : "false"); + } + } +#endif + + + int setInEarMonitoringVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.headset.monitoring.parameter", volume) : -ERR_NOT_INITIALIZED; + } + +protected: + AParameter& parameter() { + return m_parameter; + } + int setParameters(const char* format, ...) { + char buf[512]; + va_list args; + va_start(args, format); + vsnprintf(buf, sizeof(buf)-1, format, args); + va_end(args); + return m_parameter ? m_parameter->setParameters(buf) : -ERR_NOT_INITIALIZED; + } + int setObject(const char* key, const char* format, ...) { + char buf[512]; + va_list args; + va_start(args, format); + vsnprintf(buf, sizeof(buf)-1, format, args); + va_end(args); + return m_parameter ? m_parameter->setObject(key, buf) : -ERR_NOT_INITIALIZED; + } + int stopAllRemoteVideo() { + return m_parameter ? m_parameter->setBool("che.video.peer.stop_render", true) : -ERR_NOT_INITIALIZED; + } +private: + AParameter m_parameter; +}; + +} //namespace rtc +} // namespace agora + + +#define getAgoraRtcEngineVersion getAgoraSdkVersion + +//////////////////////////////////////////////////////// +/** \addtogroup createAgoraRtcEngine + @{ + */ +//////////////////////////////////////////////////////// + +/** Creates the IRtcEngine object and returns the pointer. + * + * @note The Agora RTC Native SDK supports creating only one `IRtcEngine` object for an app for now. + * + * @return Pointer to the IRtcEngine object. + */ +AGORA_API agora::rtc::IRtcEngine* AGORA_CALL createAgoraRtcEngine(); + +//////////////////////////////////////////////////////// +/** @} */ +//////////////////////////////////////////////////////// + +#define getAgoraRtcEngineErrorDescription getAgoraSdkErrorDescription +#define setAgoraRtcEngineExternalSymbolLoader setAgoraSdkExternalSymbolLoader + +#endif diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraService.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraService.h new file mode 100644 index 000000000..c6195878f --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/agora/IAgoraService.h @@ -0,0 +1,77 @@ +// Agora SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +#ifndef AGORA_SERVICE_H +#define AGORA_SERVICE_H +#include "AgoraBase.h" + +namespace agora { + namespace rtc { + class IRtcEngine; + } + namespace rtm { + class IRtmService; + } +namespace base { + +struct AgoraServiceContext +{ +}; + + +class IAgoraService +{ +protected: + virtual ~IAgoraService(){} + +public: + AGORA_CPP_API static void release (); + + /** Initializes the engine. + + @param context RtcEngine context. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int initialize(const AgoraServiceContext& context) = 0; + + /** Retrieves the SDK version number. + * @param build Build number. + * @return The current SDK version in the string format. For example, 2.4.0 + */ + virtual const char* getVersion(int* build) = 0; + + virtual rtm::IRtmService* createRtmService() = 0; +}; + +} //namespace base +} // namespace agora + +/** Gets the SDK version number. + + @param build Build number of the Agora SDK. + @return + - 0: Success. + - < 0: Failure. +*/ +AGORA_API const char* AGORA_CALL getAgoraSdkVersion(int* build); + +/** +* Creates the RtcEngine object and returns the pointer. +* @param err Error code +* @return returns Description of the error code +*/ +AGORA_API const char* AGORA_CALL getAgoraSdkErrorDescription(int err); + +/** +* Creates the Agora Service object and returns the pointer. +* @return returns Pointer of the Agora Service object +*/ +AGORA_API agora::base::IAgoraService* AGORA_CALL createAgoraService(); + +AGORA_API int AGORA_CALL setAgoraSdkExternalSymbolLoader(void* (*func)(const char* symname)); + +#endif diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/packet_processing_plugin_jni.h b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/packet_processing_plugin_jni.h new file mode 100644 index 000000000..9609f9b8f --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/include/packet_processing_plugin_jni.h @@ -0,0 +1,12 @@ +#ifndef ADVANCED_VIDEO_ANDROID_PACKET_PROCESSING_PLUGIN_JNI_H +#define ADVANCED_VIDEO_ANDROID_PACKET_PROCESSING_PLUGIN_JNI_H + +#include + +extern "C" JNIEXPORT void JNICALL +Java_io_agora_api_streamencrypt_PacketProcessor_doRegisterProcessing(JNIEnv *env, jobject thiz); + +extern "C" JNIEXPORT void JNICALL +Java_io_agora_api_streamencrypt_PacketProcessor_doUnregisterProcessing(JNIEnv *env, jobject thiz); + +#endif //ADVANCED_VIDEO_ANDROID_PACKET_PROCESSING_PLUGIN_JNI_H diff --git a/Android/APIExample/lib-stream-encrypt/src/main/cpp/packet_processing_plugin_jni.cpp b/Android/APIExample/lib-stream-encrypt/src/main/cpp/packet_processing_plugin_jni.cpp new file mode 100644 index 000000000..b6379b532 --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/cpp/packet_processing_plugin_jni.cpp @@ -0,0 +1,205 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "./include/agora/IAgoraMediaEngine.h" +#include "./include/agora/IAgoraRtcEngine.h" + +#include "./include/packet_processing_plugin_jni.h" + +/**stream data frame listener*/ +class AgoraRTCPacketObserver : public agora::rtc::IPacketObserver +{ +public: + AgoraRTCPacketObserver() + { + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "AgoraRTCPacketObserver0"); + m_txAudioBuffer.resize(2048); + m_rxAudioBuffer.resize(2048); + m_txVideoBuffer.resize(2048); + m_rxVideoBuffer.resize(2048); + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "AgoraRTCPacketObserver1"); + } + + /**Occurs when the local user sends an audio packet. + * @param packet The sent audio packet. + * @return + * true: The audio packet is sent successfully. + * false: The audio packet is discarded.*/ + virtual bool onSendAudioPacket(Packet &packet) + { + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "onSendAudioPacket0"); + int i; + //encrypt the packet + const unsigned char *p = packet.buffer; + const unsigned char *pe = packet.buffer + packet.size; + + + for (i = 0; p < pe && i < m_txAudioBuffer.size(); ++p, ++i) + { + m_txAudioBuffer[i] = *p ^ 0x55; + } + //assign new buffer and the length back to SDK + packet.buffer = &m_txAudioBuffer[0]; + packet.size = i; + return true; + } + + /**Occurs when the local user sends a video packet. + * @param packet The sent video packet. + * @return + * true: The video packet is sent successfully. + * false: The video packet is discarded.*/ + virtual bool onSendVideoPacket(Packet &packet) + { + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "onSendAudioPacket1%d", 1); + int i; + //encrypt the packet + const unsigned char *p = packet.buffer; + const unsigned char *pe = packet.buffer + packet.size; + for (i = 0; p < pe && i < m_txVideoBuffer.size(); ++p, ++i) + { + m_txVideoBuffer[i] = *p ^ 0x55; + } + //assign new buffer and the length back to SDK + packet.buffer = &m_txVideoBuffer[0]; + packet.size = i; + return true; + } + + /**Occurs when the local user receives an audio packet. + * @param packet The received audio packet. + * @return + * true: The audio packet is received successfully. + * false: The audio packet is discarded.*/ + virtual bool onReceiveAudioPacket(Packet &packet) + { + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "onReceiveAudioPacket0"); + int i = 0; + //decrypt the packet + const unsigned char *p = packet.buffer; + const unsigned char *pe = packet.buffer + packet.size; + for (i = 0; p < pe && i < m_rxAudioBuffer.size(); ++p, ++i) + { + m_rxAudioBuffer[i] = *p ^ 0x55; + } + //assign new buffer and the length back to SDK + packet.buffer = &m_rxAudioBuffer[0]; + packet.size = i; + return true; + } + + /**Occurs when the local user receives a video packet. + * @param packet The received video packet. + * @return + * true: The video packet is received successfully. + * false: The video packet is discarded.*/ + virtual bool onReceiveVideoPacket(Packet &packet) + { + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "onReceiveAudioPacket1"); + int i = 0; + //decrypt the packet + const unsigned char *p = packet.buffer; + const unsigned char *pe = packet.buffer + packet.size; + + + for (i = 0; p < pe && i < m_rxVideoBuffer.size(); ++p, ++i) + { + m_rxVideoBuffer[i] = *p ^ 0x55; + } + //assign new buffer and the length back to SDK + packet.buffer = &m_rxVideoBuffer[0]; + packet.size = i; + return true; + } + +private: + std::vector m_txAudioBuffer; //buffer for sending audio data + std::vector m_txVideoBuffer; //buffer for sending video data + + std::vector m_rxAudioBuffer; //buffer for receiving audio data + std::vector m_rxVideoBuffer; //buffer for receiving video data +}; + +static AgoraRTCPacketObserver s_packetObserver; + +static agora::rtc::IRtcEngine *rtcEngine = NULL; + +#ifdef __cplusplus +extern "C" { +#endif + +/**When the so package is successfully loaded, the SDK will automatically find and load this function; + * therefore, the function name, parameters, and return value cannot be changed at will.*/ +int __attribute__((visibility("default"))) loadAgoraRtcEnginePlugin(agora::rtc::IRtcEngine *engine) +{ + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "loadAgoraRtcEnginePlugin"); + rtcEngine = engine; + // if do registerPacketObserver here, SDK may return -7(ERR_NOT_INITIALIZED) + return 0; +} + +void __attribute__((visibility("default"))) +unloadAgoraRtcEnginePlugin(agora::rtc::IRtcEngine *engine) +{ + rtcEngine = NULL; +} + +JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) +{ + JNIEnv *env = NULL; + jint result = -1; + + if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) + { + return result; + } + + assert(env != NULL); + result = JNI_VERSION_1_6; + return result; +} + +JNIEXPORT void JNICALL +Java_io_agora_api_streamencrypt_PacketProcessor_doRegisterProcessing + (JNIEnv *env, jobject obj) +{ + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "doRegisterProcessing0"); + if (!rtcEngine) return; + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "doRegisterProcessing1"); + /**Registers a packet observer. + * The Agora SDK allows your application to register a packet observer to receive callbacks for + * voice or video packet transmission. + * @param obsrver Pointer to the registered packet observer. + * @return + * 0: Success. + * < 0: Failure. + * PS: + * The size of the packet sent to the network after processing should not exceed 1200 bytes, + * otherwise, the packet may fail to be sent. + * Ensure that both receivers and senders call this method, otherwise, you may meet undefined + * behaviors such as no voice and black screen. + * When you use CDN live streaming, recording or storage functions, Agora doesn't recommend + * calling this method.*/ + int code = rtcEngine->registerPacketObserver(&s_packetObserver); + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "%d", code); +} + +JNIEXPORT void JNICALL +Java_io_agora_api_streamencrypt_PacketProcessor_doUnregisterProcessing + (JNIEnv *env, jobject obj) +{ + if (!rtcEngine) return; + __android_log_print(ANDROID_LOG_INFO, "agoraencryption", "doUnregisterProcessing"); + rtcEngine->registerPacketObserver(nullptr); +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/Android/APIExample/lib-stream-encrypt/src/main/java/io/agora/api/streamencrypt/PacketProcessor.java b/Android/APIExample/lib-stream-encrypt/src/main/java/io/agora/api/streamencrypt/PacketProcessor.java new file mode 100644 index 000000000..ef1e5e487 --- /dev/null +++ b/Android/APIExample/lib-stream-encrypt/src/main/java/io/agora/api/streamencrypt/PacketProcessor.java @@ -0,0 +1,18 @@ +package io.agora.api.streamencrypt; + +public class PacketProcessor { + static { + System.loadLibrary("apm-plugin-packet-processing"); + } + + public final void registerProcessing() { + doRegisterProcessing(); + } + + public final void unregisterProcessing() { + doUnregisterProcessing(); + } + + private native void doRegisterProcessing(); + private native void doUnregisterProcessing(); +} diff --git a/Android/APIExample/settings.gradle b/Android/APIExample/settings.gradle index 75205d97d..f3d24886f 100644 --- a/Android/APIExample/settings.gradle +++ b/Android/APIExample/settings.gradle @@ -1,2 +1,4 @@ rootProject.name='APIExample' include ':app' +include ':lib-stream-encrypt' +include ':lib-component' From 4c9a8b94a6dc49d0f19618b4e2cdfa1a13a33a85 Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Fri, 19 Jun 2020 13:45:44 +0800 Subject: [PATCH 025/430] Add CustomRemoteVideoRender example. --- .../app/src/main/AndroidManifest.xml | 2 +- .../advanced/CustomRemoteVideoRender.java | 434 ++++++++++++++++++ .../examples/advanced/PushExternalVideo.java | 428 +++++++++++++++++ .../AudioRecordService.java | 2 +- .../CustomAudioRecord.java | 6 +- .../layout/fragment_custom_remoterender.xml | 44 ++ .../layout/fragment_push_externalvideo.xml | 44 ++ .../app/src/main/res/navigation/nav_graph.xml | 18 +- .../src/main/res/values/string_configs.xml | 4 + 9 files changed, 976 insertions(+), 6 deletions(-) create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/{custom => customaudio}/AudioRecordService.java (98%) rename Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/{custom => customaudio}/CustomAudioRecord.java (98%) create mode 100644 Android/APIExample/app/src/main/res/layout/fragment_custom_remoterender.xml create mode 100644 Android/APIExample/app/src/main/res/layout/fragment_push_externalvideo.xml diff --git a/Android/APIExample/app/src/main/AndroidManifest.xml b/Android/APIExample/app/src/main/AndroidManifest.xml index f7287b9d5..aab8ad6d2 100644 --- a/Android/APIExample/app/src/main/AndroidManifest.xml +++ b/Android/APIExample/app/src/main/AndroidManifest.xml @@ -25,7 +25,7 @@ - diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java new file mode 100644 index 000000000..95d72cc82 --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java @@ -0,0 +1,434 @@ +package io.agora.api.example.examples.advanced; + +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.SurfaceView; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.yanzhenjie.permission.AndPermission; +import com.yanzhenjie.permission.runtime.Permission; + +import io.agora.api.example.R; +import io.agora.api.example.annotation.Example; +import io.agora.api.example.common.BaseFragment; +import io.agora.rtc.Constants; +import io.agora.rtc.IRtcEngineEventHandler; +import io.agora.rtc.RtcEngine; +import io.agora.rtc.mediaio.AgoraSurfaceView; +import io.agora.rtc.mediaio.MediaIO; +import io.agora.rtc.video.VideoCanvas; +import io.agora.rtc.video.VideoEncoderConfiguration; + +import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; +import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; +import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; +import static io.agora.rtc.video.VideoEncoderConfiguration.STANDARD_BITRATE; +import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; + +/**This example demonstrates how to customize the renderer to render the local scene of the remote video stream.*/ +@Example( + group = "ADVANCED", + name = "Custom RemoteVideoRender", + actionId = R.id.action_mainFragment_to_CustomRemoteRender +) +public class CustomRemoteVideoRender extends BaseFragment implements View.OnClickListener +{ + private static final String TAG = CustomRemoteVideoRender.class.getSimpleName(); + + private FrameLayout fl_local, fl_remote; + private Button join; + private EditText et_channel; + private RtcEngine engine; + private int myUid; + private boolean joined = false; + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + { + View view = inflater.inflate(R.layout.fragment_custom_remoterender, container, false); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) + { + super.onViewCreated(view, savedInstanceState); + join = view.findViewById(R.id.btn_join); + et_channel = view.findViewById(R.id.et_channel); + view.findViewById(R.id.btn_join).setOnClickListener(this); + fl_local = view.findViewById(R.id.fl_local); + fl_remote = view.findViewById(R.id.fl_remote); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) + { + super.onActivityCreated(savedInstanceState); + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + try + { + /**Creates an RtcEngine instance. + * @param context The context of Android Activity + * @param appId The App ID issued to you by Agora. See + * How to get the App ID + * @param handler IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + engine = RtcEngine.create(context.getApplicationContext(), getString(R.string.agora_app_id), iRtcEngineEventHandler); + } + catch (Exception e) + { + e.printStackTrace(); + getActivity().onBackPressed(); + } + } + + @Override + public void onDestroy() + { + super.onDestroy(); + /**leaveChannel and Destroy the RtcEngine instance*/ + if(engine != null) + { + engine.leaveChannel(); + } + handler.post(RtcEngine::destroy); + engine = null; + } + + @Override + public void onClick(View v) + { + if (v.getId() == R.id.btn_join) + { + if (!joined) + { + // call when join button hit + String channelId = et_channel.getText().toString(); + // Check permission + if (AndPermission.hasPermissions(this, Permission.Group.STORAGE, Permission.Group.MICROPHONE, Permission.Group.CAMERA)) + { + joinChannel(channelId); + return; + } + // Request permission + AndPermission.with(this).runtime().permission( + Permission.Group.STORAGE, + Permission.Group.MICROPHONE, + Permission.Group.CAMERA + ).onGranted(permissions -> + { + // Permissions Granted + joinChannel(channelId); + }).start(); + } + else + { + joined = false; + /**After joining a channel, the user must call the leaveChannel method to end the + * call before joining another channel. This method returns 0 if the user leaves the + * channel and releases all resources related to the call. This method call is + * asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. + * A successful leaveChannel method call triggers the following callbacks: + * 1:The local client: onLeaveChannel. + * 2:The remote client: onUserOffline, if the user leaving the channel is in the + * Communication channel, or is a BROADCASTER in the Live Broadcast profile. + * @returns 0: Success. + * < 0: Failure. + * PS: + * 1:If you call the destroy method immediately after calling the leaveChannel + * method, the leaveChannel process interrupts, and the SDK does not trigger + * the onLeaveChannel callback. + * 2:If you call the leaveChannel method during CDN live streaming, the SDK + * triggers the removeInjectStreamUrl method.*/ + engine.leaveChannel(); + join.setText(getString(R.string.join)); + } + } + } + + private void joinChannel(String channelId) + { + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + + // Create render view by RtcEngine + SurfaceView surfaceView = RtcEngine.CreateRendererView(context); + // Local video is on the top + surfaceView.setZOrderMediaOverlay(true); + // Add to the local container + if(fl_local.getChildCount() > 0) + { + fl_local.removeAllViews(); + } + fl_local.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + // Setup local video to render your local camera preview + engine.setupLocalVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, 0)); + // Set audio route to speaker + engine.setDefaultAudioRoutetoSpeakerphone(true); + + /** Sets the channel profile of the Agora RtcEngine. + CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile. + Use this profile in one-on-one calls or group calls, where all users can talk freely. + CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast + channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; + an audience can only receive streams.*/ + engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); + /**In the demo, the default is to enter as the anchor.*/ + engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_BROADCASTER); + // Enable video module + engine.enableVideo(); + // Setup video encoding configs + engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( + VD_640x360, + FRAME_RATE_FPS_15, + STANDARD_BITRATE, + ORIENTATION_MODE_ADAPTIVE + )); + + /**Please configure accessToken in the string_config file. + * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see + * https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token + * A token generated at the server. This applies to scenarios with high-security requirements. For details, see + * https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/ + String accessToken = getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) + { + accessToken = null; + } + /** Allows a user to join a channel. + if you do not specify the uid, we will generate the uid for you*/ + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); + if (res != 0) + { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + showAlert(RtcEngine.getErrorDescription(Math.abs(res))); + return; + } + // Prevent repeated entry + join.setEnabled(false); + } + + /** + * IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events. + */ + private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() + { + /**Reports a warning during SDK runtime. + * Warning code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_warn_code.html*/ + @Override + public void onWarning(int warn) + { + Log.w(TAG, String.format("onWarning code %d message %s", warn, RtcEngine.getErrorDescription(warn))); + } + + /**Reports an error during SDK runtime. + * Error code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html*/ + @Override + public void onError(int err) + { + Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + } + + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics.*/ + @Override + public void onLeaveChannel(RtcStats stats) + { + super.onLeaveChannel(stats); + Log.i(TAG, String.format("local user %d leaveChannel!", myUid)); + showLongToast(String.format("local user %d leaveChannel!", myUid)); + } + + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) + { + Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + myUid = uid; + joined = true; + handler.post(new Runnable() + { + @Override + public void run() + { + join.setEnabled(true); + join.setText(getString(R.string.leave)); + } + }); + } + + /**Since v2.9.0. + * This callback indicates the state change of the remote audio stream. + * PS: This callback does not work properly when the number of users (in the Communication profile) or + * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the user whose audio state changes. + * @param state State of the remote audio + * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due + * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), + * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). + * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. + * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, + * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). + * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). + * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to + * REMOTE_AUDIO_REASON_INTERNAL(0). + * @param reason The reason of the remote audio state change. + * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio + * stream or disables the audio module. + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio + * stream or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or + * disables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream + * or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method + * until the SDK triggers this callback.*/ + @Override + public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteAudioStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Since v2.9.0. + * Occurs when the remote video state changes. + * PS: This callback does not work properly when the number of users (in the Communication + * profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video: + * REMOTE_VIDEO_STATE_STOPPED(0): The remote video is in the default state, probably due + * to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5), + * or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7). + * REMOTE_VIDEO_STATE_STARTING(1): The first remote video packet is received. + * REMOTE_VIDEO_STATE_DECODING(2): The remote video stream is decoded and plays normally, + * probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6), + * or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9). + * REMOTE_VIDEO_STATE_FROZEN(3): The remote video is frozen, probably due to + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8). + * REMOTE_VIDEO_STATE_FAILED(4): The remote video fails to start, probably due to + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0). + * @param reason The reason of the remote video state change: + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0): Internal reasons. + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3): The local user stops receiving the remote + * video stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote + * video stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5): The remote user stops sending the video + * stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the video + * stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8): The remote media stream falls back to the + * audio-only stream due to poor network conditions. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9): The remote media stream switches + * back to the video stream after the network conditions improve. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method until + * the SDK triggers this callback.*/ + @Override + public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteVideoStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered.*/ + @Override + public void onUserJoined(int uid, int elapsed) + { + super.onUserJoined(uid, elapsed); + Log.i(TAG, "onUserJoined->" + uid); + showLongToast(String.format("user %d joined!", uid)); + /**Check if the context is correct*/ + Context context = getContext(); + if (context == null) return; + handler.post(() -> + { + /**custom remote video surfaceView + * about AgoraSurfaceView,you can see this( + * https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1mediaio_1_1_agora_surface_view.html#ab4dcf3124f4bb4b945a043143babe41b)*/ + AgoraSurfaceView surfaceView = new AgoraSurfaceView(getContext()); + surfaceView.init(null); + surfaceView.setZOrderOnTop(false); + surfaceView.setBufferType(MediaIO.BufferType.BYTE_BUFFER); + surfaceView.setPixelFormat(MediaIO.PixelFormat.I420); + if(fl_remote.getChildCount() > 0) + { + fl_remote.removeAllViews(); + } + fl_remote.addView(surfaceView); + /**Customizes the remote video renderer. + * Call this method to add an external remote video renderer to the SDK. + * @param uid The ID of the remote user. + * @param render Sets the remote video renderer. See IVideoSink( + * https://docs.agora.io/en/Voice/API%20Reference/java/v3.0.1/interfaceio_1_1agora_1_1rtc_1_1mediaio_1_1_i_video_sink.html).*/ + engine.setRemoteVideoRenderer(uid, surfaceView); + }); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience.*/ + @Override + public void onUserOffline(int uid, int reason) + { + Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); + showLongToast(String.format("user %d offline! reason:%d", uid, reason)); + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }; +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java new file mode 100644 index 000000000..10ebab758 --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java @@ -0,0 +1,428 @@ +package io.agora.api.example.examples.advanced; + +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.SurfaceView; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.yanzhenjie.permission.AndPermission; +import com.yanzhenjie.permission.runtime.Permission; + +import io.agora.api.example.R; +import io.agora.api.example.annotation.Example; +import io.agora.api.example.common.BaseFragment; +import io.agora.rtc.Constants; +import io.agora.rtc.IRtcEngineEventHandler; +import io.agora.rtc.RtcEngine; +import io.agora.rtc.video.VideoCanvas; +import io.agora.rtc.video.VideoEncoderConfiguration; + +import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; +import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; +import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; +import static io.agora.rtc.video.VideoEncoderConfiguration.STANDARD_BITRATE; +import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; + +@Example( + group = "ADVANCED", + name = "Push ExternalVideo", + actionId = R.id.action_mainFragment_to_PushExternalVideo +) +public class PushExternalVideo extends BaseFragment implements View.OnClickListener +{ + private static final String TAG = PushExternalVideo.class.getSimpleName(); + + private FrameLayout fl_local, fl_remote; + private Button join; + private EditText et_channel; + private RtcEngine engine; + private int myUid; + private boolean joined = false; + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + { + View view = inflater.inflate(R.layout.fragment_push_externalvideo, container, false); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) + { + super.onViewCreated(view, savedInstanceState); + join = view.findViewById(R.id.btn_join); + et_channel = view.findViewById(R.id.et_channel); + view.findViewById(R.id.btn_join).setOnClickListener(this); + fl_local = view.findViewById(R.id.fl_local); + fl_remote = view.findViewById(R.id.fl_remote); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) + { + super.onActivityCreated(savedInstanceState); + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + try + { + /**Creates an RtcEngine instance. + * @param context The context of Android Activity + * @param appId The App ID issued to you by Agora. See + * How to get the App ID + * @param handler IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + engine = RtcEngine.create(context.getApplicationContext(), getString(R.string.agora_app_id), iRtcEngineEventHandler); + } + catch (Exception e) + { + e.printStackTrace(); + getActivity().onBackPressed(); + } + } + + @Override + public void onDestroy() + { + super.onDestroy(); + /**leaveChannel and Destroy the RtcEngine instance*/ + if(engine != null) + { + engine.leaveChannel(); + } + handler.post(RtcEngine::destroy); + engine = null; + } + + @Override + public void onClick(View v) + { + if (v.getId() == R.id.btn_join) + { + if (!joined) + { + // call when join button hit + String channelId = et_channel.getText().toString(); + // Check permission + if (AndPermission.hasPermissions(this, Permission.Group.STORAGE, Permission.Group.MICROPHONE, Permission.Group.CAMERA)) + { + joinChannel(channelId); + return; + } + // Request permission + AndPermission.with(this).runtime().permission( + Permission.Group.STORAGE, + Permission.Group.MICROPHONE, + Permission.Group.CAMERA + ).onGranted(permissions -> + { + // Permissions Granted + joinChannel(channelId); + }).start(); + } + else + { + joined = false; + /**After joining a channel, the user must call the leaveChannel method to end the + * call before joining another channel. This method returns 0 if the user leaves the + * channel and releases all resources related to the call. This method call is + * asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. + * A successful leaveChannel method call triggers the following callbacks: + * 1:The local client: onLeaveChannel. + * 2:The remote client: onUserOffline, if the user leaving the channel is in the + * Communication channel, or is a BROADCASTER in the Live Broadcast profile. + * @returns 0: Success. + * < 0: Failure. + * PS: + * 1:If you call the destroy method immediately after calling the leaveChannel + * method, the leaveChannel process interrupts, and the SDK does not trigger + * the onLeaveChannel callback. + * 2:If you call the leaveChannel method during CDN live streaming, the SDK + * triggers the removeInjectStreamUrl method.*/ + engine.leaveChannel(); + join.setText(getString(R.string.join)); + } + } + } + + private void joinChannel(String channelId) + { + // Check if the context is valid + Context context = getContext(); + if (context == null) + { + return; + } + + // Create render view by RtcEngine + SurfaceView surfaceView = RtcEngine.CreateRendererView(context); + // Local video is on the top + surfaceView.setZOrderMediaOverlay(true); + // Add to the local container + fl_local.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + // Setup local video to render your local camera preview + engine.setupLocalVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, 0)); + // Set audio route to speaker + engine.setDefaultAudioRoutetoSpeakerphone(true); + + /** Sets the channel profile of the Agora RtcEngine. + CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile. + Use this profile in one-on-one calls or group calls, where all users can talk freely. + CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast + channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; + an audience can only receive streams.*/ + engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); + /**In the demo, the default is to enter as the anchor.*/ + engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_BROADCASTER); + // Enable video module + engine.enableVideo(); + // Setup video encoding configs + engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( + VD_640x360, + FRAME_RATE_FPS_15, + STANDARD_BITRATE, + ORIENTATION_MODE_ADAPTIVE + )); + + /**Please configure accessToken in the string_config file. + * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see + * https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token + * A token generated at the server. This applies to scenarios with high-security requirements. For details, see + * https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/ + String accessToken = getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) + { + accessToken = null; + } + /** Allows a user to join a channel. + if you do not specify the uid, we will generate the uid for you*/ + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); + if (res != 0) + { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + showAlert(RtcEngine.getErrorDescription(Math.abs(res))); + return; + } + // Prevent repeated entry + join.setEnabled(false); + } + + /** + * IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events. + */ + private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() + { + /**Reports a warning during SDK runtime. + * Warning code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_warn_code.html*/ + @Override + public void onWarning(int warn) + { + Log.w(TAG, String.format("onWarning code %d message %s", warn, RtcEngine.getErrorDescription(warn))); + } + + /**Reports an error during SDK runtime. + * Error code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html*/ + @Override + public void onError(int err) + { + Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + } + + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics.*/ + @Override + public void onLeaveChannel(RtcStats stats) + { + super.onLeaveChannel(stats); + Log.i(TAG, String.format("local user %d leaveChannel!", myUid)); + showLongToast(String.format("local user %d leaveChannel!", myUid)); + } + + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) + { + Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + myUid = uid; + joined = true; + handler.post(new Runnable() + { + @Override + public void run() + { + join.setEnabled(true); + join.setText(getString(R.string.leave)); + } + }); + } + + /**Since v2.9.0. + * This callback indicates the state change of the remote audio stream. + * PS: This callback does not work properly when the number of users (in the Communication profile) or + * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the user whose audio state changes. + * @param state State of the remote audio + * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due + * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), + * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). + * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. + * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, + * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). + * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). + * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to + * REMOTE_AUDIO_REASON_INTERNAL(0). + * @param reason The reason of the remote audio state change. + * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. + * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio + * stream or disables the audio module. + * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio + * stream or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or + * disables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream + * or enables the audio module. + * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method + * until the SDK triggers this callback.*/ + @Override + public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteAudioStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Since v2.9.0. + * Occurs when the remote video state changes. + * PS: This callback does not work properly when the number of users (in the Communication + * profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video: + * REMOTE_VIDEO_STATE_STOPPED(0): The remote video is in the default state, probably due + * to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5), + * or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7). + * REMOTE_VIDEO_STATE_STARTING(1): The first remote video packet is received. + * REMOTE_VIDEO_STATE_DECODING(2): The remote video stream is decoded and plays normally, + * probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6), + * or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9). + * REMOTE_VIDEO_STATE_FROZEN(3): The remote video is frozen, probably due to + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8). + * REMOTE_VIDEO_STATE_FAILED(4): The remote video fails to start, probably due to + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0). + * @param reason The reason of the remote video state change: + * REMOTE_VIDEO_STATE_REASON_INTERNAL(0): Internal reasons. + * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1): Network congestion. + * REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY(2): Network recovery. + * REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3): The local user stops receiving the remote + * video stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote + * video stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5): The remote user stops sending the video + * stream or disables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the video + * stream or enables the video module. + * REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8): The remote media stream falls back to the + * audio-only stream due to poor network conditions. + * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9): The remote media stream switches + * back to the video stream after the network conditions improve. + * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method until + * the SDK triggers this callback.*/ + @Override + public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) + { + super.onRemoteVideoStateChanged(uid, state, reason, elapsed); + Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered.*/ + @Override + public void onUserJoined(int uid, int elapsed) + { + super.onUserJoined(uid, elapsed); + Log.i(TAG, "onUserJoined->" + uid); + showLongToast(String.format("user %d joined!", uid)); + /**Check if the context is correct*/ + Context context = getContext(); + if (context == null) return; + handler.post(() -> + { + /**Display remote video stream*/ + SurfaceView surfaceView = null; + if (fl_remote.getChildCount() == 0) + { + // Create render view by RtcEngine + surfaceView = RtcEngine.CreateRendererView(context); + // Add to the remote container + fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + } + else + { + View view = fl_remote.getChildAt(0); + if (view instanceof SurfaceView) + { + surfaceView = (SurfaceView) view; + } + } + + // Setup remote video to render + engine.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); + }); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience.*/ + @Override + public void onUserOffline(int uid, int reason) + { + Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); + showLongToast(String.format("user %d offline! reason:%d", uid, reason)); + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }; +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/AudioRecordService.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/AudioRecordService.java similarity index 98% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/AudioRecordService.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/AudioRecordService.java index 2bd11703b..73bd07b5e 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/AudioRecordService.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/AudioRecordService.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.advanced.custom; +package io.agora.api.example.examples.advanced.customaudio; import android.app.Notification; import android.app.NotificationChannel; diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/CustomAudioRecord.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/CustomAudioRecord.java similarity index 98% rename from Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/CustomAudioRecord.java rename to Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/CustomAudioRecord.java index e2f0e76b0..a960aa5d4 100755 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/custom/CustomAudioRecord.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/CustomAudioRecord.java @@ -1,4 +1,4 @@ -package io.agora.api.example.examples.advanced.custom; +package io.agora.api.example.examples.advanced.customaudio; import android.content.Context; import android.content.Intent; @@ -25,8 +25,8 @@ import io.agora.rtc.IRtcEngineEventHandler; import io.agora.rtc.RtcEngine; -import static io.agora.api.example.examples.advanced.custom.AudioRecordService.RecordThread.DEFAULT_CHANNEL_COUNT; -import static io.agora.api.example.examples.advanced.custom.AudioRecordService.RecordThread.DEFAULT_SAMPLE_RATE; +import static io.agora.api.example.examples.advanced.customaudio.AudioRecordService.RecordThread.DEFAULT_CHANNEL_COUNT; +import static io.agora.api.example.examples.advanced.customaudio.AudioRecordService.RecordThread.DEFAULT_SAMPLE_RATE; /**This demo demonstrates how to make a one-to-one voice call*/ @Example( diff --git a/Android/APIExample/app/src/main/res/layout/fragment_custom_remoterender.xml b/Android/APIExample/app/src/main/res/layout/fragment_custom_remoterender.xml new file mode 100644 index 000000000..786967999 --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/fragment_custom_remoterender.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/Android/APIExample/app/src/main/res/layout/fragment_push_externalvideo.xml b/Android/APIExample/app/src/main/res/layout/fragment_push_externalvideo.xml new file mode 100644 index 000000000..786967999 --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/fragment_push_externalvideo.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml index 6cb1f12e3..8c0439824 100755 --- a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml +++ b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml @@ -33,6 +33,12 @@ + +
+ + diff --git a/Android/APIExample/app/src/main/res/values/string_configs.xml b/Android/APIExample/app/src/main/res/values/string_configs.xml index 9a2fc7bf2..7e270394c 100644 --- a/Android/APIExample/app/src/main/res/values/string_configs.xml +++ b/Android/APIExample/app/src/main/res/values/string_configs.xml @@ -2,4 +2,8 @@ + + + aab8b8f5a8cd4469a63042fcfafe7063 + From e3c45fa721a52805a74baae46300cf782b507478 Mon Sep 17 00:00:00 2001 From: sbd021 Date: Fri, 19 Jun 2020 15:12:28 +0800 Subject: [PATCH 026/430] api example windows --- windows/{API-Example-Windows => }/.gitignore | 0 .../API-Example-Windows.sln | 31 -- .../API-Example-Windows/API-Example-Windows.h | 32 -- .../API-Example-Windows.vcxproj.filters | 96 ---- .../API-Example-WindowsDlg.cpp | 230 -------- .../API-Example-WindowsDlg.h | 41 -- .../API-Example-Windows/CAgora1V1Dlg.cpp | 197 ------- .../API-Example-Windows/CAgora1V1Dlg.h | 59 -- .../res/API-Example-Windows.ico | Bin 33324 -> 0 bytes .../API-Example-Windows/resource.h | 39 -- .../API-Example-Windows/stdafx.cpp | 21 - windows/APIExample/APIExample.sln | 31 ++ windows/APIExample/APIExample/AGVideoWnd.cpp | 307 +++++++++++ windows/APIExample/APIExample/AGVideoWnd.h | 105 ++++ .../APIExample/APIExample.cpp} | 31 +- windows/APIExample/APIExample/APIExample.h | 31 ++ .../APIExample/APIExample.rc} | Bin 19674 -> 23424 bytes .../APIExample/APIExample.vcxproj} | 68 ++- .../APIExample/APIExample.vcxproj.filters | 123 +++++ .../APIExample/APIExample/APIExampleDlg.cpp | 407 ++++++++++++++ windows/APIExample/APIExample/APIExampleDlg.h | 86 +++ .../APIExample/AgoraRtmpInjectionDlg.cpp} | 229 +++++--- .../APIExample/AgoraRtmpInjectionDlg.h} | 52 +- .../APIExample/AgoraRtmpStreaming.cpp} | 517 ++++++++++-------- .../APIExample/AgoraRtmpStreaming.h} | 74 +-- .../APIExample/CAgoraMetaDataDlg.cpp | 402 ++++++++++++++ .../APIExample/APIExample/CAgoraMetaDataDlg.h | 93 ++++ windows/APIExample/APIExample/CConfig.cpp | 49 ++ windows/APIExample/APIExample/CConfig.h | 22 + .../APIExample/CLiveBroadcastingDlg.cpp | 406 ++++++++++++++ .../APIExample/CLiveBroadcastingDlg.h | 84 +++ .../APIExample/APIExample/CSceneDialog.cpp | 17 + windows/APIExample/APIExample/CSceneDialog.h | 17 + windows/APIExample/APIExample/Language.h | 76 +++ windows/APIExample/APIExample/en.ini | 63 +++ .../APIExample/APIExample/res/APIExample.ico | Bin 0 -> 67777 bytes .../APIExample/res/APIExample.rc2} | Bin 818 -> 804 bytes windows/APIExample/APIExample/resource.h | 64 +++ windows/APIExample/APIExample/stdafx.cpp | 189 +++++++ .../APIExample}/stdafx.h | 24 +- .../APIExample}/targetver.h | 0 windows/APIExample/APIExample/zh-cn.ini | 64 +++ windows/APIExample/README.md | 68 +++ windows/APIExample/README.zh.md | 68 +++ 44 files changed, 3350 insertions(+), 1163 deletions(-) rename windows/{API-Example-Windows => }/.gitignore (100%) delete mode 100644 windows/API-Example-Windows/API-Example-Windows.sln delete mode 100644 windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.h delete mode 100644 windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj.filters delete mode 100644 windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.cpp delete mode 100644 windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.h delete mode 100644 windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.cpp delete mode 100644 windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.h delete mode 100644 windows/API-Example-Windows/API-Example-Windows/res/API-Example-Windows.ico delete mode 100644 windows/API-Example-Windows/API-Example-Windows/resource.h delete mode 100644 windows/API-Example-Windows/API-Example-Windows/stdafx.cpp create mode 100644 windows/APIExample/APIExample.sln create mode 100644 windows/APIExample/APIExample/AGVideoWnd.cpp create mode 100644 windows/APIExample/APIExample/AGVideoWnd.h rename windows/{API-Example-Windows/API-Example-Windows/API-Example-Windows.cpp => APIExample/APIExample/APIExample.cpp} (83%) create mode 100644 windows/APIExample/APIExample/APIExample.h rename windows/{API-Example-Windows/API-Example-Windows/APIExampleWindows.rc => APIExample/APIExample/APIExample.rc} (54%) rename windows/{API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj => APIExample/APIExample/APIExample.vcxproj} (78%) create mode 100644 windows/APIExample/APIExample/APIExample.vcxproj.filters create mode 100644 windows/APIExample/APIExample/APIExampleDlg.cpp create mode 100644 windows/APIExample/APIExample/APIExampleDlg.h rename windows/{API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.cpp => APIExample/APIExample/AgoraRtmpInjectionDlg.cpp} (52%) rename windows/{API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.h => APIExample/APIExample/AgoraRtmpInjectionDlg.h} (69%) rename windows/{API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.cpp => APIExample/APIExample/AgoraRtmpStreaming.cpp} (55%) rename windows/{API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.h => APIExample/APIExample/AgoraRtmpStreaming.h} (61%) create mode 100644 windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp create mode 100644 windows/APIExample/APIExample/CAgoraMetaDataDlg.h create mode 100644 windows/APIExample/APIExample/CConfig.cpp create mode 100644 windows/APIExample/APIExample/CConfig.h create mode 100644 windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp create mode 100644 windows/APIExample/APIExample/CLiveBroadcastingDlg.h create mode 100644 windows/APIExample/APIExample/CSceneDialog.cpp create mode 100644 windows/APIExample/APIExample/CSceneDialog.h create mode 100644 windows/APIExample/APIExample/Language.h create mode 100644 windows/APIExample/APIExample/en.ini create mode 100644 windows/APIExample/APIExample/res/APIExample.ico rename windows/{API-Example-Windows/API-Example-Windows/res/APIExampleWindows.rc2 => APIExample/APIExample/res/APIExample.rc2} (79%) create mode 100644 windows/APIExample/APIExample/resource.h create mode 100644 windows/APIExample/APIExample/stdafx.cpp rename windows/{API-Example-Windows/API-Example-Windows => APIExample/APIExample}/stdafx.h (82%) rename windows/{API-Example-Windows/API-Example-Windows => APIExample/APIExample}/targetver.h (100%) create mode 100644 windows/APIExample/APIExample/zh-cn.ini create mode 100644 windows/APIExample/README.md create mode 100644 windows/APIExample/README.zh.md diff --git a/windows/API-Example-Windows/.gitignore b/windows/.gitignore similarity index 100% rename from windows/API-Example-Windows/.gitignore rename to windows/.gitignore diff --git a/windows/API-Example-Windows/API-Example-Windows.sln b/windows/API-Example-Windows/API-Example-Windows.sln deleted file mode 100644 index 8fef2053c..000000000 --- a/windows/API-Example-Windows/API-Example-Windows.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.852 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "API-Example-Windows", "API-Example-Windows\API-Example-Windows.vcxproj", "{2338FC2F-D442-4C43-8BC2-0801F9207139}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Debug|x64.ActiveCfg = Debug|x64 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Debug|x64.Build.0 = Debug|x64 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Debug|x86.ActiveCfg = Debug|Win32 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Debug|x86.Build.0 = Debug|Win32 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Release|x64.ActiveCfg = Release|x64 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Release|x64.Build.0 = Release|x64 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Release|x86.ActiveCfg = Release|Win32 - {2338FC2F-D442-4C43-8BC2-0801F9207139}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C5D52715-CCC3-494E-84E0-AF7CC324843C} - EndGlobalSection -EndGlobal diff --git a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.h b/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.h deleted file mode 100644 index 9f9ff68a5..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.h +++ /dev/null @@ -1,32 +0,0 @@ - -// API-Example-Windows.h : main header file for the PROJECT_NAME application -// - -#pragma once - -#ifndef __AFXWIN_H__ - #error "include 'stdafx.h' before including this file for PCH" -#endif - -#include "resource.h" // main symbols - - -// CAPIExampleWindowsApp: -// See API-Example-Windows.cpp for the implementation of this class -// - -class CAPIExampleWindowsApp : public CWinApp -{ -public: - CAPIExampleWindowsApp(); - -// Overrides -public: - virtual BOOL InitInstance(); - -// Implementation - - DECLARE_MESSAGE_MAP() -}; - -extern CAPIExampleWindowsApp theApp; diff --git a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj.filters b/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj.filters deleted file mode 100644 index 3f044c206..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj.filters +++ /dev/null @@ -1,96 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {9dd91176-d193-43d5-81b7-29b569354c08} - - - {c9bd8487-5034-44ea-87af-024907a3d076} - - - {75fc07e2-935d-4c8b-aaea-bc1740a59b25} - - - {cfa9ef13-7ec9-491f-8a27-2ddb1d8a2d50} - - - {11ea4160-a584-42b0-80f1-323436cfbfe0} - - - {1ffff1e1-2b56-4ca5-a457-5b92c01a5e19} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - AgoraScenes\BasicAudioVideo\1V1 - - - AgoraScenes\LiveStreaming\RtmpInjection - - - AgoraScenes\LiveStreaming\RtmpStreaming - - - - - Source Files - - - Source Files - - - Source Files - - - AgoraScenes\BasicAudioVideo\1V1 - - - AgoraScenes\LiveStreaming\RtmpInjection - - - AgoraScenes\LiveStreaming\RtmpStreaming - - - - - Resource Files - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.cpp b/windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.cpp deleted file mode 100644 index 5d4043f72..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.cpp +++ /dev/null @@ -1,230 +0,0 @@ - -// API-Example-WindowsDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "API-Example-Windows.h" -#include "API-Example-WindowsDlg.h" -#include "afxdialogex.h" -#include "CAgora1V1Dlg.h" -#include "CAgoraRtmpInjectionDlg.h" -#include "CAgoraRtmpStreamingDlg.h" -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CAboutDlg dialog used for App About - -class CAboutDlg : public CDialogEx -{ -public: - CAboutDlg(); - -// Dialog Data -#ifdef AFX_DESIGN_TIME - enum { IDD = IDD_ABOUTBOX }; -#endif - - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - -// Implementation -protected: - DECLARE_MESSAGE_MAP() -}; - -CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) -{ -} - -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); -} - -BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) -END_MESSAGE_MAP() - - -// CAPIExampleWindowsDlg dialog - - - -CAPIExampleWindowsDlg::CAPIExampleWindowsDlg(CWnd* pParent /*=nullptr*/) - : CDialogEx(IDD_APIEXAMPLEWINDOWS_DIALOG, pParent) -{ - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); -} - -void CAPIExampleWindowsDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_TREE_INFO, m_treeCtrl); -} - -BEGIN_MESSAGE_MAP(CAPIExampleWindowsDlg, CDialogEx) - ON_WM_SYSCOMMAND() - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_NOTIFY(TVN_SELCHANGED, IDC_TREE2, &CAPIExampleWindowsDlg::OnTvnSelchangedTree2) - ON_NOTIFY(NM_DBLCLK, IDC_TREE_INFO, &CAPIExampleWindowsDlg::OnDblclkTreeInfo) -END_MESSAGE_MAP() - - -// CAPIExampleWindowsDlg message handlers - -BOOL CAPIExampleWindowsDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // Add "About..." menu item to system menu. - - // IDM_ABOUTBOX must be in the system command range. - ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); - ASSERT(IDM_ABOUTBOX < 0xF000); - - CMenu* pSysMenu = GetSystemMenu(FALSE); - if (pSysMenu != nullptr) - { - BOOL bNameValid; - CString strAboutMenu; - bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); - ASSERT(bNameValid); - if (!strAboutMenu.IsEmpty()) - { - pSysMenu->AppendMenu(MF_SEPARATOR); - pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); - } - } - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - InitItems(); - return TRUE; // return TRUE unless you set the focus to a control -} - -void CAPIExampleWindowsDlg::OnSysCommand(UINT nID, LPARAM lParam) -{ - if ((nID & 0xFFF0) == IDM_ABOUTBOX) - { - CAboutDlg dlgAbout; - dlgAbout.DoModal(); - } - else - { - CDialogEx::OnSysCommand(nID, lParam); - } -} - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CAPIExampleWindowsDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CDialogEx::OnPaint(); - } -} - -// The system calls this function to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR CAPIExampleWindowsDlg::OnQueryDragIcon() -{ - return static_cast(m_hIcon); -} - -void CAPIExampleWindowsDlg::OnTvnSelchangedTree2(NMHDR *pNMHDR, LRESULT *pResult) -{ - LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); - // TODO: Add your control notification handler code here - *pResult = 0; -} - -void CAPIExampleWindowsDlg::InitItems() -{ - std::vector vecSubItems; - //Basic Audio Video - vecSubItems.push_back(L"1V1"); - mapItems.insert(std::make_pair(L"Baisc Audio Video", vecSubItems)); - - //Live Broadcasting - vecSubItems.clear(); - vecSubItems.push_back(L"RTMP Injection"); - vecSubItems.push_back(L"RTMP Streaming"); - mapItems.insert(std::make_pair(L"Live Streaming", vecSubItems)); - - for (auto iter = mapItems.begin(); iter != mapItems.end(); ++iter){ - TVINSERTSTRUCT tvInsert; - tvInsert.hParent = NULL; - tvInsert.hInsertAfter = NULL; - tvInsert.item.mask = TVIF_TEXT; - tvInsert.item.pszText = iter->first.AllocSysString(); - HTREEITEM hMainItem = m_treeCtrl.InsertItem(&tvInsert); - SysFreeString(tvInsert.item.pszText); - m_treeCtrl.SetItemState(hMainItem, TVIS_BOLD, TVIS_BOLD); - - std::vector vecSubItems = iter->second; - for (size_t i = 0; i < vecSubItems.size(); ++i){ - HTREEITEM hSubItem = m_treeCtrl.InsertItem(TVIF_TEXT, - vecSubItems[i], 0, 0, 0, 0, 0, hMainItem, NULL); - } - m_treeCtrl.Expand(hMainItem, TVE_EXPAND); - } -} - -void CAPIExampleWindowsDlg::OnDblclkTreeInfo(NMHDR *pNMHDR, LRESULT *pResult) -{ - if (strlen(APP_ID) == 0) { - AfxMessageBox(_T("APP_ID is empty, define APP_ID in stdafx.h")); - return ; - } - // TODO: Add your control notification handler code here - *pResult = 0; - - HTREEITEM hItem = m_treeCtrl.GetSelectedItem(); - - if (!m_treeCtrl.ItemHasChildren(hItem)) { - CString itemText = m_treeCtrl.GetItemText(hItem); - if (itemText.Compare(_T("1V1")) == 0) { - ShowWindow(SW_HIDE); - CAgora1V1Dlg dlg; - dlg.DoModal(); - ShowWindow(SW_SHOW); - } - else if (itemText.Compare(_T("RTMP Injection")) == 0) { - ShowWindow(SW_HIDE); - CAgoraRtmpInjectionDlg injectDlg; - injectDlg.DoModal(); - ShowWindow(SW_SHOW); - } - else if (itemText.Compare(_T("RTMP Streaming")) == 0) { - ShowWindow(SW_HIDE); - CAgoraRtmpStreamingDlg dlg; - dlg.DoModal(); - ShowWindow(SW_SHOW); - } - } -} diff --git a/windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.h b/windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.h deleted file mode 100644 index 6ef105cb1..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/API-Example-WindowsDlg.h +++ /dev/null @@ -1,41 +0,0 @@ - -// API-Example-WindowsDlg.h : header file -// - -#pragma once -#include -#include -// CAPIExampleWindowsDlg dialog -class CAPIExampleWindowsDlg : public CDialogEx -{ -// Construction -public: - CAPIExampleWindowsDlg(CWnd* pParent = nullptr); // standard constructor - -// Dialog Data -#ifdef AFX_DESIGN_TIME - enum { IDD = IDD_APIEXAMPLEWINDOWS_DIALOG }; -#endif - - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - void InitItems(); - -// Implementation -protected: - HICON m_hIcon; - - // Generated message map functions - virtual BOOL OnInitDialog(); - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnTvnSelchangedTree2(NMHDR *pNMHDR, LRESULT *pResult); -private: - CTreeCtrl m_treeCtrl; - std::map > mapItems; -public: - afx_msg void OnDblclkTreeInfo(NMHDR *pNMHDR, LRESULT *pResult); -}; diff --git a/windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.cpp b/windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.cpp deleted file mode 100644 index c2195e1ca..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.cpp +++ /dev/null @@ -1,197 +0,0 @@ -// CAgora1V1Dlg.cpp : implementation file -// - -#include "stdafx.h" -#include "API-Example-Windows.h" -#include "CAgora1V1Dlg.h" -#include "afxdialogex.h" - -void CAgora1V1RtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) -{ - if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); - } -} - -void CAgora1V1RtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) { - if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); - } -} - -void CAgora1V1RtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) -{ - if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); - } -} - -void CAgora1V1RtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) -{ - if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); - } -} -// CAgora1V1Dlg dialog - -IMPLEMENT_DYNAMIC(CAgora1V1Dlg, CDialogEx) - -CAgora1V1Dlg::CAgora1V1Dlg(CWnd* pParent /*=nullptr*/) - : CDialogEx(IDD_DIALOG_JOINCHANNEL, pParent) -{ - -} - -CAgora1V1Dlg::~CAgora1V1Dlg() -{ -} - -void CAgora1V1Dlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); - DDX_Control(pDX, IDC_STATIC_REMOTE, m_remoteVideoWnd); - DDX_Control(pDX, IDC_STATIC_LOCALVIDEO, m_localVideoWnd); - DDX_Control(pDX, ID_JOINCHANNEL, m_btnJoinChannel); - DDX_Control(pDX, IDC_STATIC_INFO, m_staInfo); -} - - -BEGIN_MESSAGE_MAP(CAgora1V1Dlg, CDialogEx) - ON_BN_CLICKED(ID_JOINCHANNEL, &CAgora1V1Dlg::OnBnClickedJoinchannel) - ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgora1V1Dlg::OnEIDJoinChannelSuccess) - ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgora1V1Dlg::OnEIDLeaveChannel) - ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgora1V1Dlg::OnEIDUserJoined) - ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgora1V1Dlg::OnEIDUserOffline) - - ON_WM_DESTROY() -END_MESSAGE_MAP() - - -// CAgora1V1Dlg message handlers - -BOOL CAgora1V1Dlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: Add extra initialization here - m_rtcEngine = createAgoraRtcEngine(); - if (!m_rtcEngine) { - m_staInfo.SetWindowText(_T("createAgoraRtcEngine failed")); - return TRUE; - } - m_eventHandler1V1.SetMsgReceiver(m_hWnd); - - RtcEngineContext context; - context.appId = APP_ID; - context.eventHandler = &m_eventHandler1V1; - m_rtcEngine->initialize(context); - int ret = m_rtcEngine->initialize(context); - if (ret != 0) { - m_initialize = false; - m_staInfo.SetWindowText(_T("initialize failed")); - return TRUE; - } - else - m_initialize = true; - - m_rtcEngine->enableVideo(); - m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); - m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); - - m_rtcEngine->startPreview(); - - VideoCanvas canvas; - canvas.renderMode = RENDER_MODE_FIT; - canvas.uid = 0; - canvas.view = m_localVideoWnd.GetSafeHwnd(); - m_rtcEngine->setupLocalVideo(canvas); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CAgora1V1Dlg::OnBnClickedJoinchannel() -{ - if (!m_rtcEngine || !m_initialize) - return; - if (!joinChannel) { - CString strChannelName; - m_edtChannelName.GetWindowText(strChannelName); - if (strChannelName.IsEmpty()) { - AfxMessageBox(_T("Fill channel name first")); - return; - } - - std::string szChannelId = cs2utf8(strChannelName); - if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { - m_btnJoinChannel.EnableWindow(FALSE); - } - } - else { - if (0 == m_rtcEngine->leaveChannel()) { - m_btnJoinChannel.EnableWindow(FALSE); - } - } -} - -void CAgora1V1Dlg::OnDestroy() -{ - if (m_rtcEngine) { - m_rtcEngine->stopPreview(); - m_rtcEngine->disableVideo(); - m_rtcEngine->release(true); - } - CDialogEx::OnDestroy(); -} - -LRESULT CAgora1V1Dlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) -{ - m_btnJoinChannel.EnableWindow(TRUE); - joinChannel = true; - m_btnJoinChannel.SetWindowText(_T("LeaveChannel")); - - CString strInfo; - strInfo.Format(_T("join channel success")); - m_staInfo.SetWindowText(strInfo); - return 0; -} - -LRESULT CAgora1V1Dlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) -{ - m_btnJoinChannel.EnableWindow(TRUE); - joinChannel = false; - m_btnJoinChannel.SetWindowText(_T("JoinChannel")); - - CString strInfo; - strInfo.Format(_T("leave channel")); - m_staInfo.SetWindowText(strInfo); - return 0; -} - -LRESULT CAgora1V1Dlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) -{ - uid_t remoteUid = (uid_t)wParam; - VideoCanvas canvas; - canvas.renderMode = RENDER_MODE_FIT; - canvas.uid = remoteUid; - canvas.view = m_remoteVideoWnd.GetSafeHwnd(); - m_rtcEngine->setupRemoteVideo(canvas); - - CString strInfo; - strInfo.Format(_T("%u joined"), remoteUid); - m_staInfo.SetWindowText(strInfo); - return 0; -} - -LRESULT CAgora1V1Dlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) -{ - uid_t remoteUid = (uid_t)wParam; - VideoCanvas canvas; - canvas.uid = remoteUid; - canvas.view = NULL; - m_rtcEngine->setupRemoteVideo(canvas); - CString strInfo; - strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); - m_staInfo.SetWindowText(strInfo); - return 0; -} diff --git a/windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.h b/windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.h deleted file mode 100644 index 7614a98e4..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/CAgora1V1Dlg.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - - -// CAgora1V1Dlg dialog - -class CAgora1V1RtcEngineEventHandler - : public IRtcEngineEventHandler -{ -public: - CAgora1V1RtcEngineEventHandler() {} - ~CAgora1V1RtcEngineEventHandler() {} - void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } - virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; - virtual void onUserJoined(uid_t uid, int elapsed) override; - virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override; - virtual void onLeaveChannel(const RtcStats& stats) override; -private: - HWND m_hMsgHanlder; -}; - - -class CAgora1V1Dlg : public CDialogEx -{ - DECLARE_DYNAMIC(CAgora1V1Dlg) - -public: - CAgora1V1Dlg(CWnd* pParent = nullptr); // standard constructor - virtual ~CAgora1V1Dlg(); - -// Dialog Data -#ifdef AFX_DESIGN_TIME - enum { IDD = IDD_DIALOG_JOINCHANNEL }; -#endif - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedJoinchannel(); - //Agora Event handler - afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); - virtual BOOL OnInitDialog(); -private: - IRtcEngine* m_rtcEngine; - CAgora1V1RtcEngineEventHandler m_eventHandler1V1; - bool joinChannel = false; - bool m_initialize = false; -public: - CEdit m_edtChannelName; - CStatic m_remoteVideoWnd; - CStatic m_localVideoWnd; - CButton m_btnJoinChannel; - afx_msg void OnDestroy(); - CStatic m_staInfo; -}; diff --git a/windows/API-Example-Windows/API-Example-Windows/res/API-Example-Windows.ico b/windows/API-Example-Windows/API-Example-Windows/res/API-Example-Windows.ico deleted file mode 100644 index 773279127444d1a08ca2934f1ae04bf56fc29a4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33324 zcmeHw2_RM5_y0DF%$bQ&NeE43PHB=TC55P-C=tm}#7(7vXy%pBNEsqBW)>+?X*5en z=J|5D=fBS7a`n7kec$)@`+nd5*RFHV+Iz3P_S)<0v(H|8pYwqb9b!X@irfexMr6Z` z&|RP;B}d|4=n>*%L5Q1sBtDl8p}r{y_<;$rq6kiernBSxqj6S*@`Z8!k+=;LLiRHe z;^4sJh$BP-p?A{M@{%ZGHbMtiQOiRd%8A)g%S$2~MuhT?AT$>W<5gP1K?i!`fiQBS z&=Y?MkO?US!pI4JfrNvAva+%u1Ec&$7=}}Dz&|_*kN*n)0~YZ0RXc@?CHglsG=2%7 z*5I3xl9HAT$!*0Do>G&EDe>{~DQW>&O9LL-sp%>4DalYGxv!z6v8AQu%V;_=?HULt zsa>-#E&*8$Eu-nAYbrS9t88D4pZ$wR1^KFZ;c?$9_LMW(ezfA06g(Lty4sH@SZq&; zWASMtXP4b0=Z40S^R=Lnv%TlY*>AMsF@Ecj^tMqsqw+DA(YQy$NWSki%9-f0k5Vrf zV>DgO3nxg*Z4|}H#ryFnBwV8uNJ-jfgGc@COYjqflr%SJ)-~le+%*2h#T0Rn?z=SY z8W=j%uK_pcnB6ciTuOY}wE$vE1DLac$_^#~OQ*yqV`TecdwY;M7Kpy?YVN)P*r~=w zF!`_W@3#O9N58^<&;s~#MiLHfIH=DV1kb?90|6c?kOR*Z$_ajf{Kr0LP9@_*fWQB# zk&%Fu0%HRPLqi)SPK0PmvOkOnBLfQwGJWGc_hZDCcKkl@#Yfvfd~EZlj7uq*K>FY$ zu?>DO7|$`RZ$BQ-$Kxq@+y_P~j7-T-%LMWyg`YA2o=%2%5$fML32&30%eHaW< z@yY(64$cDsS1^bO0~sz84@BQnnefOtH4^*p`h{Ne9}Rdv$ERqLa8Ua>0qDsC0XjA0 zKOkPPYAW%7e}p8Gf`Xg9Mtwe2DQb?qPDpCsO_N=YL8!p z+7lL|_D4%mN0KHw8n^{TTwjJdQkKK90(GRVMxE*FQD??R)S0;nb!KfwUD;bvSB^RA zF4%**3+++QvjeE7$OZMhID~pjJds|YKQg{TK!VrbA*tYewB+_PL>JnF1a8zI6xM^7 zZuBCyTfK<=b}!<*(~G8s_adQty-56iADS7}hvvleA(;n#XntHDTJW$REsF0)ixc|M z(ntMBE2$qXPw7XxaI8-2N9)sxXk!KuZOSAf^IRhO?FkX>Ef_%dg#*a(*#J89VgPxT z45Hqb-l+H0an%3uchp~Y9rc%oA!5~CM6AA#h&54Y;L}4iP?v}X>Qm9_(m@pPb`YI= zH;8`!KtdtqBy_8igzi<5P;?Cm#eE{7#Lq)0rG5wvHsztg=0Zejd4Wi+uhCG)N0iqz zgq}AKqvDof^s03jee4)UP5op<9_&VBQV${z^`ou|#2++p0H8dvhv;TpgkB^pL zS7V|+v;RV$&2Wuq+H0%K%F1auE)d$wBQqX_YXtV8wdYc1R&KGe27AhZeJp7Cv9)l$ zOh!|@HfX5PvGDN7Pzx*o@gmg72$L(cSi=zSmtOllEu8||9KhS7LDPafv z8X7Cs>+9fWZ5MM;fsapU)+`YUv0$|B@sk7IG4Vc%2Ur0z7oc=y3OC;$*)hz03$D{h z(6Kp;In5g3<>M2d(09hG@Uk^ozgBmJ?%MU6ZSbz`v_M)+L`v~bxW~)=qJCN6zr_Oo zCnkFT#f_Y}ZZ+zsGSVna30a~Sxb zH<`izoPt{JaG;jEJQN?aB|-qT+!IEvkrLpCN`n6>2fn8w#rMShOx(Zh&fg8ko>5=Y z4fPazAhD2Aq!5||K4ULp1fP)=d`1rN7kTgYB7q3pXY51MBm0mf_>6PGUzCmQL-OD= zDn9H(i@|5aeZw7jL}Z;mfcAh-X!mpg9RQ!urDy=T7mxUbT_xZbzC4P0OV6ObH@p^t(4fu-SFJ3Pr zp>XgKBdbUJ#Ms&)lnQ=gdczQ^{#1f0>t3Vgx*XI3$6#X?_>4t})bKJXj+hkza;qJdw&BTa|>MgF@j z0MCkFe(DcCFb$U|F47-yhPG;mi3p3TE~A-`ZIhM6!<=;(W+KQ&2|POEk_{nGN^TDP zuF;vw#>T@BKb+KQEr#uwB`Jlw0fuuVr?ay0;RQ9OvWcX`jIyNr@?J6vIIKIJZ;FW2RslDcMKNb3zKx{OehW4(1y8`ZNcuP4mD!17CmEhBfESu)e%4n~1i<8nZ3TBf8$4 zL&VBEuyz~+Ysc|0H-NQcm>&!_W+H!>3&g-Wabn#NWt})}be)*g`Vzf>HDSv0y|*3> z_cftmVjHT1=X-rG8GY#^qc$Qu*Gavo7oPFIp6x%|Q-1OPU$p=XSpSxJip*?93|k;Q zeTE!91S$#ePUD>^#=^qDG!Ksp^DAIdT=e4DJXTIT&Nmx=rm(@!be8crJ054k<03de z_c;GTVO~C7K~V-4hN+{=nhJAf%V2Ud=HlFcH~igef7)>UDh@UgHju-yX7!4VBb$_T zh!x)NLuLmeb|WNVwPwY#O>V)hmF{kv-lk}Ew3oT}6@6Zi!p%CR-@(_LFq4&;X-e44 z#LIQ}-q{*FN__OzX?m}E;;Pms#=~196IYcFsX9;^9*TAFm+G;kzR(RK=mM^l{ftQ5_r`8$M z2R&D5)IuE=>yv!AFSuw~26sO~cb8W3>Z~q{-WA-v zR!2@IG=ujRl3cNK8alq(kDkDNdIRE~sltK9x5Yv7Q(D#Wc|bMU4j;7Wh|9 zoxUF#ETTKTyJLk>0ZUJAjWKu#dq~Q@iunJv!}9hWnYrPO}lQJA3Ga z-PRbpw6UmO3R)9j-KoP?7}Ih#(3uSJD*(D0@=l?S0vuV-7nTYa_#z+y1~uwc$nEwGAZ6W_qxVy8oGX3!ut^> zZ$jFBa&y|$3LEECU6~u7&-yHI5O{N8t0Bt^2JhKA&CN?X`sl=cBl+BHGv|Ni&v-Cr z+Mq*a1d5r@Zt0Mic35|P7*fgi%PH&TEfV)STG_#)Vo)M`>DpXf>s;k75#svHM@Q6W zu2~$tWct0mxlU=kHtUnS+anZxo^9kv3V5C~lzp}Ig`-~&ou#rJA>{~9RHXtzlqdXJ z9qU~i!$E!T*Ipu*UVk(^x&6wUuuqAxCs>q|Y6r}x2qn6P7+d#s*T$UwnCy{UZ6!7P zp0pkM@aVavN1v@puY_vlv{iFYSZj+Pka@FAP)Ar%+%Wz^%p;9`b#405ZdMOC%X1CF z;|At=D#?hxzr+-5zqV|(AnMC@EjJiiF0r)oQo^qL5*e?mkEu404A0!{N!eaR-$qjR zS#`fGEUjj6`=xG{y~NTUvvqTy4$&>&Lr;+SIQ2-Yf#qATnuA7SwW1l^WpApF)lU`N z*nU|=JSlp=uKpX|jU{%QPSn0D^-k_D+V^=+QB%Y1bqy>89-q!81xx#3zGOSq%Bu;x z&al~)h1Q6Yme1(D>g+H2Zbj!deVx@BNwP1DV~IoD4VQjv(B83Pxdd)BZ@O zR2ly%MIM}cKQ7kU8@)%-@$FaEzDK(oBFXpW`hkhI65rn57a{yk_-PSRG`-<9^gz*7 zz4f4;SiLNXb7-N(7bkJf8qCf@IO|P<|-vw=gSQionC<6`AeU7 zBbliV1jL=y9CkDE-c@`-0Ai&=NlMmh*sD}uCS^vO{AcAG#S-==kxOVn|if@KM8d3wjf~ms-gJ4OLr$?N7_zd(t>l zvEN+#d2?rp$H$#J+FmPi=6@Dx(aYZ-{<)^Ov(Vt?fvZUjS$>jnEi+}LdwYD!yynph z&Sy&SwwEw<>bdNd`J2@6k7E1JvuyrHzPn!&j4a9&^$T~EV& ziT6P@$qrkC)|0mn7M2+g*##&Uta&VqcFXcUS2*fybGB5zb81=>UtZv*kOS)^_tJL< zo{Wpu%_!V>#LCIPS<}yQYjl6U-ecD(md&f>GKGv==Y^ZnUs=q()^n*z+iFF5u9rHN z+gM}I_FX=)n^C=rRqZi{`eTNQeNL%`h9~8;EsL8~G)YSdOtLv{)|qPCpFH%Kx~r?q zwXaEH6SrzAN6_7{UB0og*>SRacbNKKPJE%8dNEQd%G8kHI8e29c})s>i8l9gKT-T|CXQB&qhThBq$G|N@C8$FYo;soPn zH`8}4+9#tax8(`L#rV$aJanrB-gvy)SsS9S^f*;nd3izS(h5Fm@SxN6 zg4wFEi|!N{cCF0zDy}nRE-`3wJe+qXo7keP7&(2-$D(`-Y5V;6^LtJ)tqPm%>ao_J z4qeT0C?LuWd2C$r&|GmzUojm+lBbxivr6xN=VH;%1+Ncjgc9l*-?I=>S`A*lue$Jh zmrZyzo87bJgikSrVneI>dD|_fkQ^?*Ol4`^S)|@I*WsYo@rI$M)i$4!SS2jJ>SU|0)t3+LFrJ>VFekLDZr1a+bXihr++M@$92Q==Fj!=PFu(9H zPEz=#H-b55mRY#6!&8CBxGU$K*3K>ETaInIa^b8`&eocBX0E;NyS#~Y31(X!e+_*G z&nkNpK3(6CRHbvT_c56&$R2Es(TT~>ex*fDx^#VLZN$`UJuR31LN2s-$q>Imu2!p~ zBAxV?1-8sCPnKI~9T#72Umm0Rp1Dl9#LZ*d{E!$2oEKYE6wn(e5GHpi)#qLQzM)U0 zZ`4ofI@ob#X(mtWv^rw?+;iUA%r&gV?pugw6*s;p>sJ0Ev7Nwd?@`Ix?g{=ntK1(A@FG?UGWu7y3dZ~6-b2_$J zg*2}BM02Msh{{lruok?tyKjBYCt{^QqxDgj{L6HfZ6>okYS?Wu`Hdag%F~0h8|Oa@ z^R3lt7gl^nvVBG>&nU0&kN-rfjXzv%Zsk||d$&%q+c{U|;-dFLRUy{`ULCrZB1UX) zbzC&7;{8V#3*^Ap(7`KNGRm#i~Uza)4SsM4YU5=La;A{8UsJg|?JbXY_U|FGPWoz9`b(Xi%enX+W zN$16@OK+X@FE)yc$Psm_a^Gct&nHd#Om%&@Zc=Bzh-*}`dj4iQ%l8j_-X<@z(Ra>T z`f|?jMjQS29Vco+2j1IPPajHmlox6r&@*uHkT6kBXF8!YoHOEPr(&?|^p{k!^jiZZwSS((L zpjJIg6x;IJFSw`F=&NIG(i5>)jfb!Dv=KAET+GsIxUzRHznf`C376^W+9iw{4IXfh zxExDPBN2T(7v8GwZ}(Sq(+n!B(%1T}@5q&qYE}BMBLQgx$I`W`wYJV<$XL3`3~gId zP<*Pp+gqFqO|PP}KUIElyUe|5#?LQaLYF?Vp{c2F`)}-iv5$*zW+w+-L8yH3Rr8rH zyK52!*wBYs@tnO%`C(VgB*7l{?p*$0&!zWu7~>l#>eC}U+t@z8m*2|e^p!UYT8uuf zrF)st9y(WUk*d@cQs3o`>I}`TQ*`z!*)OYA-962^EulJO9_Io-f#etciHlm+Rfsn- zXj^h=7i#I7$SW9i8RWXSC&wPX|JJ9pO9sA=8&-RhpsL08#SMKpU$tM`ah_bJnTfms z`;{8*c7-T2&TSibFLk$O@?B;uape zZM*Wh_iT}Gf3qSphiN=As_Cgz7i@{HaYLtC=sFy_l#`0)o?hwKXnOpz?@ZCN^B+IB z&bOktT0-dHP><6x^cxqC@pJndu$GZ#C42Y&wG(gSFYVhBW#+_iUeC=yP$gPrt3L~2 zrUO}X|Hrj;2(|bG80K@L$_k~3aJj{&0z_;Uyxeh}og=4{X&SPm-_qe|pL^dz9{R^t z=SYM+H|O#BWgB~&Y+gkdn_5MXw+uM3E1zEl>$_h^7xwwIdA9ZYm}%QeoRX)ckr|No zy?6bGci?Hq})&>2(J5_kws# z7JIc56Lf~B8V>fYSeWpDzUJ-K<1c@A*xnUYQ-0W@<%0MXa~`zz-iPZR(HaVC2J8u2 zhvkwF4SkyDzl@xCyVasf&!nQWL?FmS(R*P6r#QQkc;h`B1+FQt^ zQ$Ux@bE31}i!HKoN(CXM{>H@&bqmvL2iH_uFnZ<;CY?-7$Yy%}q4aBIhzu zPB>NA`62N4kHah#ya>IyQO&(AK$Zv9kq_+@0hl_s|w2WEZ4SgcP{fjmO4b1+HCjXtGB4>?bq_n+isZd zWKs95c~~BqHV2_B<*#Wuw%b?&bBo^4EmJ$1N7{1C)ZDf6h@z54a-`r1{yc^|=9)T5 zDlwi~^heWoZ5b$0s59|2Y>|Jg7te2|nx|3em1RX2=1*J_WKiMqu0Tk%{di@g+IgRoe>=qPvMMjYZs>D@+|**1 z%BF@4WVtjq%wIrD0O4-)EaUl%``R;hempB7)mc?vxAE|jFG^!QE8f%uCCRlE9%0B~E*Prc z5f#C&_QkbGye{5wn#0E@*oK&?=!zQe*NA2#nENlcL&4|Z{}&PzTLtY$Gx z7YHl2L}@Knfz_2SG+P@Cc)Xn0T9!-PZ4uIOV9&qn9`+!EzJk}OsVlAKRtG5~LsY-Q zf_^ypgjV5N6R|B({xxm-O03gY@wMeHpL6%|A;!=p;cc($Yh{)`b@r?aH9BC2Bu%E; zbuq|j9Is53I6XUlhy5XL`-&CE!8eOb;LUIBKgM2hX6@0l(mGyWgt$K!opdO6+tItU z(XFOiXkK7qjdsxyKBj$$%YIKTlis%2%*DLJDE?^Yz$0#agP>4~{74rD7-G6k}rtZT|M$nQ3FEUE~* zpv08Xb?t_JDhunC+e2>GGoo+i#&A#M^gg=A@p&0R|wk=*+46rNNaHU$Oni!uT9&m3NF~8!2rt}PJlWqQc zB-}*7Ho2-j0SRJUC@2%1XII`)=02d4l=gM4ZXC>6V*Z$-D1Q!Fwc@`&Bdlu}|+==^$d4&!jleGXT92N%bH93h{^d2>sQl$IDgA%uCK%jbSA{3WAZ^DF;-*WjkmQ&p3%?CedgP>K`Bd0VR+S{c`){tb`goNBP~0JD@s z?L(uGA=DAM=3}z^%u3G3;nVVCBXX`uYt>}KUxI&YEv7W9ltMpUk4CPtM*-Kh(uA{V}6TNE~^Iki}4T)9&Qy-HlR;?dEfb!~4HB zdSbd_SjLUTtqjMuhs~Q>5)$Ye`TVgv6ygG01m$Y3;fwCU_CB^UACGYdkvL6i^KN^R zdylBbkR?A6C9jpMD=$25tM1vwAPk%DmaQHlgR8U{lhV_sYw%whI>6Y_8&zI?+2E?Y z$1YtV7ORi!k43wg2jUKHZ(pMCC~M$P7ra{h2m}3PFP83C&do|+2~DiU7Nw2gX@e8h z*`&-Kn`I@sP4&*pJGP{Y=Xv06c~-;3I-e-CHd`h9+9#FP9#igQqK2g5tf&S8%Dv{) z)$t+0jIlEIe!((5P9dAZb9y)Zk{O92vdl*+Gjl3BFO|x#QEN~jc;%NGo|IqL13VoLTB^GkkWIB=?gt08qDn7V;+4rAVtQFT$l+11 z%pkXzG}ooxFt{#U)UsUUOmzS)RLPXii8|Pty+e%mF!{Ew%?`j#<`rAbSn@Q|xOO8JG*K=7D}; zpEdM}OEFQMar*v)sf&-?6euAqsh=^IVP3HPvo%X3_HcOz_CFJ5w3@+RJ$-uCiDQd{ zw?w6oyR<`KL*PtyMF#8cx4E&V{c4q0w{KvvV6@9IH)Jk8m?~3Q#uFE3<1U89FZB0G z4&KG+dAT;qQ*&K&`*IkG^n7esQ(CGlyO^?+5;<+(?-be`kfYgkqBMHxY}gVwY0g|N ztaW1J!Nk%RO^c5)cs+R4`PpB^_>D;H>*S>;O&K@&96GjWXs}2u_^rZl-6Hez%E*70 zvfc4V%`iAwp#4q->GW^tN^kh5a%S*sVLPH#z2=2#K{?6!afU&`g=5A0%Fc7L?Fur9 z*lB#)XDJLBfkgAP#VSl$oykmTF2Y6W53*uRnbaOHv^%-`zQi*^lc8Rtj(i#$IAeAN zF5dPGww%Hy<(50`Zk=}KVE$VESdewugE1De4h4{plcb~~&p&!oNIfn7aS zRQ)lB%X62GFEM>bNM~1*j!P|k?OCm<%g|l#`A9cNfS#R`a6wr>E>mo6)ra}Y^^z9W zj+PchEA5I_8hPK6c}3pu^eM8$RG+ibK6Aq!QYOLPNobWCzb8|N>{QP?!&fUFByhd1 zClYiry*=q%Dl%I!g%`$(vrLy=Nt<7O;wHY8xxFo&TW9dpug%PVVL$gSI;C34s&h)} zCK~~^43@DvuDDEJBSWF`jQpI6ksOO*(?MI-8GGV+v&>E?<(6+8Hl0@H&(hSo@N)m;fVTq=cpFBj$!XgBAL0KI9$J|{OaF*`S{_>Y zwCR6`rj_}#G__v5+&?+s?Z5-xh7oFVnl}GO_wPh-Ek>H$o~T9!)EW#>V8{dY zX=L&+=?~Y9QqgE#c)PzBaE)SWNtjf09|m71e)j;>8Vt~2{vZzC^2Y#?1_P8H48ENF z>*FR12Ix8%sjU=r|D!zG3TWH%Ee$p&13C@{UpkN}x`+0V5%s{^G6~Icvlk2cK%$7k z>j53efFeZ3_5K=)$oN5}sb|_WoCf5eNo|hHqw0vCY2%a8fbKJ{H&x%T9x_}DG9UtB zD^mK&@MY*Y58fW&qlflh`$!^_T8hEud=qrW^@IL`0pbxE5Rb6dXeqosV{IB~3q1zt zL1Q+c>P)L6RewBfvH&PTf9Nav=|l`rg1`pjCEyZasr5q`e0?&39}tu^f>suqhdkl`znCEa2j( z5uApvSja}1@JY+)bpn(tG9X%w^_k90BMj~XN)c*V>Ul)YFy7}UTnqSe7`p%9gnFoT z;%D0Ov^1bNP3YTz7)8eI{8wf1HUJtG2544fK;|L?Di;RmTVz1eBIEZkwLG;h>Umt3 zVKN|RjrS$!R|9qNe<(*Q2bb|}fUlXy`T~3njlq|~-?IE^JgSC-0V)?3<|j-!07VP~ z)T=+`|2AW&vkYs#!8q2J0R8J*mI-m%woqw&Y^RPbfaXPMKVFEMkDqDdv^3uL040qK z2x(w{VJtatIvLQkCgrCsM@s|B*;v18i=I7JFD=jabYOxpkg7i*js2AVc*_7)ZA^ba za>J|oDgC>0&BycygtzbNkGJXDz;bK+Ifd*0GXYl=5a`DGPuz7C{KEZ=2n_Et__Kj> zz&P~1KrzlY_L&_s-hTiQ?x*aJ_a8vE8?%3Ep!m=CpZG;%_6J10@7jMd{Vl-e)c%9t zzaKha@&kd&i=S!ZwDkRI5(bERWBLOEAQ_PBCgrCsN2P~4K9KSI7k`dXp2g_~WA##b zsCwY>$pWC=jg3F}c)lTnh{5b^GS&%cfO3aP!?gn>Kn&0gv70b{0&*cfFN3kaX9DkJ z5i)rQ>&)0N-glr60eatLtYc}kZK2ZmTvG++mE+H^9x|W_l0(+>+K|G9V|8Jx}rLuqLga zT+}l16sFdV#{i)a0|dqK_QG=;kQm8;5ILqlelNm&8J{Q++WK9BB5(t(hkTp|&?RMAh?q_NV3nA|>vO86`F+)MZ_h_8IV}MMK zs3PG$4S7{+Kc)bEenwOuSseNkpox<4_)18(${!#Dq9+;dp)r{t8w2!CGN6}|@xFu4 z`&*-CVC@MiWI#8??+f7lzRhtRs5;_j+W245wD~_<_RsifW&SKpm5G=8CkMP8c);5* zLQPK7=Kl!)kMPjS{8{=(v^=!(Y197>O)K+fX==TAxqouN+kpqX4I|X#G;RKm@c#%8t<0aLe?&el z53PLK^uI&X%KTZHS}$JipB(UZ-~n&L2sJrPoBt#HKf*&R^JnQ%`Batvsruv25GDLo z`)Tv>0<`gemHt=Djc80x{PumIU-AE43*hf*Ny4EG$Jl#XIDFMN0j_fuey#sQ;XhgT zf2hg7s{LhwUl#Zg3*h@=fLe>;`+I<%iveOThOgTJ>g=S&0lgOXMz3N$MQ&Jkz6~6^ zF?_uW5Opy?&cy(=cG7Z_B?1aA1}MIhu1N{s>%#zDcdQs7=Tg@DXxE!)=@!`21ynu^ zkaEY$e2)O6J`7NX$Li*~+lv93Fs$`W)CbUhDRP@{v5l>N;rqw1H;J{}>z zQr^MF45)u(ofgoQC*`3{1oUP~{jlCnoBRhFP?s@4pvG>%K0;^7u|MR~CUn9+2i_mx zuN=`PPf9c6`+LxKKyREhpPC3L&SU#vfaXk1p7h-J)}K;8AYxCNPn$SpwBG@mG;Q)9 zXh4!4s~?c0|Bz3c0BF`D_1|QsO`enn#B56Y@qOm+1wg+Z+sElHIr=@;vG)%E@%y`c zcqVRl-2U)h3icSrp2-5BVPk;Gi2)ip2FT;k|9CJ!)0~VI8)$e8ZKtEOAJD`n<)KXk zRBa4U#3?#Vg*EZuG7<&|oD>%P{!51a6nu{Y*AY<3F+e=0$OcsNkue5%@IW3Oz}NS& zmfKS)`S`vBAbC^r{^|$c(}(w;D0SfV;Nt*376RJ&SQ-QD9RjjA1}Nne`PA_aP}X5D zM}F+Sr=&x_1H|&bs&+y?J`MqDI)?92;yQeL;OV$+0F4~pA&9|R?~6{*gQ^cc7Q!CV z1ld0m!S^QsO&tTIbqtW(F+gy~0KFXp#C6KMS9m@i@Ua~b+VOohth-<@yyJBg19Wv5 z4}bjqh@a8x7w<0%{IbCR7Z#}c54NJ}o8^H2^(ekhF^;M&NvU6(_OE}8Y6Ldw`x|!p zJ7xbywf{3k@p%CJRYxod<^q7$Jyr?+9w7c+CBDxM2;dkXdynN&2|)J707)FfpWpZ# z8lP|Ca~?nuhj|P>m*Iu?8W=F#rt*jsY4wWsW!8-$a?i Z0YdwjA4TQ=|KR+0?!ms%Vc=gr{XcA!uDbvL diff --git a/windows/API-Example-Windows/API-Example-Windows/resource.h b/windows/API-Example-Windows/API-Example-Windows/resource.h deleted file mode 100644 index 74c459f80..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/resource.h +++ /dev/null @@ -1,39 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by APIExampleWindows.rc -// -#define IDM_ABOUTBOX 0x0010 -#define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 -#define IDD_APIEXAMPLEWINDOWS_DIALOG 102 -#define IDR_MAINFRAME 128 -#define IDD_DIALOG_JOINCHANNEL 130 -#define IDD_DIALOG_RTMP_INJECTION 131 -#define IDD_DIALOG_RTMP_PUBLISH 132 -#define IDC_TREE2 1001 -#define IDC_TREE_INFO 1001 -#define ID_JOINCHANNEL 1002 -#define IDC_EDIT1 1003 -#define IDC_EDIT_CHANNELNAME 1003 -#define IDC_STATIC_REMOTE 1004 -#define IDC_EDIT_RTMP_URL 1004 -#define IDC_STATIC_LOCALVIDEO 1005 -#define IDC_STATIC_INFO 1006 -#define IDC_STATIC_URL_INFO 1007 -#define IDC_BUTTON1 1008 -#define IDC_BUTTON_ADDSTREAM 1008 -#define IDC_STATIC_LOCALVIDEO2 1009 -#define IDC_COMBO1 1009 -#define IDC_BUTTON_REMOVESTREAM 1010 -#define IDC_BUTTON_REMOVEALLSTREAM 1011 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 134 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1010 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/windows/API-Example-Windows/API-Example-Windows/stdafx.cpp b/windows/API-Example-Windows/API-Example-Windows/stdafx.cpp deleted file mode 100644 index d8d639e9a..000000000 --- a/windows/API-Example-Windows/API-Example-Windows/stdafx.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -// stdafx.cpp : source file that includes just the standard includes -// API-Example-Windows.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - - -std::string cs2utf8(CString str) -{ - char szBuf[2*MAX_PATH] = { 0 }; - WideCharToMultiByte(CP_UTF8, 0, str.GetBuffer(0), str.GetLength(), szBuf, 2*MAX_PATH, NULL, NULL); - return szBuf; -} - -CString utf82cs(std::string utf8) -{ - TCHAR szBuf[2 * MAX_PATH] = { 0 }; - MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), 2 * MAX_PATH, szBuf, 2 * MAX_PATH); - return szBuf; -} \ No newline at end of file diff --git a/windows/APIExample/APIExample.sln b/windows/APIExample/APIExample.sln new file mode 100644 index 000000000..c1b350ec2 --- /dev/null +++ b/windows/APIExample/APIExample.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.852 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APIExample", "APIExample\APIExample.vcxproj", "{DB16CA2F-3910-4449-A5BD-6A602B33BE0F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Debug|x64.ActiveCfg = Debug|x64 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Debug|x64.Build.0 = Debug|x64 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Debug|x86.ActiveCfg = Debug|Win32 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Debug|x86.Build.0 = Debug|Win32 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Release|x64.ActiveCfg = Release|x64 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Release|x64.Build.0 = Release|x64 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Release|x86.ActiveCfg = Release|Win32 + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {789EBA9F-947D-4CFF-ADDB-AE893C262318} + EndGlobalSection +EndGlobal diff --git a/windows/APIExample/APIExample/AGVideoWnd.cpp b/windows/APIExample/APIExample/AGVideoWnd.cpp new file mode 100644 index 000000000..35ee5d75f --- /dev/null +++ b/windows/APIExample/APIExample/AGVideoWnd.cpp @@ -0,0 +1,307 @@ +// AGVideoWnd.cpp : implement file +// + +#include "stdafx.h" +#include "APIExample.h" +#include "AGVideoWnd.h" + +IMPLEMENT_DYNAMIC(CAGInfoWnd, CWnd) + +CAGInfoWnd::CAGInfoWnd() +: m_bShowTip(TRUE) +, m_nWidth(0) +, m_nHeight(0) +, m_nFps(0) +, m_nBitrate(0) +{ + m_brBack.CreateSolidBrush(RGB(0x00, 0xA0, 0xE9)); +} + +CAGInfoWnd::~CAGInfoWnd() +{ + m_brBack.DeleteObject(); +} + + +BEGIN_MESSAGE_MAP(CAGInfoWnd, CWnd) + ON_WM_PAINT() + ON_WM_ERASEBKGND() +END_MESSAGE_MAP() + + +void CAGInfoWnd::ShowTips(BOOL bShow) +{ + m_bShowTip = bShow; + + if (bShow) + ShowWindow(SW_SHOW); + else + ShowWindow(SW_HIDE); + + Invalidate(FALSE); +} + +void CAGInfoWnd::SetVideoResolution(int nWidth, int nHeight) +{ + m_nWidth = nWidth; + m_nHeight = nHeight; + + if (m_bShowTip) { + Invalidate(TRUE); + UpdateWindow(); + } +} + +void CAGInfoWnd::SetFrameRateInfo(int nFPS) +{ + m_nFps = nFPS; + + if (m_bShowTip) { + Invalidate(TRUE); + UpdateWindow(); + } +} + +void CAGInfoWnd::SetBitrateInfo(int nBitrate) +{ + m_nBitrate = nBitrate; + + if (m_bShowTip) { + Invalidate(TRUE); + UpdateWindow(); + } +} + +void CAGInfoWnd::OnPaint() +{ + CPaintDC dc(this); + CRect rcClient; + CString strTip; + + dc.SetBkMode(TRANSPARENT); + dc.SetTextColor(RGB(0xFF, 0xFF, 0xFF)); + + if (m_bShowTip) { + // 640x480,15fps,400k + GetClientRect(&rcClient); + rcClient.top += 4; + strTip.Format(_T("%dx%d, %dfps, %dK \n %u"), m_nWidth, m_nHeight, m_nFps, m_nBitrate, m_nUID); + dc.DrawText(strTip, &rcClient, DT_VCENTER | DT_CENTER); + } +} + +BOOL CAGInfoWnd::OnEraseBkgnd(CDC* pDC) +{ + // TODO: add message handle code and /or call defalut values here + CRect rcClient; + + GetClientRect(&rcClient); + pDC->FillRect(&rcClient, &m_brBack); + + return TRUE; +} + +// CAGVideoWnd + +IMPLEMENT_DYNAMIC(CAGVideoWnd, CWnd) + +CAGVideoWnd::CAGVideoWnd() +: m_nUID(0) +, m_crBackColor(RGB(0x58, 0x58, 0x58)) +, m_bShowVideoInfo(FALSE) +, m_bBigShow(FALSE) +{ + +} + +CAGVideoWnd::~CAGVideoWnd() +{ + m_imgBackGround.DeleteImageList(); +} + + +BEGIN_MESSAGE_MAP(CAGVideoWnd, CWnd) + ON_WM_ERASEBKGND() + ON_WM_LBUTTONDOWN() + ON_WM_RBUTTONDOWN() + ON_WM_CREATE() + ON_WM_PAINT() + ON_WM_SIZE() + ON_WM_LBUTTONDBLCLK() +END_MESSAGE_MAP() + + + +// CAGVideoWnd message handle +BOOL CAGVideoWnd::OnEraseBkgnd(CDC* pDC) +{ + // TODO: add message handle code and /or call defalut values here + CRect rcClient; + CPoint ptDraw; + IMAGEINFO imgInfo; + + GetClientRect(&rcClient); + + pDC->FillSolidRect(&rcClient, m_crBackColor); + /*if (!m_imgBackGround.GetImageInfo(0, &imgInfo)) + return TRUE; + + ptDraw.SetPoint((rcClient.Width() - imgInfo.rcImage.right) / 2, (rcClient.Height() - imgInfo.rcImage.bottom) / 2); + if (ptDraw.x < 0) + ptDraw.x = 0; + if (ptDraw.y <= 0) + ptDraw.y = 0; + + m_imgBackGround.Draw(pDC, 0, ptDraw, ILD_NORMAL);*/ + return TRUE; +} + +void CAGVideoWnd::SetUID(UINT nUID) +{ + m_nUID = nUID; + + m_wndInfo.SetUID(nUID); + //m_wndInfo.ShowWindow(SW_SHOW); +} + +UINT CAGVideoWnd::GetUID() +{ + return m_nUID; +} + +BOOL CAGVideoWnd::IsWndFree() +{ + return m_nUID == 0 ? TRUE : FALSE; +} + +BOOL CAGVideoWnd::SetBackImage(UINT nID, UINT nWidth, UINT nHeight, COLORREF crMask) +{ + CBitmap bmBackImage; + + if (!bmBackImage.LoadBitmap(nID)) + return FALSE; + + m_imgBackGround.DeleteImageList(); + + m_imgBackGround.Create(nWidth, nHeight, ILC_COLOR24 | ILC_MASK, 1, 1); + m_imgBackGround.Add(&bmBackImage, crMask); + bmBackImage.DeleteObject(); + + Invalidate(TRUE); + + return TRUE; +} + +void CAGVideoWnd::SetFaceColor(COLORREF crBackColor) +{ + m_crBackColor = crBackColor; + + Invalidate(TRUE); +} + +void CAGVideoWnd::SetVideoResolution(UINT nWidth, UINT nHeight) +{ + m_nWidth = nWidth; + m_nHeight = nHeight; + + m_wndInfo.SetVideoResolution(nWidth, nHeight); +} + +void CAGVideoWnd::GetVideoResolution(UINT *nWidth, UINT *nHeight) +{ + *nWidth = m_nWidth; + *nHeight = m_nHeight; +} + +void CAGVideoWnd::SetBitrateInfo(int nReceivedBitrate) +{ + m_nBitRate = nReceivedBitrate; + m_wndInfo.SetBitrateInfo(nReceivedBitrate); +} + +void CAGVideoWnd::SetFrameRateInfo(int nReceiveFrameRate) +{ + m_nFrameRate = nReceiveFrameRate; + m_wndInfo.SetFrameRateInfo(nReceiveFrameRate); +} + +void CAGVideoWnd::OnLButtonDown(UINT nFlags, CPoint point) +{ + // TODO: add message handle code and /or call defalut values here + + ::SendMessage(GetParent()->GetSafeHwnd(), WM_SHOWBIG, (WPARAM)this, (LPARAM)m_nUID); + + CWnd::OnLButtonDown(nFlags, point); +} + + +void CAGVideoWnd::OnRButtonDown(UINT nFlags, CPoint point) +{ + // TODO: add message handle code and /or call defalut values here + ::SendMessage(GetParent()->GetSafeHwnd(), WM_SHOWMODECHANGED, (WPARAM)this, (LPARAM)m_nUID); + + CWnd::OnRButtonDown(nFlags, point); +} + + +int CAGVideoWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + // TODO: add you own creation code here + m_wndInfo.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, WND_INFO_WIDTH, WND_INFO_HEIGHT), this, IDC_STATIC); + m_wndInfo.ShowWindow(SW_HIDE); + return 0; +} + + +void CAGVideoWnd::ShowVideoInfo(BOOL bShow) +{ + m_bShowVideoInfo = bShow; + + m_wndInfo.ShowTips(bShow); + Invalidate(TRUE); +} + +void CAGVideoWnd::SetBigShowFlag(BOOL bBigShow) +{ + CRect rcClient; + + m_bBigShow = bBigShow; + GetClientRect(&rcClient); + + int x = (rcClient.Width()- WND_INFO_WIDTH) / 2; + int y = rcClient.Height() - WND_INFO_HEIGHT; + + if (m_wndInfo.GetSafeHwnd() != NULL) { + if (m_bBigShow) + y -= 4; + + m_wndInfo.MoveWindow(x, y, WND_INFO_WIDTH, WND_INFO_HEIGHT); + } +}; + + +void CAGVideoWnd::OnSize(UINT nType, int cx, int cy) +{ + CWnd::OnSize(nType, cx, cy); + + int x = (cx - WND_INFO_WIDTH) / 2; + int y = cy - WND_INFO_HEIGHT; + // TODO: add message handle code here + if (m_wndInfo.GetSafeHwnd() != NULL) { + if (m_bBigShow) + y -= 4; + + m_wndInfo.MoveWindow(x, y, WND_INFO_WIDTH, WND_INFO_HEIGHT); + } +} + +void CAGVideoWnd::OnLButtonDblClk(UINT nFlags, CPoint point) +{ + // TODO: add message handle code and /or call defalut values here + ::SendMessage(GetParent()->GetSafeHwnd(), WM_SHOWMODECHANGED, (WPARAM)this, (LPARAM)m_nUID); + + CWnd::OnLButtonDblClk(nFlags, point); +} diff --git a/windows/APIExample/APIExample/AGVideoWnd.h b/windows/APIExample/APIExample/AGVideoWnd.h new file mode 100644 index 000000000..bb443e06f --- /dev/null +++ b/windows/APIExample/APIExample/AGVideoWnd.h @@ -0,0 +1,105 @@ +#pragma once + +#define WM_SHOWMODECHANGED WM_USER+300 +#define WM_SHOWBIG WM_USER+301 + +#define WND_VIDEO_WIDTH 192 +#define WND_VIDEO_HEIGHT 144 + +#define WND_INFO_WIDTH 192 +#define WND_INFO_HEIGHT 36 + +class CAGInfoWnd : public CWnd +{ + DECLARE_DYNAMIC(CAGInfoWnd) + +public: + CAGInfoWnd(); + virtual ~CAGInfoWnd(); + + void ShowTips(BOOL bShow = TRUE); + void SetVideoResolution(int nWidth, int nHeight); + void SetFrameRateInfo(int nFPS); + void SetBitrateInfo(int nBitrate); + + void SetUID(UINT dwUID) { m_nUID = dwUID; } +protected: + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + + DECLARE_MESSAGE_MAP() + +private: + BOOL m_bShowTip; + + COLORREF m_crBackColor; + + int m_nWidth; + int m_nHeight; + int m_nFps; + int m_nBitrate; + + CBrush m_brBack; + UINT m_nUID = 0; +}; + + +class CAGVideoWnd : public CWnd +{ + DECLARE_DYNAMIC(CAGVideoWnd) + +public: + CAGVideoWnd(); + virtual ~CAGVideoWnd(); + + void SetUID(UINT dwUID); + + UINT GetUID(); + BOOL IsWndFree(); + + void SetFaceColor(COLORREF crBackColor); + BOOL SetBackImage(UINT nID, UINT nWidth, UINT nHeight, COLORREF crMask = RGB(0xFF, 0xff, 0xFF)); + + void SetVideoResolution(UINT nWidth, UINT nHeight); + void GetVideoResolution(UINT *nWidth, UINT *nHeight); + + void SetBitrateInfo(int nReceivedBitrate); + int GetBitrateInfo() { return m_nBitRate; }; + + void SetFrameRateInfo(int nReceiveFrameRate); + int GetFrameRateInfo() { return m_nFrameRate; }; + + void ShowVideoInfo(BOOL bShow); + BOOL IsVideoInfoShowed() { return m_bShowVideoInfo; }; + + void SetBigShowFlag(BOOL bBigShow); + BOOL IsBigShow() { return m_bBigShow; }; + +protected: + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg void OnSize(UINT nType, int cx, int cy); + + DECLARE_MESSAGE_MAP() + +private: + CImageList m_imgBackGround; + COLORREF m_crBackColor; + + CAGInfoWnd m_wndInfo; + +private: + UINT m_nUID = 0; + + UINT m_nWidth; + UINT m_nHeight; + int m_nFrameRate; + int m_nBitRate; + BOOL m_bShowVideoInfo; + BOOL m_bBigShow; +}; + + diff --git a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.cpp b/windows/APIExample/APIExample/APIExample.cpp similarity index 83% rename from windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.cpp rename to windows/APIExample/APIExample/APIExample.cpp index 12efc73fa..8d7fe29c0 100644 --- a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.cpp +++ b/windows/APIExample/APIExample/APIExample.cpp @@ -1,43 +1,43 @@ -// API-Example-Windows.cpp : Defines the class behaviors for the application. +// APIExample.cpp : Defines the class behaviors for the application. // #include "stdafx.h" -#include "API-Example-Windows.h" -#include "API-Example-WindowsDlg.h" +#include "APIExample.h" +#include "APIExampleDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif +#include "CConfig.h" +// CAPIExampleApp -// CAPIExampleWindowsApp - -BEGIN_MESSAGE_MAP(CAPIExampleWindowsApp, CWinApp) +BEGIN_MESSAGE_MAP(CAPIExampleApp, CWinApp) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) END_MESSAGE_MAP() -// CAPIExampleWindowsApp construction +// CAPIExampleApp construction -CAPIExampleWindowsApp::CAPIExampleWindowsApp() +CAPIExampleApp::CAPIExampleApp() { // support Restart Manager m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; - + CConfig::GetInstance(); // TODO: add construction code here, // Place all significant initialization in InitInstance } -// The one and only CAPIExampleWindowsApp object +// The one and only CAPIExampleApp object -CAPIExampleWindowsApp theApp; +CAPIExampleApp theApp; -// CAPIExampleWindowsApp initialization +// CAPIExampleApp initialization -BOOL CAPIExampleWindowsApp::InitInstance() +BOOL CAPIExampleApp::InitInstance() { // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable @@ -51,9 +51,8 @@ BOOL CAPIExampleWindowsApp::InitInstance() CWinApp::InitInstance(); - AfxEnableControlContainer(); - + InitKeyInfomation(); // Create the shell manager, in case the dialog contains // any shell tree view or shell list view controls. CShellManager *pShellManager = new CShellManager; @@ -70,7 +69,7 @@ BOOL CAPIExampleWindowsApp::InitInstance() // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); - CAPIExampleWindowsDlg dlg; + CAPIExampleDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) diff --git a/windows/APIExample/APIExample/APIExample.h b/windows/APIExample/APIExample/APIExample.h new file mode 100644 index 000000000..edcf1218b --- /dev/null +++ b/windows/APIExample/APIExample/APIExample.h @@ -0,0 +1,31 @@ + +// APIExample.h : main header file for the PROJECT_NAME application +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + +// CAPIExampleApp: +// See APIExample.cpp for the implementation of this class +// + +class CAPIExampleApp : public CWinApp +{ +public: + CAPIExampleApp(); + +// Overrides +public: + virtual BOOL InitInstance(); + +// Implementation + + DECLARE_MESSAGE_MAP() +}; + +extern CAPIExampleApp theApp; diff --git a/windows/API-Example-Windows/API-Example-Windows/APIExampleWindows.rc b/windows/APIExample/APIExample/APIExample.rc similarity index 54% rename from windows/API-Example-Windows/API-Example-Windows/APIExampleWindows.rc rename to windows/APIExample/APIExample/APIExample.rc index f346dfcaa441b1d85add5a7f8e4722c169485d49..2f2e510f39cb3605baf30683098cf7690d631d46 100644 GIT binary patch literal 23424 zcmeI4`)(9R7KiKamG&KGjT8~>EU__QXBDmFdz{!X@fZUVk_9#fN5&wJ39OVy*nQ7^ zirxKvb>_Ibdb)cqjLDFo(M(Tw*X7i?pHr9r{r8*jO=yMPa2k%nMR*f>`ksVKJv-2| zUU(Otg)`l)g}>_43NOQpaIWu#o?q&EtY;UxQtzGq9qE5dceHjI-m1*4@aOO+_3}-; z-q6!?y**Ru<5+fXp#H7!D$K>w)VvYPoy2;yy%IX18}`G)upYL;L_* z6Q1ZvSHHVqRZn*G-}?uK+50$jer<&<;iZh@6JhC1c&+hY3OnFoU!#7k-))V0P2&U~ z8+v|Q-!er8X>g(*!2gL#4`P%y4}`rR)#7?B-7dug7m*__!!K&p#=G4}DmRH3vDwTE7rq!C|Sa<81b*3PeD6Lww$Z=}~xh_D9KR(GjouQre3gdQ-A@ zDxQ5SX@?I^_4GKjRk9a>3uzYsOwggC4XY&kcthJ-iTx9 zs@$r2vpVGx=%8)sppHsx3*PN3NlIfINB(A$!=1~E*E-GQT+Eg4g6LDH!+5_cjBQ2j z#$BubskRnR!+hUjY=}mtv8aVEoTLw|)HoXQsr1rQahX}I1Z$PGo0A5w)|+!`qplq+ zf@#zGGJ|?^PCb=%Y*Q~)EmY~=`Znq)u{bd$iZa}i#Jcp~m*gX5CSm)L&U<=-MlEWE zZUa`E+s1o9t4y!OeYLeBor7JSF05$O2f_vI?nfVJbf}v+>iRV>68lgZxDE=}ut_U_ z8};u(ZH;QFGoR?GYT@sok3UE{%sRc0Pl0D~TM|4MHH}%cbNO87;csL3$Jm+ETFzAaMxBC&K(pYJA4PBRZG<1)aVg)a4#TGHsw}Nbo7>f<7Rp|I(mki) zxjtahu$;zV(C^AVt_fx$1~1vtNEnZe1o-iPiA0{qF%J5;P2(Fydk!yCr`w9YZcdj` zJZtO}UvM#-ABWDbElCgjb$$hRaSZ8gE4+`g@JduWQ~CGu!g``4CD!%(izrDPNHl|w z_)M)@M2WA6w@=wi)okhcx$cQDDg8|4&8s}p|4WqynwG9PT*f7@RR+t}Qwe+D(><-5 zWVHIVfd&rig@5+nzSh-ZCm=>+?@D{%2X5+aMR!D8RiABfH1TNFyQ*jI*VOAL8(WHt zof@AD&#VjQVEBz9Mu*+`2JEg2yF~OWvbqnVZ;t1DAPlcY+eU=HrnkiYP+&{AEtV%5 zZpjZMzOdhWVNn{L`#X9vAA6pKoa7ZS~QPSi2LJg|)W63w?}vyHJDrWL3a)`Qv?f zxkHslPVmy|DA*QdzP;*uLA_$z=^MK3s2&u;)1xg$x)tSaN7&!cvn^enW?mYe=xUV2 zX3*h*?$#m)5gQh%bx`|;n6SDI_yekawcCkwaXcXJmUF7ckmDzn!?QFWvmNe+dvWC8 zzpejp@M8R3>tg}^L!aci9%)>T=g~$qUAWE9#LK=fT);ickz$LY=k(x5ejK~Q`Fu@M zM1}!hp(R}5Exd?Q<(SX8Kj9vT7exVN;Eq0w$F#-hy?4|X77IJnYv^?lb9Z9D-v44) zQvb^tXN@xUSJJKL`n=GnTcQe{ZPVz{Ut})GXzb|MY*|}WyxW(-yOH~ho;f^d#BE7H zo#t_TdpXOERP~0Wo5Wi`w{;IS&;)HkhV-vUlOk=oOcr^gqY_=cUyUUxo7>&F@Pp`r z2SA1@;R%iFuomkcs=R5O97{+kAGpQfH5@JIt_aU?dKG)lxsn_%vWjhi8m5bv`m``D zaa%k>e|fHhkqp{UqCv7y=+7TiV@>y8>}E^Yt>a#kd192r9XXAL+s(GH{UBo6`~qr_ z4>X&U^U4>idMHfQS=Hfm%4Pavbf4=Y^Fppy^DXuDp6UBp*L!#(=ARh6lj^-~>ENGb zmyV*1CU3vfAZJCLbtv6VX>_9bM)#uKoDP+$ds^=IWESzdXjH_>L-`PA8AfuuL<~eU zLLQMh&)sN?=A+Mm2Z1e}ls5JHF1JZ|NOMFC4uqUj5*e_fhyT3$KUiKxlpom2yM zlwW)vqsX4(gjV0;)JvNC*2y+4^zr7gB$WEt*lDmArw+N3>!Z$!vhT;THDumj#CWoZ ziE-?b!TDQJ#qtv-J4-R1s*;_Ql^G{{W3iQaCiG)*8a@&}ip$M7c^uF7kXwQBADi77 z9vkn8x~~- z{J2Ria95VW=Hi(v+s@+CJTu07)?ZmU^uF2MyR~-LbHsI;*YmSp&gSd3H5&JV%-6at z3q$4}o9ndLl?MkWl1nAFWUiLEx;(F(&jJ7i>Ns~9(QxA*s%G&Sw_Z z-*V+^tA55=gUZTS-wsmudbe@puMJZZV%*u0?LxW?#H?&ME%1dYm510fW!R{NBcvM+A&?E8_e2 zK)EKx%KMY@ z66CCHXCy7pKII%r{J`PsNLfu_+S;?ZMJ+qHQglH+9Z?cq;q8cPBA8LviINK?OSdD9 zo>m2qwvM!;y2P0s^_|v{vd*<52-x4sTBh`7aD{2P?40Vd+WuXfW3SrlU~7oSU72e5 z@!#fEsl!%3W2>rHQ@5iXE3Z|x46^@Pq{un|xWc`i;W?)&TtM>!#f_}p^Ht;vTJz0* zvN~8i>tibg$!#;s)0RB>YE^dQY=|3JKRh0cYogp+tv_ck#7oUWv6k_s;(PW=GGe~N zAhTIJaxVs15dxyM&B$@pE9U0JaX()5z<Y z;!fKYY5O(Pdha~K8OaIsITVdaWtz|(cg`tU5-x_J6X`iK>&wmSEb{ymQphutmmbDpnZ zlxyNFyg1f>A8O3(2OzgWh78{1YwJ*!BpqY`$DM216n1}VfWqEeUu2E==Y1_^@;w|E z|2g~DPhb6e>3RK_(Hvwc;0fYA>(^F(kb#)%BUA-fgUF zV!Jl2p!8id^s^lEeNd2$3>i!Gt65=had=;49xIL!Or~8AsV(-Kz+X06=ONSTzF%Z? z2v+4cVndE3m0kV9>p5@N!(o2gz94~v(c9QrFmLNGmUS&^aobzO3@7^s9L99baqq3O z4}<+PSm(C*y&LyA?Z^537t%DWo_{YIunV#+oRJwPcKcqvpq0q`;pIHiZ`u#z<s^LJQZK2A zZ?SmTFlJ4xSCbRd!pw6p`rPy2$>$Z<%zDng997|q72~QR2Uh2;TthJnvndTz&aUT~ zbuV3?!)KN#x4>S<_GgXOKC)Vu?`Ne*aa=i%d2gP38}8*!jWVjlby zvL9)-m`EMp!QZ%5pmt08gn9mrQkhn?P-oGYJ|+>%L;3VMoT(*iVd1Jid-ym(sk!`op}e0Blh+W zpXVj-24lh&SuWzr9ESAXvWR&p@3~sXv&RXq8qDBhvVN4kcP~Yu(>O=Zj)xP)g!ySX z)vYB>R&14#%**O?UDa>iQmRvRf{?%UE8ZQar-6ex!ObaaZ{^FM%R4UaqvS1Cg_z;* zD*IijY)dt4*X2KI;HmD>v9d0T7thVJY!u!RJ-cNoo>@{o>gHZ@`SaE-<3-l%mgHre zcA+IP{6!r7*#O3>;J&5uAM_okpB|wgUItQBi{qF)7Ux0A)Xd?I_mF@pnRuMUk=cqh?nmq?ZvW_ za&6wqgzC%HyB5EoorVRRB*l1n`CFVfxfdp;( zhZg4hIYl2uJB7V&XXRt*#+5d+aAi%CE?gKBT)1eu(48T=po!6i3%_&k4E<-IfvB0x-2cD#o^!r) z&Uen4_rJCter$c!*wlQLuF-W`qZ{-NZ5JDwxbC?DiqkDxp-tMN4O*uGs<^~owEV%X zo({g(>TR)Ulp+))FWEFkA^yF!tL-()(juj3nqstollOSHH^9G5W_aoH9eyx==Cq;$ zDf08{ZR`Aa!q2~U^s>uyuGz-!2(;PIIn28~UHpS@&OHLnW=~<28(~&Gijy8czk6}G zJxJlwxyXhoir*;5JVWgZaBCHwYyd?8j;_I*8~n@J?n?{6H>L3vC;_B#ya%;yV=GJ{ zyek?unmRL(+=R9rtd+WY`s3Q$9CR2B3iyo|PA%5?gfBr!n$ea-yA7z{3ejE0>78?bQ2Ld6#XWNzHRXE zuD`n!`*J=6=~1zloCphK{eNN~(HRshqg)v^lV@W^b3|iOeBXDOKM$M%Qw-XuM&m@= z*KiO`zT4+J;7n9YIB-wpDWh4tO>cw$TgdrM9kmSdut;fG^wKPDWU;R3(vkNZK510S z3{DEdunD8bQ)1*x&b}t_mXqzfcw9 za?()2=b@wcEcPTG3Ra~igl`hTsML?)S<5m|=jmmjPQds_KD=i-eccmJW@pUyec2g0SS8J?rQ zt2n15sv4COtt&8CVw#*wXDOpaeox2HkJiY`zP@oC595{5Q;x@i+wPS8GP6y8G|c|g zeT}d9{Ok&JSli%S*8!`|Er%`sUk=kXxI+8w2UBxlT^1i$}J_w-WgyBtx~sWS8X*(fnu`u@)w~Xw5BJe5X}_ zb@1az=BXWdKa!QRYW2na$e(q-W5%d1iV+UJ^xbg-w`fh=wlJt=B1|K5S1HT4Cx==> z$dcqqW^ahbFbfo>>|gzuxY)xj^prR);Wr7XSZR_J@Pt{#-;Q^kN<*iYzf86B-{Xz7 z=(xPumgl|c!8Vi0IAlvRi&Z?pp6UAhEabE37`^2~RD|ahu)63)#k^HypG$Ie)hDYH?*gb&~7~kGERt`BCb_3&(L` x5bg37zJASqk@_sX_b;S^8Bg)2SAVSOKi=RV4YFz;D(>a#>#F_*?k{~*^AD9k`;Y(t diff --git a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj b/windows/APIExample/APIExample/APIExample.vcxproj similarity index 78% rename from windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj rename to windows/APIExample/APIExample/APIExample.vcxproj index 371c81373..e081915d6 100644 --- a/windows/API-Example-Windows/API-Example-Windows/API-Example-Windows.vcxproj +++ b/windows/APIExample/APIExample/APIExample.vcxproj @@ -20,10 +20,10 @@ 15.0 - {2338FC2F-D442-4C43-8BC2-0801F9207139} + {DB16CA2F-3910-4449-A5BD-6A602B33BE0F} MFCProj - APIExampleWindows - 10.0.18362.0 + APIExample + 8.1 @@ -110,7 +110,9 @@ $(IntDir);%(AdditionalIncludeDirectories) - if exist $(SolutionDir)\libs (copy $(SolutionDir)libs\x86\agora_rtc_sdk.dll $(SolutionDir)$(Configuration)) + if exist $(SolutionDir)\libs (copy $(SolutionDir)libs\x86\agora_rtc_sdk.dll $(SolutionDir)$(Configuration)) +if exist zh-cn.ini (copy zh-cn.ini $(SolutionDir)$(Configuration)) +if exist zh-cn.ini (copy en.ini $(SolutionDir)$(Configuration)) @@ -119,10 +121,12 @@ Level3 Disabled true - _WINDOWS;_DEBUG;%(PreprocessorDefinitions) + _WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(SolutionDir)libs\include Windows + $(SolutionDir)\libs\x86_64 false @@ -134,6 +138,12 @@ _DEBUG;%(PreprocessorDefinitions) $(IntDir);%(AdditionalIncludeDirectories) + + if exist $(SolutionDir)\libs (copy $(SolutionDir)libs\x86_64\agora_rtc_sdk.dll $(SolutionDir)$(Platform)\$(Configuration)) +if exist zh-cn.ini (copy zh-cn.ini $(SolutionDir)$(Platform)\$(Configuration)) +if exist en.ini (copy en.ini $(SolutionDir)$(Platform)\$(Configuration)) + + @@ -162,6 +172,9 @@ NDEBUG;%(PreprocessorDefinitions) $(IntDir);%(AdditionalIncludeDirectories) + + if exist $(SolutionDir)\libs (copy $(SolutionDir)libs\x86\agora_rtc_sdk.dll $(SolutionDir)$(Configuration)) + @@ -171,12 +184,14 @@ true true true - _WINDOWS;NDEBUG;%(PreprocessorDefinitions) + _WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(SolutionDir)libs\include Windows true true + $(SolutionDir)\libs\x86_64 false @@ -188,23 +203,38 @@ NDEBUG;%(PreprocessorDefinitions) $(IntDir);%(AdditionalIncludeDirectories) + + if exist $(SolutionDir)\libs (copy $(SolutionDir)libs\x86_64\agora_rtc_sdk.dll $(SolutionDir)$(Platform)\$(Configuration)) +if exist zh-cn.ini (copy zh-cn.ini $(SolutionDir)$(Platform)\$(Configuration)) +if exist en.ini (copy en.ini $(SolutionDir)$(Platform)\$(Configuration)) + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + Create Create @@ -213,13 +243,13 @@ - + - + - + diff --git a/windows/APIExample/APIExample/APIExample.vcxproj.filters b/windows/APIExample/APIExample/APIExample.vcxproj.filters new file mode 100644 index 000000000..464a8e181 --- /dev/null +++ b/windows/APIExample/APIExample/APIExample.vcxproj.filters @@ -0,0 +1,123 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {7682a8b6-0c3d-46bc-8519-8ec74432ff48} + + + {8527d597-a232-4485-beae-d1aa2190e5e0} + + + {7e4aa55f-ad9a-4a32-ac0d-5017d6884205} + + + {fd0133e8-4ed1-4da5-9eb0-2eed02844959} + + + {0637d784-14a1-4260-901a-caa73030f229} + + + {ed782797-3b06-44a9-8894-6b9d93d0dfea} + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Basic\LiveBroadcasting + + + Header Files + + + Header Files + + + Advanced\RTMPInject + + + Header Files + + + Header Files + + + Advanced\RTMPStream + + + Advanced\VideoMetadata + + + + + Source Files + + + Source Files + + + Source Files + + + Basic\LiveBroadcasting + + + Source Files + + + Source Files + + + Advanced\RTMPInject + + + Source Files + + + Advanced\RTMPStream + + + Advanced\VideoMetadata + + + + + Resource Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/windows/APIExample/APIExample/APIExampleDlg.cpp b/windows/APIExample/APIExample/APIExampleDlg.cpp new file mode 100644 index 000000000..e4e1261fd --- /dev/null +++ b/windows/APIExample/APIExample/APIExampleDlg.cpp @@ -0,0 +1,407 @@ + +// APIExampleDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "APIExample.h" +#include "APIExampleDlg.h" +#include "afxdialogex.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CAboutDlg dialog used for App About + +class CAboutDlg : public CDialogEx +{ +public: + CAboutDlg(); + +// Dialog Data +#ifdef AFX_DESIGN_TIME + enum { IDD = IDD_ABOUTBOX }; +#endif + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + +// Implementation +protected: + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) +{ +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) +END_MESSAGE_MAP() + + +// CAPIExampleDlg dialog + + + +CAPIExampleDlg::CAPIExampleDlg(CWnd* pParent /*=nullptr*/) + : CDialogEx(IDD_APIEXAMPLE_DIALOG, pParent) +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); +} + +void CAPIExampleDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_STATIC_MAIN, m_staMainArea); + DDX_Control(pDX, IDC_LIST_BASIC, m_lstBasicScene); + DDX_Control(pDX, IDC_LIST_ADVANCED, m_lstAdvanced); + DDX_Control(pDX, IDC_STATIC_LIST_INFO, m_stalstInfo); + DDX_Control(pDX, IDC_STATIC_ADVANCE, m_staAdvancedScene); + DDX_Control(pDX, IDC_STATIC_GROUP_LIST, m_grpBasicScene); + DDX_Control(pDX, IDC_BUTTON_DEMO, m_btnDemoWebSite); + DDX_Control(pDX, IDC_BUTTON_REGISTER, m_btnRegister); + DDX_Control(pDX, IDC_BUTTON_FAQ, m_btnFAQ); + DDX_Control(pDX, IDC_BUTTON_DOCUMENT_WEBSITE, m_btnDocWebsite); + DDX_Control(pDX, IDC_STATIC_GROUP_DOC, m_grpDoc); +} + +BEGIN_MESSAGE_MAP(CAPIExampleDlg, CDialogEx) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(IDC_BUTTON_FAQ, &CAPIExampleDlg::OnBnClickedButtonFaq) + ON_BN_CLICKED(IDC_BUTTON_REGISTER, &CAPIExampleDlg::OnBnClickedButtonRegister) + ON_BN_CLICKED(IDC_BUTTON_DEMO, &CAPIExampleDlg::OnBnClickedButtonDemo) + + ON_NOTIFY(NM_CLICK, IDC_LIST_BASIC, &CAPIExampleDlg::OnClickListBasic) + ON_NOTIFY(NM_CLICK, IDC_LIST_ADVANCED, &CAPIExampleDlg::OnClickListAdvanced) + ON_NOTIFY(TVN_SELCHANGED, IDC_LIST_ADVANCED, &CAPIExampleDlg::OnSelchangedListAdvanced) + ON_NOTIFY(TVN_SELCHANGED, IDC_LIST_BASIC, &CAPIExampleDlg::OnSelchangedListBasic) + ON_NOTIFY(TVN_SELCHANGING, IDC_LIST_BASIC, &CAPIExampleDlg::OnSelchangingListBasic) + ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAPIExampleDlg::OnEIDJoinLeaveChannel) + ON_NOTIFY(TVN_SELCHANGING, IDC_LIST_ADVANCED, &CAPIExampleDlg::OnSelchangingListAdvanced) + ON_BN_CLICKED(IDC_BUTTON_DOCUMENT_WEBSITE, &CAPIExampleDlg::OnBnClickedButtonDocumentWebsite) +END_MESSAGE_MAP() + + +// CAPIExampleDlg message handlers + +BOOL CAPIExampleDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != nullptr) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + // TODO: Add extra initialization here + InitCtrlText(); + InitSceneDialog(); + InitSceneList(); + + return TRUE; // return TRUE unless you set the focus to a control +} + +void CAPIExampleDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialogEx::OnSysCommand(nID, lParam); + } +} + +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CAPIExampleDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialogEx::OnPaint(); + } +} + +// The system calls this function to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CAPIExampleDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + +void CAPIExampleDlg::InitCtrlText() +{ + m_staAdvancedScene.SetWindowText(commonAdvanceScene); + m_grpDoc.SetWindowText(commonGroupDoc); + m_grpBasicScene.SetWindowText(commonBasicScene); + m_btnFAQ.SetWindowText(commonFAQWebsite); + m_btnRegister.SetWindowText(commonRegisterWebsite); + m_btnDemoWebSite.SetWindowText(commonDemoWebsite); + m_btnDocWebsite.SetWindowText(commonDocumentWebsite); +} + +void CAPIExampleDlg::InitSceneDialog() +{ + //basic list + m_vecBasic.push_back(basicLiveBroadcasting); + + m_pLiveBroadcasting = new CLiveBroadcastingDlg(&m_staMainArea); + RECT rcArea, rcWnd; + m_staMainArea.GetWindowRect(&rcArea); + + m_pLiveBroadcasting->Create(CLiveBroadcastingDlg::IDD); + m_pLiveBroadcasting->GetWindowRect(&rcWnd); + int w = rcWnd.right - rcWnd.left; + int h = rcWnd.bottom - rcWnd.top; + rcWnd = { rcArea.left, rcArea.top - MAIN_AREA_TOP, rcArea.left + w, rcArea.top + h}; + m_pLiveBroadcasting->MoveWindow(&rcWnd); + + //advanced list + m_vecAdvanced.push_back(advancedRtmpInject); + m_vecAdvanced.push_back(advancedRtmpStreaming); + m_vecAdvanced.push_back(advancedVideoMetadata); + + //inject + m_pRtmpInjectDlg = new CAgoraRtmpInjectionDlg(&m_staMainArea); + m_pRtmpInjectDlg->Create(CAgoraRtmpInjectionDlg::IDD); + m_pRtmpInjectDlg->MoveWindow(&rcWnd); + //rtmp + m_pRtmpStreamingDlg = new CAgoraRtmpStreamingDlg(&m_staMainArea); + m_pRtmpStreamingDlg->Create(CAgoraRtmpStreamingDlg::IDD); + m_pRtmpStreamingDlg->MoveWindow(&rcWnd); + + //video sei + m_pVideoSEIDlg = new CAgoraMetaDataDlg(&m_staMainArea); + m_pVideoSEIDlg->Create(CAgoraMetaDataDlg::IDD); + m_pVideoSEIDlg->MoveWindow(&rcWnd); +} + +void CAPIExampleDlg::InitSceneList() +{ + for (int i = 0; i < m_vecBasic.size(); i++){ + TVINSERTSTRUCT tvInsert; + tvInsert.hParent = NULL; + tvInsert.hInsertAfter = NULL; + tvInsert.item.mask = TVIF_TEXT; + tvInsert.item.pszText = m_vecBasic[i].GetBuffer(0); + m_lstBasicScene.InsertItem(&tvInsert); + + } + + for (int i = 0; i < m_vecAdvanced.size(); i++) { + TVINSERTSTRUCT tvInsert; + tvInsert.hParent = NULL; + tvInsert.hInsertAfter = NULL; + tvInsert.item.mask = TVIF_TEXT; + tvInsert.item.pszText = m_vecAdvanced[i].GetBuffer(0); + m_lstAdvanced.InsertItem(&tvInsert); + } +} + + +void CAPIExampleDlg::OnBnClickedButtonFaq() +{ + ShellExecute(NULL, L"open", L"https://docs.agora.io/cn/Video/faq", NULL, NULL, SW_SHOWNORMAL); +} + + +void CAPIExampleDlg::OnBnClickedButtonRegister() +{ + ShellExecute(NULL, L"open", L"https://sso.agora.io/en/v2/signup", NULL, NULL, SW_SHOWNORMAL); +} + + +void CAPIExampleDlg::OnBnClickedButtonDemo() +{ + ShellExecute(NULL, L"open", L"https://github.com/AgoraIO/API-Examples", NULL, NULL, SW_SHOWNORMAL); +} + +void CAPIExampleDlg::OnSelchangedListBasic(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); + // TODO: Add your control notification handler code here + *pResult = 0; + + HTREEITEM hItem = m_lstBasicScene.GetSelectedItem(); + m_preSelectedItemText = m_lstBasicScene.GetItemText(hItem); + CreateScene(m_lstBasicScene, m_preSelectedItemText); +} + +void CAPIExampleDlg::OnSelchangedListAdvanced(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); + *pResult = 0; + HTREEITEM hItem = m_lstAdvanced.GetSelectedItem(); + m_preSelectedItemText = m_lstAdvanced.GetItemText(hItem); + CreateScene(m_lstBasicScene, m_preSelectedItemText); +} + +HTREEITEM CAPIExampleDlg::GetHitItem(NMHDR *pNMHDR) +{ + DWORD dwPos = GetMessagePos(); + POINT pt; + pt.x = LOWORD(dwPos); + pt.y = HIWORD(dwPos); + ::ScreenToClient(pNMHDR->hwndFrom, &pt); + TVHITTESTINFO ht = { 0 }; + + ht.flags = TVHT_ONITEM; + HTREEITEM hitItem = TreeView_HitTest(pNMHDR->hwndFrom, &ht); + + return hitItem ; +} + +void CAPIExampleDlg::OnClickListBasic(NMHDR *pNMHDR, LRESULT *pResult) +{ + *pResult = 0; +} + +void CAPIExampleDlg::OnClickListAdvanced(NMHDR *pNMHDR, LRESULT *pResult) +{ + *pResult = 0; + +} + +void CAPIExampleDlg::OnSelchangingListBasic(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); + HTREEITEM hOldItem = pNMTreeView->itemOld.hItem; + HTREEITEM hAdvancedItem = m_lstAdvanced.GetSelectedItem(); + + if (m_preSelectedItemText.Compare(m_lstBasicScene.GetItemText(hOldItem)) == 0) { + ReleaseScene(m_lstBasicScene, hOldItem); + } + else if (m_preSelectedItemText.Compare(m_lstAdvanced.GetItemText(hAdvancedItem)) == 0) { + // m_lstAdvanced.SetItemState(hAdvancedItem, 0, TVIS_SELECTED); + m_lstAdvanced.SelectItem(NULL); + ReleaseScene(m_lstAdvanced, hAdvancedItem); + } + + HTREEITEM hNewItem = pNMTreeView->itemNew.hItem; + *pResult = 0; +} + +void CAPIExampleDlg::OnSelchangingListAdvanced(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); + + HTREEITEM hBasicItem = m_lstBasicScene.GetSelectedItem(); + HTREEITEM hOldItem = pNMTreeView->itemOld.hItem; + if (m_preSelectedItemText.Compare(m_lstBasicScene.GetItemText(hBasicItem)) == 0) { + m_lstBasicScene.SelectItem(NULL); + ReleaseScene(m_lstBasicScene, hBasicItem); + } + else if (m_preSelectedItemText.Compare(m_lstAdvanced.GetItemText(hOldItem)) == 0) { + ReleaseScene(m_lstAdvanced, hOldItem); + } + + *pResult = 0; +} + +// +void CAPIExampleDlg::CreateScene(CTreeCtrl& treeScene, CString selectedText) +{ + if (selectedText.Compare(basicLiveBroadcasting) == 0) { + m_pLiveBroadcasting->InitAgora(); + m_pLiveBroadcasting->ShowWindow(SW_SHOW); + } + else if (selectedText.Compare(advancedRtmpInject) == 0) { + m_pRtmpInjectDlg->InitAgora(); + m_pRtmpInjectDlg->ShowWindow(SW_SHOW); + } + else if (selectedText.Compare(advancedRtmpStreaming) == 0) { + m_pRtmpStreamingDlg->InitAgora(); + m_pRtmpStreamingDlg->ShowWindow(SW_SHOW); + } + else if (selectedText.Compare(advancedVideoMetadata) == 0) { + m_pVideoSEIDlg->InitAgora(); + m_pVideoSEIDlg->ShowWindow(SW_SHOW); + } +} + +void CAPIExampleDlg::ReleaseScene(CTreeCtrl& treeScene, HTREEITEM& hSelectItem) +{ + CString str = treeScene.GetItemText(hSelectItem); + + if (str.Compare(basicLiveBroadcasting) == 0 + && m_pLiveBroadcasting->IsWindowVisible()) {//pre sel release first + m_pLiveBroadcasting->UnInitAgora(); + m_pLiveBroadcasting->ShowWindow(SW_HIDE); + } + else if (str.Compare(advancedRtmpInject) == 0) { + m_pRtmpInjectDlg->UnInitAgora(); + m_pRtmpInjectDlg->ShowWindow(SW_HIDE); + } + else if (str.Compare(advancedRtmpStreaming) == 0) { + m_pRtmpStreamingDlg->UnInitAgora(); + m_pRtmpStreamingDlg->ShowWindow(SW_HIDE); + } +} + +LRESULT CAPIExampleDlg::OnEIDJoinLeaveChannel(WPARAM wParam, LPARAM lParam) +{ + m_bJoinChannel = (BOOL)wParam; + m_lstAdvanced.EnableWindow(!m_bJoinChannel); + m_lstBasicScene.EnableWindow(!m_bJoinChannel); + if (m_bJoinChannel) { + m_stalstInfo.SetWindowText(_T("Ƶɹл뿪Ƶ")); + } + else + m_stalstInfo.SetWindowText(_T("")); + return 0; +} + + +void CAPIExampleDlg::OnBnClickedButtonDocumentWebsite() +{ + ShellExecute(NULL, L"open", L"https://docs.agora.io/cn", NULL, NULL, SW_SHOWNORMAL); +} diff --git a/windows/APIExample/APIExample/APIExampleDlg.h b/windows/APIExample/APIExample/APIExampleDlg.h new file mode 100644 index 000000000..4d167b00f --- /dev/null +++ b/windows/APIExample/APIExample/APIExampleDlg.h @@ -0,0 +1,86 @@ + +// APIExampleDlg.h : header file +// + +#pragma once +#include "CLiveBroadcastingDlg.h" +#include "AgoraRtmpInjectionDlg.h" +#include "AgoraRtmpStreaming.h" +#include "CAgoraMetaDataDlg.h" +#include +#include +const int MAIN_AREA_BOTTOM = 15; + +// CAPIExampleDlg dialog +class CAPIExampleDlg : public CDialogEx +{ +// Construction +public: + CAPIExampleDlg(CWnd* pParent = nullptr); // standard constructor + +// Dialog Data +#ifdef AFX_DESIGN_TIME + enum { IDD = IDD_APIEXAMPLE_DIALOG }; +#endif + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + +// Implementation +protected: + HICON m_hIcon; + + // Generated message map functions + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedButtonFaq(); + afx_msg void OnBnClickedButtonRegister(); + afx_msg void OnBnClickedButtonDemo(); + afx_msg LRESULT OnEIDJoinLeaveChannel(WPARAM wParam, LPARAM lParam); + +private: + void InitSceneDialog(); + void InitSceneList(); + void InitCtrlText(); + HTREEITEM GetHitItem(NMHDR *pNMHDR); + + void ReleaseScene(CTreeCtrl& treeScene, HTREEITEM& hSelectItem); + void CreateScene(CTreeCtrl& treeScene, CString selectedText); + CLiveBroadcastingDlg *m_pLiveBroadcasting = nullptr; + CAgoraRtmpInjectionDlg *m_pRtmpInjectDlg = nullptr; + CAgoraRtmpStreamingDlg *m_pRtmpStreamingDlg = nullptr; + CAgoraMetaDataDlg *m_pVideoSEIDlg = nullptr; + CString m_preSelectedItemText = _T(""); + std::vector m_vecBasic, m_vecAdvanced; + + + + BOOL m_bJoinChannel = FALSE; +public: + CStatic m_staMainArea; + CTreeCtrl m_lstBasicScene; + CTreeCtrl m_lstAdvanced; + + afx_msg void OnClickListBasic(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnSelchangedListAdvanced(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnClickListAdvanced(NMHDR *pNMHDR, LRESULT *pResult); + + afx_msg void OnSelchangedListBasic(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnSelchangingListBasic(NMHDR *pNMHDR, LRESULT *pResult); + + afx_msg void OnSelchangingListAdvanced(NMHDR *pNMHDR, LRESULT *pResult); + CStatic m_stalstInfo; + afx_msg void OnBnClickedButtonDocumentWebsite(); + CStatic m_staAdvancedScene; + CStatic m_grpBasicScene; + CButton m_btnDemoWebSite; + CButton m_btnRegister; + CButton m_btnFAQ; + CButton m_btnDocWebsite; + CStatic m_grpDoc; +}; diff --git a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.cpp b/windows/APIExample/APIExample/AgoraRtmpInjectionDlg.cpp similarity index 52% rename from windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.cpp rename to windows/APIExample/APIExample/AgoraRtmpInjectionDlg.cpp index e384c826b..a9fe59c3b 100644 --- a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.cpp +++ b/windows/APIExample/APIExample/AgoraRtmpInjectionDlg.cpp @@ -1,13 +1,10 @@ -// CAgoraRtmpInjectionDlg.cpp : implementation file +// AgoraRtmpInjectionDlg.cpp : implementation file // #include "stdafx.h" -#include "API-Example-Windows.h" -#include "CAgoraRtmpInjectionDlg.h" +#include "APIExample.h" +#include "AgoraRtmpInjectionDlg.h" #include "afxdialogex.h" - - - void CAgoraRtmpInjectionRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { if (m_hMsgHanlder) { @@ -48,7 +45,7 @@ void CAgoraRtmpInjectionRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFF IMPLEMENT_DYNAMIC(CAgoraRtmpInjectionDlg, CDialogEx) CAgoraRtmpInjectionDlg::CAgoraRtmpInjectionDlg(CWnd* pParent /*=nullptr*/) - : CDialogEx(IDD_DIALOG_RTMP_INJECTION, pParent) + : CDialogEx(IDD_DIALOG_RTMPINJECT, pParent) { } @@ -60,95 +57,146 @@ CAgoraRtmpInjectionDlg::~CAgoraRtmpInjectionDlg() void CAgoraRtmpInjectionDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDIT_RTMP_URL, m_edtRtmpUrl); - DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); - DDX_Control(pDX, ID_JOINCHANNEL, m_btnJoinChannel); + DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo); + DDX_Control(pDX, IDC_BUTTON_JOINCHANNEL, m_btnJoinChannel); DDX_Control(pDX, IDC_BUTTON_ADDSTREAM, m_btnAddStream); - DDX_Control(pDX, IDC_STATIC_INFO, m_staInfo); - DDX_Control(pDX, IDC_STATIC_LOCALVIDEO, m_staLocalVideo); - DDX_Control(pDX, IDC_STATIC_LOCALVIDEO2, m_injectVideoWnd); + DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); + DDX_Control(pDX, IDC_EDIT_INJECT_URL, m_edtInjectUrl); + DDX_Control(pDX, IDC_STATIC_VIDEO, m_staVideoArea); + DDX_Control(pDX, IDC_STATIC_CHANNELNAME, m_staChannelName); + DDX_Control(pDX, IDC_STATIC_INJECT_URL, m_staInjectUrl); + DDX_Control(pDX, IDC_STATIC_DETAIL, m_staDetail); } BEGIN_MESSAGE_MAP(CAgoraRtmpInjectionDlg, CDialogEx) ON_BN_CLICKED(IDC_BUTTON_ADDSTREAM, &CAgoraRtmpInjectionDlg::OnBnClickedButtonAddstream) - ON_BN_CLICKED(ID_JOINCHANNEL, &CAgoraRtmpInjectionDlg::OnBnClickedJoinchannel) + ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CAgoraRtmpInjectionDlg::OnBnClickedButtonJoinchannel) + ON_WM_SHOWWINDOW() ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraRtmpInjectionDlg::OnEIDJoinChannelSuccess) ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraRtmpInjectionDlg::OnEIDLeaveChannel) ON_MESSAGE(WM_MSGID(EID_INJECT_STATUS), &CAgoraRtmpInjectionDlg::OnEIDStreamInjectedStatus) ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraRtmpInjectionDlg::OnEIDUserJoined) ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraRtmpInjectionDlg::OnEIDUserOffline) - - ON_WM_DESTROY() + + ON_LBN_SELCHANGE(IDC_LIST_INFO_BROADCASTING, &CAgoraRtmpInjectionDlg::OnSelchangeListInfoBroadcasting) END_MESSAGE_MAP() // CAgoraRtmpInjectionDlg message handlers - - BOOL CAgoraRtmpInjectionDlg::OnInitDialog() { CDialogEx::OnInitDialog(); - EnableInjectWindow(FALSE); + InitCtrlText(); + // TODO: Add extra initialization here + m_localVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 200); + + RECT rcArea; + m_staVideoArea.GetClientRect(&rcArea); + m_localVideoWnd.MoveWindow(&rcArea); + m_localVideoWnd.ShowWindow(SW_SHOW); + + m_btnAddStream.EnableWindow(FALSE); + m_edtInjectUrl.EnableWindow(FALSE); + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} +void CAgoraRtmpInjectionDlg::InitCtrlText() +{ + m_staInjectUrl.SetWindowText(rtmpInjectCtrlUrl); + m_btnAddStream.SetWindowText(rtmpInjectCtrlInject); + m_staChannelName.SetWindowText(commonCtrlChannel); + m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel); +} + +bool CAgoraRtmpInjectionDlg::InitAgora() +{ m_rtcEngine = createAgoraRtcEngine(); if (!m_rtcEngine) { - m_staInfo.SetWindowText(_T("createAgoraRtcEngine failed")); - return TRUE; + m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("createAgoraRtcEngine failed")); + return false; } - m_eventHandlerInjection.SetMsgReceiver(m_hWnd); + m_eventHandler.SetMsgReceiver(m_hWnd); RtcEngineContext context; context.appId = APP_ID; - context.eventHandler = &m_eventHandlerInjection; + context.eventHandler = &m_eventHandler; + m_rtcEngine->initialize(context); int ret = m_rtcEngine->initialize(context); if (ret != 0) { m_initialize = false; - m_staInfo.SetWindowText(_T("initialize failed")); - return TRUE; + CString strInfo; + strInfo.Format(_T("initialize failed: %d"), ret); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + return false; } else m_initialize = true; - + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); m_rtcEngine->enableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); + m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); - m_rtcEngine->startPreview(); + m_btnJoinChannel.EnableWindow(TRUE); + return true; +} - VideoCanvas canvas; - canvas.renderMode = RENDER_MODE_FIT; - canvas.uid = 0; - canvas.view = m_staLocalVideo.GetSafeHwnd(); - m_rtcEngine->setupLocalVideo(canvas); - // TODO: Add extra initialization here +void CAgoraRtmpInjectionDlg::UnInitAgora() +{ + if (m_rtcEngine) { + m_rtcEngine->stopPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + m_rtcEngine->disableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + m_rtcEngine->release(true); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); + m_rtcEngine = NULL; + } +} - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE +void CAgoraRtmpInjectionDlg::RenderLocalVideo() +{ + if (m_rtcEngine) { + m_rtcEngine->startPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("startPreview")); + VideoCanvas canvas; + canvas.renderMode = RENDER_MODE_FIT; + canvas.uid = 0; + canvas.view = m_localVideoWnd.GetSafeHwnd(); + m_rtcEngine->setupLocalVideo(canvas); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setupLocalVideo")); + + } } -void CAgoraRtmpInjectionDlg::EnableInjectWindow(BOOL bEnable) +void CAgoraRtmpInjectionDlg::OnShowWindow(BOOL bShow, UINT nStatus) { - m_edtRtmpUrl.EnableWindow(bEnable); - m_btnAddStream.EnableWindow(bEnable); + CDialogEx::OnShowWindow(bShow, nStatus); + if (bShow) { + RenderLocalVideo(); + } } - void CAgoraRtmpInjectionDlg::OnBnClickedButtonAddstream() { if (!m_rtcEngine || !m_initialize) return; - if (addInjectStream) { - addInjectStream = false; - m_edtRtmpUrl.EnableWindow(TRUE); - m_btnAddStream.SetWindowText(_T("Add URL")); - int ret = m_rtcEngine->removeInjectStreamUrl(injectUrl.c_str()); + if (m_addInjectStream) { + m_addInjectStream = false; + m_edtInjectUrl.EnableWindow(TRUE); + m_btnAddStream.SetWindowText(_T("Inject URL")); + int ret = m_rtcEngine->removeInjectStreamUrl(m_injectUrl.c_str()); } else { CString strURL; - m_edtRtmpUrl.GetWindowText(strURL); + m_edtInjectUrl.GetWindowText(strURL); if (strURL.IsEmpty()) { AfxMessageBox(_T("Fill INJECT URL first")); return; @@ -157,20 +205,21 @@ void CAgoraRtmpInjectionDlg::OnBnClickedButtonAddstream() std::string szURL = cs2utf8(strURL); InjectStreamConfig config; m_rtcEngine->addInjectStreamUrl(szURL.c_str(), config); - injectUrl = szURL; - addInjectStream = true; - m_edtRtmpUrl.EnableWindow(FALSE); + m_injectUrl = szURL; + m_addInjectStream = true; + m_edtInjectUrl.EnableWindow(FALSE); m_btnAddStream.SetWindowText(_T("Remove URL")); } - EnableInjectWindow(FALSE); + m_btnAddStream.EnableWindow(FALSE); + m_edtInjectUrl.EnableWindow(FALSE); } -void CAgoraRtmpInjectionDlg::OnBnClickedJoinchannel() +void CAgoraRtmpInjectionDlg::OnBnClickedButtonJoinchannel() { if (!m_rtcEngine || !m_initialize) return; - + if (!joinChannel) { CString strChannelName; m_edtChannelName.GetWindowText(strChannelName); @@ -186,6 +235,7 @@ void CAgoraRtmpInjectionDlg::OnBnClickedJoinchannel() } else { if (0 == m_rtcEngine->leaveChannel()) { + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("leave channel")); m_btnJoinChannel.EnableWindow(FALSE); } } @@ -196,21 +246,25 @@ LRESULT CAgoraRtmpInjectionDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lP m_btnJoinChannel.EnableWindow(TRUE); joinChannel = true; m_btnJoinChannel.SetWindowText(_T("LeaveChannel")); - EnableInjectWindow(TRUE); + m_btnAddStream.EnableWindow(TRUE); + m_edtInjectUrl.EnableWindow(TRUE); CString strInfo; - strInfo.Format(_T("join channel success")); - m_staInfo.SetWindowText(strInfo); + strInfo.Format(_T("%s:join success, uid=%u"), getCurrentTime(), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); return 0; } LRESULT CAgoraRtmpInjectionDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) { - m_btnJoinChannel.EnableWindow(FALSE); + m_btnJoinChannel.EnableWindow(TRUE); joinChannel = false; m_btnJoinChannel.SetWindowText(_T("JoinChannel")); CString strInfo; - strInfo.Format(_T("leave channel")); - m_staInfo.SetWindowText(strInfo); + strInfo.Format(_T("leave channel success")); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); return 0; } @@ -218,16 +272,14 @@ LRESULT CAgoraRtmpInjectionDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) { uid_t remoteUid = (uid_t)wParam; if (remoteUid == 666) {//inject stream - VideoCanvas canvas; - canvas.renderMode = RENDER_MODE_FIT; - canvas.uid = remoteUid; - canvas.view = m_injectVideoWnd.GetSafeHwnd(); - m_rtcEngine->setupRemoteVideo(canvas); - CString strInfo; - strInfo.Format(_T("%u joined"), remoteUid); - m_staInfo.SetWindowText(strInfo); + strInfo.Format(_T("%u joined, 666 is inject stream"), remoteUid); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + m_rtcEngine->muteRemoteAudioStream(666, true); + m_rtcEngine->muteRemoteVideoStream(666, true); } + return 0; } @@ -241,68 +293,67 @@ LRESULT CAgoraRtmpInjectionDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) m_rtcEngine->setupRemoteVideo(canvas); CString strInfo; strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); - m_staInfo.SetWindowText(strInfo); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); } return 0; } - LRESULT CAgoraRtmpInjectionDlg::OnEIDStreamInjectedStatus(WPARAM wParam, LPARAM lParam) { CString strInfo; switch ((INJECT_STREAM_STATUS)lParam) { case INJECT_STREAM_STATUS_START_SUCCESS: - strInfo.Format(_T("ⲿƵɹ, err: %d"), 0); + strInfo.Format(_T("%s, err: %d"), agoraInjectStartSucc, 0); break; case INJECT_STREAM_STATUS_START_ALREADY_EXISTS: - strInfo.Format(_T("ⲿƵѴ, err: %d"), 1); + strInfo.Format(_T("%s, err: %d"), agoraInjectExist, 1); break; case INJECT_STREAM_STATUS_START_UNAUTHORIZED: - strInfo.Format(_T("ⲿƵδȨ, err: %d"), 2); + strInfo.Format(_T("%s, err: %d"), agoraInjectStartUnAuth, 2); break; case INJECT_STREAM_STATUS_START_TIMEDOUT: - strInfo.Format(_T("ⲿƵʱ, err: %d"), 3); + strInfo.Format(_T("%s, err: %d"), agoraInjectStartTimeout, 3); break; case INJECT_STREAM_STATUS_START_FAILED: - strInfo.Format(_T(" ⲿƵʧ, err: %d"), 4); + strInfo.Format(_T("%s, err: %d"), agoraInjectStartFailed, 4); break; case INJECT_STREAM_STATUS_STOP_SUCCESS: - strInfo.Format(_T("ⲿƵֹͣɹ, err: %d"), 5); + strInfo.Format(_T("%s, err: %d"), agoraInjectStopSuccess, 5); break; case INJECT_STREAM_STATUS_STOP_NOT_FOUND: - strInfo.Format(_T("δҵҪֹͣⲿƵ, err: %d"), 6); + strInfo.Format(_T("%s, err: %d"), agoraInjectNotFound, 6); break; case INJECT_STREAM_STATUS_STOP_UNAUTHORIZED: - strInfo.Format(_T("ҪֹͣⲿƵδȨ, err: %d"), 7); + strInfo.Format(_T("%s, err: %d"), agoraInjectStopUnAuth, 7); break; case INJECT_STREAM_STATUS_STOP_TIMEDOUT: - strInfo.Format(_T("ֹͣⲿƵʱ, err: %d"), 8); + strInfo.Format(_T("%s, err: %d"), agoraInjectStopTimeout, 8); break; case INJECT_STREAM_STATUS_STOP_FAILED: - strInfo.Format(_T("ֹͣⲿƵʧ, err: %d"), 9); + strInfo.Format(_T("%s, err: %d"), agoraInjectStopFailed, 9); break; case INJECT_STREAM_STATUS_BROKEN: - strInfo.Format(_T("ⲿƵж, err: %d"), 10); + strInfo.Format(_T("%s, err: %d"), agoraInjectBroken, 10); break; default: break; } - - m_staInfo.SetWindowText(strInfo); - EnableInjectWindow(TRUE); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + m_btnAddStream.EnableWindow(TRUE); + m_edtInjectUrl.EnableWindow(TRUE); return 0; } -void CAgoraRtmpInjectionDlg::OnDestroy() + + +void CAgoraRtmpInjectionDlg::OnSelchangeListInfoBroadcasting() { - if (m_rtcEngine) { - m_rtcEngine->stopPreview(); - m_rtcEngine->disableVideo(); - m_rtcEngine->release(true); - } - CDialogEx::OnDestroy(); -} \ No newline at end of file + int sel = m_lstInfo.GetCurSel(); + CString strDetail; + m_lstInfo.GetText(sel, strDetail); + m_staDetail.SetWindowText(strDetail); +} diff --git a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.h b/windows/APIExample/APIExample/AgoraRtmpInjectionDlg.h similarity index 69% rename from windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.h rename to windows/APIExample/APIExample/AgoraRtmpInjectionDlg.h index 803866311..1848c7319 100644 --- a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpInjectionDlg.h +++ b/windows/APIExample/APIExample/AgoraRtmpInjectionDlg.h @@ -1,7 +1,6 @@ #pragma once - #include -// CAgoraRtmpInjectionDlg dialog +#include "AGVideoWnd.h" class CAgoraRtmpInjectionRtcEngineEventHandler : public IRtcEngineEventHandler { @@ -19,6 +18,8 @@ class CAgoraRtmpInjectionRtcEngineEventHandler HWND m_hMsgHanlder; }; +// CAgoraRtmpInjectionDlg dialog + class CAgoraRtmpInjectionDlg : public CDialogEx { DECLARE_DYNAMIC(CAgoraRtmpInjectionDlg) @@ -26,41 +27,48 @@ class CAgoraRtmpInjectionDlg : public CDialogEx public: CAgoraRtmpInjectionDlg(CWnd* pParent = nullptr); // standard constructor virtual ~CAgoraRtmpInjectionDlg(); - void EnableInjectWindow(BOOL bEnable); -// Dialog Data -#ifdef AFX_DESIGN_TIME - enum { IDD = IDD_DIALOG_RTMP_INJECTION }; -#endif + bool InitAgora(); + void UnInitAgora(); +// Dialog Data + enum { IDD = IDD_DIALOG_RTMPINJECT }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedButtonAddstream(); + afx_msg void OnBnClickedButtonJoinchannel(); afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnEIDStreamInjectedStatus(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); -public: virtual BOOL OnInitDialog(); private: - IRtcEngine* m_rtcEngine; - bool m_initialize = false; - CAgoraRtmpInjectionRtcEngineEventHandler m_eventHandlerInjection; + void InitCtrlText(); + void RenderLocalVideo(); + CAGVideoWnd m_localVideoWnd; + + IRtcEngine* m_rtcEngine = nullptr; + CAgoraRtmpInjectionRtcEngineEventHandler m_eventHandler; bool joinChannel = false; - CString m_strInjectUrl; - bool addInjectStream = false; - std::string injectUrl; + bool m_initialize = false; + std::string m_injectUrl; + bool m_addInjectStream = false; public: - afx_msg void OnBnClickedButtonAddstream(); - afx_msg void OnBnClickedJoinchannel(); - afx_msg void OnDestroy(); - CEdit m_edtRtmpUrl; - CEdit m_edtChannelName; + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + CListBox m_lstInfo; CButton m_btnJoinChannel; CButton m_btnAddStream; - CStatic m_staInfo; - CStatic m_staLocalVideo; - CStatic m_injectVideoWnd; + CEdit m_edtChannelName; + CEdit m_edtInjectUrl; + CStatic m_staVideoArea; + + + CStatic m_staChannelName; + CStatic m_staInjectUrl; + CStatic m_staDetail; + afx_msg void OnSelchangeListInfoBroadcasting(); }; diff --git a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.cpp b/windows/APIExample/APIExample/AgoraRtmpStreaming.cpp similarity index 55% rename from windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.cpp rename to windows/APIExample/APIExample/AgoraRtmpStreaming.cpp index eb47862f0..d64e89710 100644 --- a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.cpp +++ b/windows/APIExample/APIExample/AgoraRtmpStreaming.cpp @@ -1,53 +1,52 @@ -// CAgoraRtmpStreamingDlg.cpp : implementation file +// AgoraRtmpStreaming.cpp : implementation file // #include "stdafx.h" -#include "API-Example-Windows.h" -#include "CAgoraRtmpStreamingDlg.h" +#include "APIExample.h" +#include "AgoraRtmpStreaming.h" #include "afxdialogex.h" - -void CAgoraRtmpStreamingRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) +void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); } } -void CAgoraRtmpStreamingRtcEngineEventHandler::onStreamInjectedStatus(const char* url, uid_t uid, int status) +void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onStreamInjectedStatus(const char* url, uid_t uid, int status) { if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_INJECT_STATUS), (WPARAM)uid, (LPARAM)status); } } -void CAgoraRtmpStreamingRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) +void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) { if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); } } -void CAgoraRtmpStreamingRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) +void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) { if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); } } -void CAgoraRtmpStreamingRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) +void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); } } -void CAgoraRtmpStreamingRtcEngineEventHandler::onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) +void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { if (m_hMsgHanlder) { PRtmpStreamStreamStateChanged rtmpState = new RtmpStreamStreamStateChanged; int len = strlen(url); - rtmpState->url = new char[len + 1]; + rtmpState->url = new char[len + 1]; rtmpState->url[len] = 0; strcpy_s(rtmpState->url, len + 1, url); rtmpState->state = state; @@ -55,12 +54,14 @@ void CAgoraRtmpStreamingRtcEngineEventHandler::onRtmpStreamingStateChanged(const ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_RTMP_STREAM_STATE_CHANGED), (WPARAM)rtmpState, 0); } } +// CAgoraRtmpStreamingDlgDlg dialog + // CAgoraRtmpStreamingDlg dialog IMPLEMENT_DYNAMIC(CAgoraRtmpStreamingDlg, CDialogEx) CAgoraRtmpStreamingDlg::CAgoraRtmpStreamingDlg(CWnd* pParent /*=nullptr*/) - : CDialogEx(IDD_DIALOG_RTMP_PUBLISH, pParent) + : CDialogEx(IDD_DIALOG_RTMP_STREAMING, pParent) { } @@ -72,35 +73,241 @@ CAgoraRtmpStreamingDlg::~CAgoraRtmpStreamingDlg() void CAgoraRtmpStreamingDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDIT_RTMP_URL, m_edtRtmpUrl); + DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo); + DDX_Control(pDX, IDC_BUTTON_JOINCHANNEL, m_btnJoinChannel); + DDX_Control(pDX, IDC_STATIC_VIDEO, m_staVideoArea); DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); - DDX_Control(pDX, ID_JOINCHANNEL, m_btnJoinChannel); + DDX_Control(pDX, IDC_EDIT_RTMP_URL, m_edtRtmpUrl); DDX_Control(pDX, IDC_BUTTON_ADDSTREAM, m_btnAddStream); - DDX_Control(pDX, IDC_STATIC_INFO, m_staInfo); - DDX_Control(pDX, IDC_STATIC_LOCALVIDEO, m_staLocalVideo); - DDX_Control(pDX, IDC_COMBO1, m_cmbRtmpUrl); - DDX_Control(pDX, IDC_BUTTON_REMOVESTREAM, m_btnRemoveStream); + DDX_Control(pDX, IDC_BUTTON_REMOVE_STREAM, m_btnRemoveStream); + DDX_Control(pDX, IDC_COMBO_RTMPURLS, m_cmbRtmpUrl); + DDX_Control(pDX, IDC_STATIC_CHANNELNAME, m_staChannelName); + DDX_Control(pDX, IDC_STATIC_RTMP_URL, m_staPublishUrl); + DDX_Control(pDX, IDC_BUTTON_REMOVE_ALLSTREAM, m_btnRemoveAll); + DDX_Control(pDX, IDC_STATIC_RTMP_URLS, m_staRemoveUrl); + DDX_Control(pDX, IDC_STATIC_DETAIL, m_staDetail); } BEGIN_MESSAGE_MAP(CAgoraRtmpStreamingDlg, CDialogEx) + ON_WM_SHOWWINDOW() ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraRtmpStreamingDlg::OnEIDJoinChannelSuccess) ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraRtmpStreamingDlg::OnEIDLeaveChannel) - - // ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraRtmpStreamingDlg::OnEIDUserJoined) - // ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraRtmpStreamingDlg::OnEIDUserOffline) ON_MESSAGE(WM_MSGID(EID_RTMP_STREAM_STATE_CHANGED), &CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged) - - ON_BN_CLICKED(ID_JOINCHANNEL, &CAgoraRtmpStreamingDlg::OnBnClickedJoinchannel) + ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CAgoraRtmpStreamingDlg::OnBnClickedButtonJoinchannel) ON_BN_CLICKED(IDC_BUTTON_ADDSTREAM, &CAgoraRtmpStreamingDlg::OnBnClickedButtonAddstream) - ON_BN_CLICKED(IDC_BUTTON_REMOVEALLSTREAM, &CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveallstream) - ON_WM_DESTROY() - ON_BN_CLICKED(IDC_BUTTON_REMOVESTREAM, &CAgoraRtmpStreamingDlg::OnBnClickedButtonRemovestream) + ON_BN_CLICKED(IDC_BUTTON_REMOVE_STREAM, &CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveStream) + ON_BN_CLICKED(IDC_BUTTON_REMOVE_ALLSTREAM, &CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveAllstream) + ON_LBN_SELCHANGE(IDC_LIST_INFO_BROADCASTING, &CAgoraRtmpStreamingDlg::OnSelchangeListInfoBroadcasting) END_MESSAGE_MAP() // CAgoraRtmpStreamingDlg message handlers + +bool CAgoraRtmpStreamingDlg::InitAgora() +{ + m_rtcEngine = createAgoraRtcEngine(); + if (!m_rtcEngine) { + m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("createAgoraRtcEngine failed")); + return false; + } + m_eventHandler.SetMsgReceiver(m_hWnd); + + RtcEngineContext context; + context.appId = APP_ID; + context.eventHandler = &m_eventHandler; + m_rtcEngine->initialize(context); + int ret = m_rtcEngine->initialize(context); + if (ret != 0) { + m_initialize = false; + CString strInfo; + strInfo.Format(_T("initialize failed: %d"), ret); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + return false; + } + else + m_initialize = true; + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); + m_rtcEngine->enableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); + + m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); + m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); + + m_btnJoinChannel.EnableWindow(TRUE); + return true; +} + + +void CAgoraRtmpStreamingDlg::UnInitAgora() +{ + if (m_rtcEngine) { + m_rtcEngine->stopPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + m_rtcEngine->disableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + m_rtcEngine->release(true); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); + m_rtcEngine = NULL; + } +} + + +BOOL CAgoraRtmpStreamingDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + InitCtrlText(); + m_localVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 100); + + RECT rcArea; + m_staVideoArea.GetClientRect(&rcArea); + m_localVideoWnd.MoveWindow(&rcArea); + m_localVideoWnd.ShowWindow(SW_SHOW); + m_btnAddStream.EnableWindow(FALSE); + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CAgoraRtmpStreamingDlg::InitCtrlText() +{ + m_staRemoveUrl.SetWindowText(rtmpStreamingCtrlPublishUrl); + m_staPublishUrl.SetWindowText(rtmpStreamingCtrlPublishUrl); + m_btnAddStream.SetWindowText(rtmpStreamingCtrlAdd); + m_staChannelName.SetWindowText(commonCtrlChannel); + m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel); + m_btnRemoveStream.SetWindowText(rtmpStreamingCtrlRemove); + m_btnRemoveAll.SetWindowText(rtmpStreamingCtrlRemoveAll); +} + +void CAgoraRtmpStreamingDlg::OnShowWindow(BOOL bShow, UINT nStatus) +{ + CDialogEx::OnShowWindow(bShow, nStatus); + + if (bShow) { + RenderLocalVideo(); + } +} + + +void CAgoraRtmpStreamingDlg::RenderLocalVideo() +{ + if (m_rtcEngine) { + m_rtcEngine->startPreview(); + VideoCanvas canvas; + canvas.renderMode = RENDER_MODE_FIT; + canvas.uid = 0; + canvas.view = m_localVideoWnd.GetSafeHwnd(); + m_rtcEngine->setupLocalVideo(canvas); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("render local video")); + } +} + +void CAgoraRtmpStreamingDlg::RemoveAllRtmpUrls() +{ + m_bRemoveAll = true; + CString strUrl; + for (int i = 0; i < m_cmbRtmpUrl.GetCount(); ++i) { + m_cmbRtmpUrl.GetLBText(i, strUrl); + std::string szUrl = cs2utf8(strUrl); + m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); + } + m_cmbRtmpUrl.Clear(); + m_cmbRtmpUrl.ResetContent(); +} + +void CAgoraRtmpStreamingDlg::OnBnClickedButtonJoinchannel() +{ + if (!m_rtcEngine || !m_initialize) + return; + + if (!joinChannel) { + CString strChannelName; + m_edtChannelName.GetWindowText(strChannelName); + if (strChannelName.IsEmpty()) { + AfxMessageBox(_T("Fill channel name first")); + return; + } + + std::string szChannelId = cs2utf8(strChannelName); + if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { + m_btnJoinChannel.EnableWindow(FALSE); + } + } + else { + if (m_cmbRtmpUrl.GetCount() > 0) { + m_btnAddStream.EnableWindow(FALSE); + m_btnRemoveStream.EnableWindow(FALSE); + m_btnJoinChannel.EnableWindow(FALSE); + RemoveAllRtmpUrls(); + } + else if (0 == m_rtcEngine->leaveChannel()) { + m_btnJoinChannel.EnableWindow(FALSE); + } + } +} + + +void CAgoraRtmpStreamingDlg::OnBnClickedButtonAddstream() +{ + if (!m_rtcEngine || !m_initialize) + return; + + CString strURL; + m_edtRtmpUrl.GetWindowText(strURL); + if (strURL.IsEmpty()) { + AfxMessageBox(_T("Fill Publish URL first")); + return; + } + if (m_urlSet.find(strURL) != m_urlSet.end()) { + AfxMessageBox(_T("have add Publish Stream URL")); + return; + } + std::string szURL = cs2utf8(strURL); + int ret = m_rtcEngine->addPublishStreamUrl(szURL.c_str(), false);// no transcoding + + if (ret != 0) { + CString strInfo; + strInfo.Format(_T("addPublishStreamUrl failed:%d"), ret); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + return; + } +} + + +void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveStream() +{ + if (!m_rtcEngine || !m_initialize) + return; + + if (m_cmbRtmpUrl.GetCount() == 0) + return; + + CString strUrl; + m_cmbRtmpUrl.GetWindowText(strUrl); + std::string szUrl = cs2utf8(strUrl); + m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); +} + + +void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveAllstream() +{ + if (m_cmbRtmpUrl.GetCount() == 0 && m_cmbRtmpUrl.GetCurSel() >= 0) { + return; + } + if (!m_rtcEngine || !m_initialize) + return; + + CString strUrl; + m_cmbRtmpUrl.GetWindowText(strUrl); + + std::string szUrl = cs2utf8(strUrl); + m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); + m_btnRemoveStream.EnableWindow(FALSE); +} + LRESULT CAgoraRtmpStreamingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) { m_btnJoinChannel.EnableWindow(TRUE); @@ -109,8 +316,11 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lP joinChannel = true; m_btnJoinChannel.SetWindowText(_T("LeaveChannel")); CString strInfo; - strInfo.Format(_T("join channel success")); - m_staInfo.SetWindowText(strInfo); + strInfo.Format(_T("%s:join success, uid=%u"), getCurrentTime(), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + m_btnAddStream.EnableWindow(TRUE); + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); return 0; } @@ -120,30 +330,14 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) joinChannel = false; m_btnJoinChannel.SetWindowText(_T("JoinChannel")); CString strInfo; - strInfo.Format(_T("leave channel")); - m_staInfo.SetWindowText(strInfo); - + strInfo.Format(_T("leave channel success")); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); m_btnRemoveStream.EnableWindow(FALSE); + m_btnAddStream.EnableWindow(TRUE); + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); return 0; } -/*LRESULT CAgoraRtmpStreamingDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) -{ - CString strInfo; - strInfo.Format(_T("%u joined"), remoteUid); - m_staInfo.SetWindowText(strInfo); - return 0; -} - -LRESULT CAgoraRtmpStreamingDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) -{ - uid_t remoteUid = (uid_t)wParam; - CString strInfo; - strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); - m_staInfo.SetWindowText(strInfo); - return 0; -}*/ - LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lParam) { PRtmpStreamStreamStateChanged rtmpState = (PRtmpStreamStreamStateChanged)wParam; @@ -151,9 +345,9 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar m_btnRemoveStream.EnableWindow(TRUE); switch (rtmpState->state) { - case RTMP_STREAM_PUBLISH_STATE_IDLE: + case RTMP_STREAM_PUBLISH_STATE_IDLE: { - strInfo.Format(_T("ɹɾַ:%S"), rtmpState->url); + strInfo.Format(_T("%s:%S"), agoraRtmpStateIdle, rtmpState->url); CString strUrl; strUrl.Format(_T("%S"), rtmpState->url); int sel = m_cmbRtmpUrl.GetCurSel(); @@ -161,33 +355,36 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar m_cmbRtmpUrl.ResetContent(); if (m_cmbRtmpUrl.GetCount() > 0) { m_cmbRtmpUrl.SetCurSel(0); - for (auto iter = m_urlSet.begin(); iter != m_urlSet.end(); ++iter) - if (strUrl.Compare(*iter) == 0) { - m_urlSet.erase(iter); - break; - } + } + + for (auto iter = m_urlSet.begin(); iter != m_urlSet.end(); ++iter) + if (strUrl.Compare(*iter) == 0) { + m_urlSet.erase(iter); + break; + } - if (bRemoveAll) { - removeUrlCount++; - if (removeUrlCount == m_urlSet.size()) {//remove all url when leave channel + if (m_bRemoveAll) { + m_removeUrlCount++; + if (m_removeUrlCount == m_urlSet.size()) {//remove all url when leave channel m_urlSet.clear(); - bRemoveAll = false; + m_bRemoveAll = false; m_rtcEngine->leaveChannel(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("leaveChannel")); } } - + } - break; + break; case RTMP_STREAM_PUBLISH_STATE_CONNECTING: { - strInfo.Format(_T(" Agora RTMP ")); + strInfo = agoraRtmpStateConnecting; } - break; + break; case RTMP_STREAM_PUBLISH_STATE_RUNNING: - strInfo.Format(_T("ڽС")); + strInfo = agoraRtmpStateRunning; if (rtmpState->error == RTMP_STREAM_PUBLISH_ERROR_OK) { - strInfo.Format(_T("ɹ")); + strInfo = agoraRtmpStateRunningSuccess; CString strUrl; strUrl.Format(_T("%S"), rtmpState->url); if (m_urlSet.find(strUrl) == m_urlSet.end()) { @@ -200,73 +397,73 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar } break; case RTMP_STREAM_PUBLISH_STATE_RECOVERING: - strInfo.Format(_T("ڻָ CDN 쳣жʱSDK ԶԻָظ״̬")); + strInfo.Format(agoraRtmpStateRecovering); break; case RTMP_STREAM_PUBLISH_STATE_FAILURE: { switch (rtmpState->state) { - case RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT: + case RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT: { - strInfo = _T("Ч"); + strInfo = agoraRtmpStateInvalidArg; } - break; + break; case RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED: { - strInfo = _T("Ѽܣ"); + strInfo = agoraRtmpStateEncrypted; } break; case RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT: { - strInfo = _T("ʱδɹ"); + strInfo = agoraRtmpStateConnTimeout; } break; case RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR: { - strInfo = _T("ִ"); + strInfo = agoraRtmpStateInrealErr; } break; case RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR: { - strInfo = _T("RTMP ִ"); + strInfo = agoraRtmpStateServerErr; } break; case RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN: { - strInfo = _T("Ƶ"); + strInfo = agoraRtmpStateTooOften; } break; case RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT: { - strInfo = _T(" ַĿﵽ 10ɾһЩõַַ"); + strInfo = agoraRtmpStateReachLimit; } break; case RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED: { - strInfo = _T("Լ"); + strInfo = agoraRtmpStateNotAuth; } break; case RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND: { - strInfo = _T("δҵ"); + strInfo = agoraRtmpStateNotFound; } break; case RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED: { - strInfo = _T("ַʽдַʽǷȷ"); + strInfo = agoraRtmpStateNotSupported; } break; default: break; } } - break; + break; default: break; } - - - m_staInfo.SetWindowText(strInfo); + + + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); delete[] rtmpState->url; rtmpState->url = NULL; delete[] rtmpState; @@ -274,157 +471,11 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar return 0; } -void CAgoraRtmpStreamingDlg::OnBnClickedJoinchannel() +void CAgoraRtmpStreamingDlg::OnSelchangeListInfoBroadcasting() { - if (!m_rtcEngine || !m_initialize) - return; - - if (!joinChannel) { - CString strChannelName; - m_edtChannelName.GetWindowText(strChannelName); - if (strChannelName.IsEmpty()) { - AfxMessageBox(_T("Fill channel name first")); - return; - } - - std::string szChannelId = cs2utf8(strChannelName); - if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { - m_btnJoinChannel.EnableWindow(FALSE); - } - } - else { - if (m_cmbRtmpUrl.GetCount() > 0) { - m_btnAddStream.EnableWindow(FALSE); - m_btnRemoveStream.EnableWindow(FALSE); - m_btnJoinChannel.EnableWindow(FALSE); - RemoveAllRtmpUrls(); - } - else if (0 == m_rtcEngine->leaveChannel()) { - m_btnJoinChannel.EnableWindow(FALSE); - } - } - return; + int sel = m_lstInfo.GetCurSel(); + CString strDetail; + m_lstInfo.GetText(sel, strDetail); + m_staDetail.SetWindowText(strDetail); } -void CAgoraRtmpStreamingDlg::OnBnClickedButtonAddstream() -{ - if (!m_rtcEngine || !m_initialize) - return; - - CString strURL; - m_edtRtmpUrl.GetWindowText(strURL); - if (strURL.IsEmpty()) { - AfxMessageBox(_T("Fill Publish URL first")); - return; - } - if (m_urlSet.find(strURL) != m_urlSet.end()) { - AfxMessageBox(_T("have add Publish Stream URL")); - return; - } - std::string szURL = cs2utf8(strURL); - int ret = m_rtcEngine->addPublishStreamUrl(szURL.c_str(), false);// no transcoding - - if (ret != 0) { - CString strInfo; - strInfo.Format(_T("addPublishStreamUrl failed:%d"), ret); - m_staInfo.SetWindowText(strInfo); - return; - } -} - - -void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveallstream() -{ - if (!m_rtcEngine || !m_initialize) - return; - - if (m_cmbRtmpUrl.GetCount() == 0) - return; - - CString strUrl; - m_cmbRtmpUrl.GetWindowText(strUrl); - std::string szUrl = cs2utf8(strUrl); - m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); -} - -BOOL CAgoraRtmpStreamingDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - m_btnAddStream.EnableWindow(FALSE); - m_btnRemoveStream.EnableWindow(FALSE); - m_rtcEngine = createAgoraRtcEngine(); - if (!m_rtcEngine) { - m_staInfo.SetWindowText(_T("createAgoraRtcEngine failed")); - return TRUE; - } - m_eventHandlerInjection.SetMsgReceiver(m_hWnd); - - RtcEngineContext context; - context.appId = APP_ID; - context.eventHandler = &m_eventHandlerInjection; - int ret = m_rtcEngine->initialize(context); - if (ret != 0) { - m_initialize = false; - m_staInfo.SetWindowText(_T("initialize failed")); - return TRUE; - } - else - m_initialize = true; - - m_rtcEngine->enableVideo(); - m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); - m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); - - m_rtcEngine->startPreview(); - - VideoCanvas canvas; - canvas.renderMode = RENDER_MODE_FIT; - canvas.uid = 0; - canvas.view = m_staLocalVideo.GetSafeHwnd(); - m_rtcEngine->setupLocalVideo(canvas); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - - -void CAgoraRtmpStreamingDlg::OnDestroy() -{ - CDialogEx::OnDestroy(); - - if (m_initialize) { - m_rtcEngine->stopPreview(); - m_rtcEngine->disableVideo(); - } - if(m_rtcEngine) - m_rtcEngine->release(true); -} - -void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemovestream() -{ - if (m_cmbRtmpUrl.GetCount() == 0 && m_cmbRtmpUrl.GetCurSel() >= 0) { - return; - } - if (!m_rtcEngine || !m_initialize) - return; - - CString strUrl; - m_cmbRtmpUrl.GetWindowText(strUrl); - - std::string szUrl = cs2utf8(strUrl); - m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); - m_btnRemoveStream.EnableWindow(FALSE); -} - -void CAgoraRtmpStreamingDlg::RemoveAllRtmpUrls() -{ - bRemoveAll = true; - CString strUrl; - for (int i = 0; i < m_cmbRtmpUrl.GetCount(); ++i) { - m_cmbRtmpUrl.GetLBText(i, strUrl); - std::string szUrl = cs2utf8(strUrl); - m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); - } - m_cmbRtmpUrl.Clear(); - m_cmbRtmpUrl.ResetContent(); -} \ No newline at end of file diff --git a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.h b/windows/APIExample/APIExample/AgoraRtmpStreaming.h similarity index 61% rename from windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.h rename to windows/APIExample/APIExample/AgoraRtmpStreaming.h index 5d19477cc..db9141e70 100644 --- a/windows/API-Example-Windows/API-Example-Windows/CAgoraRtmpStreamingDlg.h +++ b/windows/APIExample/APIExample/AgoraRtmpStreaming.h @@ -1,12 +1,12 @@ #pragma once -#include +#include "AGVideoWnd.h" #include -class CAgoraRtmpStreamingRtcEngineEventHandler +class CAgoraRtmpStreamingDlgRtcEngineEventHandler : public IRtcEngineEventHandler { public: - CAgoraRtmpStreamingRtcEngineEventHandler() {} - ~CAgoraRtmpStreamingRtcEngineEventHandler() {} + CAgoraRtmpStreamingDlgRtcEngineEventHandler() {} + ~CAgoraRtmpStreamingDlgRtcEngineEventHandler() {} void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) override; @@ -28,46 +28,54 @@ class CAgoraRtmpStreamingDlg : public CDialogEx public: CAgoraRtmpStreamingDlg(CWnd* pParent = nullptr); // standard constructor virtual ~CAgoraRtmpStreamingDlg(); - + bool InitAgora(); + void UnInitAgora(); // Dialog Data -#ifdef AFX_DESIGN_TIME - enum { IDD = IDD_DIALOG_RTMP_PUBLISH }; -#endif + enum { IDD = IDD_DIALOG_RTMP_STREAMING }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() - afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); - - // afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); - // afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lParam); private: - IRtcEngine* m_rtcEngine; - CAgoraRtmpStreamingRtcEngineEventHandler m_eventHandlerInjection; + void InitCtrlText(); + void RenderLocalVideo(); + void RemoveAllRtmpUrls(); + + IRtcEngine* m_rtcEngine = nullptr; + CAgoraRtmpStreamingDlgRtcEngineEventHandler m_eventHandler; bool joinChannel = false; - bool m_initialize = false; - CEdit m_edtRtmpUrl; - CEdit m_edtChannelName; - CButton m_btnJoinChannel; - CButton m_btnAddStream; - CStatic m_staInfo; - CStatic m_staLocalVideo; + bool m_initialize = false; + CAGVideoWnd m_localVideoWnd; std::set m_urlSet; - int removeUrlCount = 0; - bool bRemoveAll = false; + int m_removeUrlCount = 0; + bool m_bRemoveAll = false; + public: - afx_msg void OnBnClickedJoinchannel(); - afx_msg void OnBnClickedButtonAddstream(); - afx_msg void OnBnClickedButtonRemoveallstream(); - afx_msg void OnDestroy(); - afx_msg void OnBnClickedButtonRemovestream(); virtual BOOL OnInitDialog(); - CComboBox m_cmbRtmpUrl; - CButton m_btnRemoveStream; + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + afx_msg void OnBnClickedButtonJoinchannel(); + afx_msg void OnBnClickedButtonAddstream(); + afx_msg void OnBnClickedButtonRemoveStream(); + afx_msg void OnBnClickedButtonRemoveAllstream(); - void RemoveAllRtmpUrls(); + afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lParam); + afx_msg void OnSelchangeListInfoBroadcasting(); + CEdit m_edtChannelName; + CEdit m_edtRtmpUrl; + CButton m_btnAddStream; + CButton m_btnRemoveStream; + CComboBox m_cmbRtmpUrl; + CStatic m_staChannelName; + CStatic m_staPublishUrl; + CButton m_btnRemoveAll; + CStatic m_staRemoveUrl; + // m_staVideoArea + CButton m_btnJoinChannel; + CListBox m_lstInfo; + CStatic m_staVideoArea; + CStatic m_staDetail; }; diff --git a/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp b/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp new file mode 100644 index 000000000..afb31206e --- /dev/null +++ b/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp @@ -0,0 +1,402 @@ +// CAgoraMetaDataDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "APIExample.h" +#include "CAgoraMetaDataDlg.h" +#include "afxdialogex.h" +//metadata + + +void CAgoraMetaDataObserver::SetMaxMetadataSize(int maxSize) +{ + if (maxSize > 1024) + maxSize = 1024; + m_maxSize = maxSize; +} + +int CAgoraMetaDataObserver::getMaxMetadataSize() +{ + return m_maxSize; +} + +bool CAgoraMetaDataObserver::onReadyToSendMetadata(Metadata &metadata) +{ + if (m_sendSEI.length() > 0) { + memcpy_s(metadata.buffer, m_sendSEI.length(), m_sendSEI.c_str(), m_sendSEI.length()); + + } + metadata.size = m_sendSEI.length(); + return true; +} + +void CAgoraMetaDataObserver::onMetadataReceived(const Metadata &metadata) +{ + if (m_hMsgHanlder) { + Metadata* recvMetaData = new Metadata; + recvMetaData->size = metadata.size; + recvMetaData->uid = metadata.uid; + recvMetaData->timeStampMs = metadata.timeStampMs; + if (metadata.size > 0) { + recvMetaData->buffer = new unsigned char[metadata.size]; + memcpy_s(recvMetaData->buffer, metadata.size, metadata.buffer, metadata.size); + recvMetaData->buffer[metadata.size] = 0; + } + ::PostMessage(m_hMsgHanlder, WM_MSGID(RECV_METADATA_MSG), (WPARAM)recvMetaData, 0); + } +} + +void CAgoraMetaDataObserver::SetSendSEI(std::string utf8Msg) +{ + m_sendSEI = utf8Msg; + +} +//event +void CAgoraMetaDataEventHanlder::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) +{ + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); + } +} + +void CAgoraMetaDataEventHanlder::onUserJoined(uid_t uid, int elapsed) { + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); + } +} + +void CAgoraMetaDataEventHanlder::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) +{ + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); + } +} + +void CAgoraMetaDataEventHanlder::onLeaveChannel(const RtcStats& stats) +{ + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); + } +} + +void CAgoraMetaDataEventHanlder::onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) +{ + if (m_hMsgHanlder) { + PVideoStateStateChanged stateChanged = new VideoStateStateChanged; + stateChanged->uid = uid; + stateChanged->reason = reason; + stateChanged->state = state; + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_REMOTE_VIDEO_STATE_CHANED), (WPARAM)stateChanged, 0); + } +} + +// CAgoraMetaDataDlg dialog + +IMPLEMENT_DYNAMIC(CAgoraMetaDataDlg, CDialogEx) + +CAgoraMetaDataDlg::CAgoraMetaDataDlg(CWnd* pParent /*=nullptr*/) + : CDialogEx(IDD_DIALOG_METADATA, pParent) +{ + +} + +CAgoraMetaDataDlg::~CAgoraMetaDataDlg() +{ +} + +void CAgoraMetaDataDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_STATIC_CHANNELNAME, m_staChannelName); + DDX_Control(pDX, IDC_BUTTON_JOINCHANNEL, m_btnJoinChannel); + DDX_Control(pDX, IDC_STATIC_SENDSEI, m_staSendSEI); + DDX_Control(pDX, IDC_EDIT_SEI, m_edtSendSEI); + DDX_Control(pDX, IDC_EDIT_RECV, m_edtRecvSEI); + DDX_Control(pDX, IDC_STATIC_METADATA_INFO, m_staMetaData); + DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo); + DDX_Control(pDX, IDC_STATIC_VIDEO, m_staVideoArea); + DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); + DDX_Control(pDX, IDC_BUTTON_SEND, m_btnSendSEI); +} + + +BEGIN_MESSAGE_MAP(CAgoraMetaDataDlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CAgoraMetaDataDlg::OnBnClickedButtonJoinchannel) + ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraMetaDataDlg::OnEIDJoinChannelSuccess) + ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraMetaDataDlg::OnEIDLeaveChannel) + ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraMetaDataDlg::OnEIDUserJoined) + ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraMetaDataDlg::OnEIDUserOffline) + ON_MESSAGE(WM_MSGID(EID_REMOTE_VIDEO_STATE_CHANED), &CAgoraMetaDataDlg::OnEIDRemoteVideoStateChanged) + ON_MESSAGE(WM_MSGID(RECV_METADATA_MSG), &CAgoraMetaDataDlg::OnEIDMetadataReceived) + ON_WM_SHOWWINDOW() + ON_BN_CLICKED(IDC_BUTTON_SEND, &CAgoraMetaDataDlg::OnBnClickedButtonSend) + ON_BN_CLICKED(IDC_BUTTON_CLEAR, &CAgoraMetaDataDlg::OnBnClickedButtonClear) +END_MESSAGE_MAP() + + +// CAgoraMetaDataDlg message handlers + + +void CAgoraMetaDataDlg::OnBnClickedButtonJoinchannel() +{ + if (!m_rtcEngine || !m_initialize) + return; + CString strInfo; + if (!joinChannel) { + CString strChannelName; + m_edtChannelName.GetWindowText(strChannelName); + if (strChannelName.IsEmpty()) { + AfxMessageBox(_T("Fill channel name first")); + return; + } + + std::string szChannelId = cs2utf8(strChannelName); + if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { + strInfo.Format(_T("join channel %s"), getCurrentTime()); + m_btnJoinChannel.EnableWindow(FALSE); + } + } + else { + if (0 == m_rtcEngine->leaveChannel()) { + strInfo.Format(_T("leave channel %s"), getCurrentTime()); + m_btnJoinChannel.EnableWindow(FALSE); + } + } + + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); +} + + +BOOL CAgoraMetaDataDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + InitCtrlText(); + m_localVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 100); + m_remoteVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 100); + + RECT rcArea; + m_staVideoArea.GetClientRect(&rcArea); + + RECT rcLeft = rcArea, rcRight = rcArea; + rcLeft.right = rcLeft.left + (rcArea.right - rcArea.left) / 2; + rcRight.left = rcLeft.right + 1; + m_localVideoWnd.MoveWindow(&rcLeft); + m_remoteVideoWnd.MoveWindow(&rcLeft); + m_localVideoWnd.ShowWindow(SW_SHOW); + m_remoteVideoWnd.ShowWindow(SW_SHOW); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + + +void CAgoraMetaDataDlg::InitCtrlText() +{ + m_staMetaData.SetWindowText(videoSEIInformation); + m_staSendSEI.SetWindowText(metadataCtrlSendSEI); + m_btnSendSEI.SetWindowText(metadataCtrlBtnSend); + m_staChannelName.SetWindowText(commonCtrlChannel); + m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel); +} + +bool CAgoraMetaDataDlg::InitAgora() +{ + m_rtcEngine = createAgoraRtcEngine(); + if (!m_rtcEngine) { + m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("createAgoraRtcEngine failed")); + return false; + } + m_eventHandler.SetMsgReceiver(m_hWnd); + + RtcEngineContext context; + context.appId = APP_ID; + context.eventHandler = &m_eventHandler; + m_rtcEngine->initialize(context); + int ret = m_rtcEngine->initialize(context); + if (ret != 0) { + m_initialize = false; + CString strInfo; + strInfo.Format(_T("initialize failed: %d"), ret); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + return false; + } + else + m_initialize = true; + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); + m_rtcEngine->enableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); + + m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); + m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); + + m_metaDataObserver.SetMsgReceiver(m_hWnd); + m_rtcEngine->registerMediaMetadataObserver(&m_metaDataObserver, IMetadataObserver::VIDEO_METADATA); + + m_btnJoinChannel.EnableWindow(TRUE); + return true; +} + + +void CAgoraMetaDataDlg::UnInitAgora() +{ + if (m_rtcEngine) { + m_rtcEngine->stopPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + m_rtcEngine->disableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + m_rtcEngine->release(true); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); + m_rtcEngine = NULL; + } +} + +LRESULT CAgoraMetaDataDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) +{ + m_btnJoinChannel.EnableWindow(TRUE); + joinChannel = true; + m_btnJoinChannel.SetWindowText(_T("LeaveChannel")); + + CString strInfo; + strInfo.Format(_T("%s:join success, uid=%u"), getCurrentTime(), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + m_localVideoWnd.SetUID(wParam); + + //notify parent window + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); + return 0; +} + +LRESULT CAgoraMetaDataDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) +{ + m_btnJoinChannel.EnableWindow(TRUE); + joinChannel = false; + m_btnJoinChannel.SetWindowText(_T("JoinChannel")); + + CString strInfo; + strInfo.Format(_T("leave channel success %s"), getCurrentTime()); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + //notify parent window + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); + return 0; +} + +LRESULT CAgoraMetaDataDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) +{ + CString strInfo; + strInfo.Format(_T("%u joined"), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + /* VideoCanvas canvas; + canvas.uid = wParam; + canvas.view = m_remoteVideoWnd.GetSafeHwnd(); + canvas.renderMode = RENDER_MODE_FIT; + m_rtcEngine->setupRemoteVideo(canvas);*/ + return 0; +} + +LRESULT CAgoraMetaDataDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) +{ + uid_t remoteUid = (uid_t)wParam; + VideoCanvas canvas; + canvas.uid = remoteUid; + canvas.view = NULL; + m_rtcEngine->setupRemoteVideo(canvas); + CString strInfo; + strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + return 0; +} + +LRESULT CAgoraMetaDataDlg::OnEIDRemoteVideoStateChanged(WPARAM wParam, LPARAM lParam) +{ + PVideoStateStateChanged stateChanged = (PVideoStateStateChanged)wParam; + if (stateChanged) { + //onRemoteVideoStateChanged + + CString strSateInfo; + switch (stateChanged->state) { + case REMOTE_VIDEO_STATE_STARTING: + strSateInfo = _T("REMOTE_VIDEO_STATE_STARTING"); + break; + case REMOTE_VIDEO_STATE_STOPPED: + strSateInfo = _T("strSateInfo"); + break; + case REMOTE_VIDEO_STATE_DECODING: + strSateInfo = _T("REMOTE_VIDEO_STATE_DECODING"); + break; + case REMOTE_VIDEO_STATE_FAILED: + strSateInfo = _T("REMOTE_VIDEO_STATE_FAILED "); + break; + case REMOTE_VIDEO_STATE_FROZEN: + strSateInfo = _T("REMOTE_VIDEO_STATE_FROZEN "); + break; + } + + CString strInfo; + strInfo.Format(_T("onRemoteVideoStateChanged: uid=%u, %s"), stateChanged->uid, strSateInfo); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + } + return 0; +} + +LRESULT CAgoraMetaDataDlg::OnEIDMetadataReceived(WPARAM wParam, LPARAM lParam) +{ + IMetadataObserver::Metadata* metaData = (IMetadataObserver::Metadata*)wParam; + CString strInfo; + strInfo.Format(_T("onMetadataReceived:uid:%u, ts=%d, size:%d."), metaData->uid, metaData->timeStampMs, metaData->size, metaData->buffer); + + if (metaData->size > 0) { + CString str; + str.Format(_T("Info: %S"), metaData->buffer); + strInfo += str; + } + m_edtRecvSEI.SetWindowText(strInfo); + return 0; +} + +void CAgoraMetaDataDlg::RenderLocalVideo() +{ + if (m_rtcEngine) { + m_rtcEngine->startPreview(); + VideoCanvas canvas; + canvas.renderMode = RENDER_MODE_FIT; + canvas.uid = 0; + canvas.view = m_localVideoWnd.GetSafeHwnd(); + m_rtcEngine->setupLocalVideo(canvas); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("render local video")); + } +} + +void CAgoraMetaDataDlg::OnShowWindow(BOOL bShow, UINT nStatus) +{ + CDialogEx::OnShowWindow(bShow, nStatus); + + if (bShow) { + RenderLocalVideo(); + } +} + + +void CAgoraMetaDataDlg::OnBnClickedButtonSend() +{ + CString strSend; + m_edtSendSEI.GetWindowText(strSend); + if (strSend.IsEmpty()) + return; + std::string utf8msg = cs2utf8(strSend); + m_metaDataObserver.SetSendSEI(utf8msg); +} + + +void CAgoraMetaDataDlg::OnBnClickedButtonClear() +{ + m_edtSendSEI.SetWindowText(_T("")); + m_metaDataObserver.SetSendSEI(""); +} diff --git a/windows/APIExample/APIExample/CAgoraMetaDataDlg.h b/windows/APIExample/APIExample/CAgoraMetaDataDlg.h new file mode 100644 index 000000000..2f0030dea --- /dev/null +++ b/windows/APIExample/APIExample/CAgoraMetaDataDlg.h @@ -0,0 +1,93 @@ +#pragma once +#include "AGVideoWnd.h" + +class CAgoraMetaDataObserver : public IMetadataObserver +{ +public: + void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } + CAgoraMetaDataObserver(){} + ~CAgoraMetaDataObserver() { } + virtual int getMaxMetadataSize()override; + virtual bool onReadyToSendMetadata(Metadata &metadata)override; + virtual void onMetadataReceived(const Metadata &metadata)override; + void SetMaxMetadataSize(int maxSize); + void SetSendSEI(std::string utf8Msg); +private: + int m_maxSize = 1024; + std::string m_sendSEI; + HWND m_hMsgHanlder; +}; + + +class CAgoraMetaDataEventHanlder : public IRtcEngineEventHandler +{ +public: + CAgoraMetaDataEventHanlder() {} + ~CAgoraMetaDataEventHanlder() {} + void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; + virtual void onUserJoined(uid_t uid, int elapsed) override; + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override; + virtual void onLeaveChannel(const RtcStats& stats) override; + virtual void onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) override; +private: + HWND m_hMsgHanlder; +}; + +// CAgoraMetaDataDlg dialog + +class CAgoraMetaDataDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CAgoraMetaDataDlg) + +public: + CAgoraMetaDataDlg(CWnd* pParent = nullptr); // standard constructor + virtual ~CAgoraMetaDataDlg(); + bool InitAgora(); + void UnInitAgora(); + void RenderLocalVideo(); +// Dialog Data + + enum { IDD = IDD_DIALOG_METADATA }; + + //Agora Event handler + afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDRemoteVideoStateChanged(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDMetadataReceived(WPARAM wParam, LPARAM lParam); +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + CStatic m_staChannelName; + CButton m_btnJoinChannel; + CStatic m_staSendSEI; + CEdit m_edtSendSEI; + CEdit m_edtRecvSEI; + CStatic m_staMetaData; + CListBox m_lstInfo; + afx_msg void OnBnClickedButtonJoinchannel(); + virtual BOOL OnInitDialog(); + +private: + void InitCtrlText(); + IRtcEngine* m_rtcEngine = nullptr; + CAgoraMetaDataEventHanlder m_eventHandler; + bool joinChannel = false; + bool m_initialize = false; + bool m_remoteJoined = false; + CAGVideoWnd m_localVideoWnd; + CAGVideoWnd m_remoteVideoWnd; + + CAgoraMetaDataObserver m_metaDataObserver; +public: + CStatic m_staVideoArea; + CEdit m_edtChannelName; + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + CButton m_btnSendSEI; + afx_msg void OnBnClickedButtonSend(); + afx_msg void OnBnClickedButtonClear(); +}; diff --git a/windows/APIExample/APIExample/CConfig.cpp b/windows/APIExample/APIExample/CConfig.cpp new file mode 100644 index 000000000..42fdef666 --- /dev/null +++ b/windows/APIExample/APIExample/CConfig.cpp @@ -0,0 +1,49 @@ +#include "stdafx.h" +#include "CConfig.h" +CConfig* CConfig::GetInstance() +{ + static CConfig config; + return &config; +} + +CConfig::CConfig() +{ + ::GetModuleFileName(NULL, m_szZhConfigFile, MAX_PATH); + LPTSTR lpLastSlash = _tcsrchr(m_szZhConfigFile, _T('\\')) + 1; + _tcscpy_s(lpLastSlash, MAX_PATH, _T("zh-cn.ini")); + + if (::GetFileAttributes(m_szZhConfigFile) == INVALID_FILE_ATTRIBUTES) { + HANDLE hFile = ::CreateFile(m_szZhConfigFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ::CloseHandle(hFile); + } + + ::GetModuleFileName(NULL, m_szEnConfigFile, MAX_PATH); + LPTSTR lpLastSlashEn = _tcsrchr(m_szEnConfigFile, _T('\\')) + 1; + _tcscpy_s(lpLastSlashEn, MAX_PATH, _T("en.ini")); + + if (::GetFileAttributes(m_szEnConfigFile) == INVALID_FILE_ATTRIBUTES) { + HANDLE hFile = ::CreateFile(m_szEnConfigFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ::CloseHandle(hFile); + } + LCID lcid = GetUserDefaultLCID();//LCID https://www.science.co.il/language/Locale-codes.php + if (lcid == 2052) {//chinese + m_bChinese = true; + } + +} + + +CConfig::~CConfig() +{ +} + + +CString CConfig::GetStringValue(CString key) +{ + CString strValue = _T(""); + if (m_bChinese) + ::GetPrivateProfileString(_T("General"), key, _T("Unknown"), strValue.GetBuffer(MAX_PATH), MAX_PATH, m_szZhConfigFile); + else + ::GetPrivateProfileString(_T("General"), key, _T("Unknown"), strValue.GetBuffer(MAX_PATH), MAX_PATH, m_szEnConfigFile); + return strValue; +} \ No newline at end of file diff --git a/windows/APIExample/APIExample/CConfig.h b/windows/APIExample/APIExample/CConfig.h new file mode 100644 index 000000000..42aeb52f9 --- /dev/null +++ b/windows/APIExample/APIExample/CConfig.h @@ -0,0 +1,22 @@ +#pragma once +#include +#include +#define Str(key) CConfig::GetInstance()->GetStringValue(key) + +class CConfig +{ +public: + CConfig(); + ~CConfig(); + + static CConfig* GetInstance(); + CString GetStringValue(CString key); +private: + + TCHAR m_szZhConfigFile[MAX_PATH]; + TCHAR m_szEnConfigFile[MAX_PATH]; + bool m_bChinese = false; + + int hashSize = 1000; +}; + diff --git a/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp b/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp new file mode 100644 index 000000000..5fc6a3db6 --- /dev/null +++ b/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp @@ -0,0 +1,406 @@ +// CLiveBroadcastingDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "APIExample.h" +#include "CLiveBroadcastingDlg.h" +#include "afxdialogex.h" + + +void CLiveBroadcastingRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) +{ + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); + } +} + +void CLiveBroadcastingRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) { + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); + } +} + +void CLiveBroadcastingRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) +{ + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); + } +} + +void CLiveBroadcastingRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) +{ + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); + } +} +// CLiveBroadcastingDlg dialog + +IMPLEMENT_DYNAMIC(CLiveBroadcastingDlg, CDialogEx) + +CLiveBroadcastingDlg::CLiveBroadcastingDlg(CWnd* pParent /*=nullptr*/) + : CDialogEx(IDD_DIALOG_LIVEBROADCASTING, pParent) +{ + +} + +CLiveBroadcastingDlg::~CLiveBroadcastingDlg() +{ +} + +void CLiveBroadcastingDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_COMBO_ROLE, m_cmbRole); + DDX_Control(pDX, IDC_STATIC_ROLE, m_staRole); + DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); + DDX_Control(pDX, IDC_BUTTON_JOINCHANNEL, m_btnJoinChannel); + DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo); + DDX_Control(pDX, IDC_STATIC_VIDEO, m_videoArea); + DDX_Control(pDX, IDC_COMBO_PERSONS, m_cmbPersons); + DDX_Control(pDX, IDC_STATIC_PERSONS, m_staPersons); + DDX_Control(pDX, IDC_STATIC_CHANNELNAME, m_staChannelName); + DDX_Control(pDX, IDC_STATIC_DETAIL, m_staDetail); +} + + +BEGIN_MESSAGE_MAP(CLiveBroadcastingDlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel) + ON_CBN_SELCHANGE(IDC_COMBO_PERSONS, &CLiveBroadcastingDlg::OnSelchangeComboPersons) + ON_CBN_SELCHANGE(IDC_COMBO_ROLE, &CLiveBroadcastingDlg::OnSelchangeComboRole) + ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CLiveBroadcastingDlg::OnEIDJoinChannelSuccess) + ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CLiveBroadcastingDlg::OnEIDLeaveChannel) + ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CLiveBroadcastingDlg::OnEIDUserJoined) + ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CLiveBroadcastingDlg::OnEIDUserOffline) + ON_WM_SHOWWINDOW() + ON_LBN_SELCHANGE(IDC_LIST_INFO_BROADCASTING, &CLiveBroadcastingDlg::OnSelchangeListInfoBroadcasting) +END_MESSAGE_MAP() + + +// CLiveBroadcastingDlg message handlers + +BOOL CLiveBroadcastingDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + InitCtrlText(); + CreateAllVideoWnds(); + // clientRole + int i = 0; + m_cmbRole.InsertString(i++, agoraRoleBroadcaster); + m_cmbRole.InsertString(i++, agoraRoleAudience); + m_cmbRole.SetCurSel(0); + // + i = 0; + m_cmbPersons.InsertString(i++, _T("1V1")); + m_cmbPersons.InsertString(i++, _T("1V3")); + m_cmbPersons.InsertString(i++, _T("1V8")); + m_cmbPersons.InsertString(i++, _T("1V15")); + m_cmbPersons.SetCurSel(0); + ShowVideoWnds(); + + m_btnJoinChannel.EnableWindow(FALSE); + m_cmbRole.EnableWindow(FALSE); + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CLiveBroadcastingDlg::InitCtrlText() +{ + m_staRole.SetWindowText(commonCtrlClientRole); + m_staPersons.SetWindowText(liveCtrlPersons); + m_staChannelName.SetWindowText(commonCtrlChannel); + m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel); +} + +void CLiveBroadcastingDlg::CreateAllVideoWnds() +{ + for (int i = 0; i < VIDEO_COUNT; ++i) { + m_videoWnds[i].Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, IDC_BASEWND_VIDEO + i); + m_videoWnds[i].SetFaceColor(RGB(0x58, 0x58, 0x58)); + } +} + + +void CLiveBroadcastingDlg::ShowVideoWnds() +{ + m_videoArea.ShowWindow(SW_HIDE); + int row = 2; + int col = 2; + m_maxVideoCount = 4; + switch (m_cmbPersons.GetCurSel()) { + case PEOPLE_IN_CHANNEL_2: { + row = 1; + col = 2; + m_maxVideoCount = 2; + } + break; + case PEOPLE_IN_CHANNEL_4: { + int row = 2; + int col = 2; + m_maxVideoCount = 4; + } + break; + case PEOPLE_IN_CHANNEL_9: { + row = 3; + col = 3; + m_maxVideoCount = 9; + } + break; + case PEOPLE_IN_CHANNEL_16: { + row = 4; + col = 4; + m_maxVideoCount = 16; + } + break; + } + + + RECT rcArea; + m_videoArea.GetClientRect( &rcArea); + int space = 1; + + int w = (rcArea.right -rcArea.left - space * (col - 1)) / col; + int h = (rcArea.bottom - rcArea.top - space * (row - 1)) / row; + + for (int r = 0; r < row; r++) { + for (int c = 0; c < col; c++) { + int x = rcArea.left + (w + space) * c; + int y = rcArea.top + (h + space) * r; + int nIndex = r * col + c; + m_videoWnds[nIndex].MoveWindow(x, y, w, h, TRUE); + m_videoWnds[nIndex].ShowWindow(SW_SHOW); + m_videoWnds[nIndex].SetParent(this); + + if (!m_videoWnds[nIndex].IsWindowVisible()) { + m_videoWnds[nIndex].ShowWindow(SW_SHOW); + } + } + } + + for (int i = m_maxVideoCount; i < VIDEO_COUNT; i++) { + m_videoWnds[i].ShowWindow(0); + if (m_videoWnds[i].GetUID() != 0) { + VideoCanvas canvas; + canvas.uid = m_videoWnds[i].GetUID(); + canvas.view = m_videoWnds[i].GetSafeHwnd(); + m_rtcEngine->setupRemoteVideo(canvas); + } + } +} + +bool CLiveBroadcastingDlg::InitAgora() +{ + m_rtcEngine = createAgoraRtcEngine(); + if (!m_rtcEngine) { + m_lstInfo.InsertString(m_lstInfo.GetCount()-1, _T("createAgoraRtcEngine failed")); + return false; + } + m_eventHandler.SetMsgReceiver(m_hWnd); + + RtcEngineContext context; + context.appId = APP_ID; + context.eventHandler = &m_eventHandler; + m_rtcEngine->initialize(context); + int ret = m_rtcEngine->initialize(context); + if (ret != 0) { + m_initialize = false; + CString strInfo; + strInfo.Format(_T("initialize failed: %d"), ret); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + return false; + } + else + m_initialize = true; + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); + m_rtcEngine->enableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); + + m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); + m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); + + m_btnJoinChannel.EnableWindow(TRUE); + m_cmbRole.EnableWindow(TRUE); + return true; +} + +void CLiveBroadcastingDlg::UnInitAgora() +{ + if (m_rtcEngine) { + m_rtcEngine->stopPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + m_rtcEngine->disableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + m_rtcEngine->release(true); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); + m_rtcEngine = NULL; + } +} + +void CLiveBroadcastingDlg::RenderLocalVideo() +{ + if (m_rtcEngine) { + m_rtcEngine->startPreview(); + VideoCanvas canvas; + canvas.renderMode = RENDER_MODE_FIT; + canvas.uid = 0; + canvas.view = m_videoWnds[0].GetSafeHwnd(); + m_rtcEngine->setupLocalVideo(canvas); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("render local video")); + } +} + + +void CLiveBroadcastingDlg::OnSelchangeComboPersons() +{ + int index = m_cmbPersons.GetCurSel(); + ShowVideoWnds(); +} + + +void CLiveBroadcastingDlg::OnSelchangeComboRole() +{ + if (m_rtcEngine) { + m_rtcEngine->setClientRole(CLIENT_ROLE_TYPE(m_cmbRole.GetCurSel() + 1)); + + m_lstInfo.InsertString(m_lstInfo.GetCount(), m_cmbRole.GetCurSel() == 0 ? _T("setClientRole broadcaster"): _T("setClientRole Audience")); + } +} + +void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel() +{ + if (!m_rtcEngine || !m_initialize) + return; + CString strInfo; + if (!joinChannel) { + CString strChannelName; + m_edtChannelName.GetWindowText(strChannelName); + if (strChannelName.IsEmpty()) { + AfxMessageBox(_T("Fill channel name first")); + return; + } + + std::string szChannelId = cs2utf8(strChannelName); + if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { + strInfo.Format(_T("join channel %s"), getCurrentTime()); + m_btnJoinChannel.EnableWindow(FALSE); + } + } + else { + if (0 == m_rtcEngine->leaveChannel()) { + strInfo.Format(_T("leave channel %s"), getCurrentTime()); + m_btnJoinChannel.EnableWindow(FALSE); + } + } + + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); +} + + + +void CLiveBroadcastingDlg::OnShowWindow(BOOL bShow, UINT nStatus) +{ + CDialogEx::OnShowWindow(bShow, nStatus); + + if (bShow) { + RenderLocalVideo(); + } +} + +LRESULT CLiveBroadcastingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) +{ + m_btnJoinChannel.EnableWindow(TRUE); + joinChannel = true; + m_btnJoinChannel.SetWindowText(_T("LeaveChannel")); + + CString strInfo; + strInfo.Format(_T("%s:join success, uid=%u"), getCurrentTime(), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + m_videoWnds[0].SetUID(wParam); + m_lstUids.push_back(wParam); + + //notify parent window + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); + return 0; +} + +LRESULT CLiveBroadcastingDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) +{ + m_btnJoinChannel.EnableWindow(TRUE); + joinChannel = false; + m_btnJoinChannel.SetWindowText(_T("JoinChannel")); + + CString strInfo; + strInfo.Format(_T("leave channel success %s"), getCurrentTime()); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + m_lstUids.clear(); + for (int i = 0; i < m_maxVideoCount; i++) { + m_videoWnds[i].SetUID(0); + } + + //notify parent window + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); + return 0; +} + +LRESULT CLiveBroadcastingDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) +{ + if (m_lstUids.size() == m_maxVideoCount) + return 0; + CString strInfo; + strInfo.Format(_T("%u joined"), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + m_lstUids.push_back(wParam); + for (int i = 0; i < m_maxVideoCount; i++) { + if (m_videoWnds[i].GetUID() == 0) { + VideoCanvas canvas; + canvas.uid = wParam; + canvas.view = m_videoWnds[i].GetSafeHwnd(); + canvas.renderMode = RENDER_MODE_FIT; + m_rtcEngine->setupRemoteVideo(canvas); + break; + } + } + return 0; +} + +LRESULT CLiveBroadcastingDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) +{ + uid_t remoteUid = (uid_t)wParam; + VideoCanvas canvas; + canvas.uid = remoteUid; + canvas.view = NULL; + m_rtcEngine->setupRemoteVideo(canvas); + CString strInfo; + strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + + for (int i = 0; i < m_maxVideoCount; i++){ + if (m_videoWnds[i].GetUID() == remoteUid) { + m_videoWnds[i].SetUID(0); + m_videoWnds[i].Invalidate(); + break; + } + } + + for (auto iter = m_lstUids.begin(); + iter != m_lstUids.end(); iter++){ + if (*iter == remoteUid) { + m_lstUids.erase(iter); + break; + } + } + return 0; +} + + +void CLiveBroadcastingDlg::OnSelchangeListInfoBroadcasting() +{ + + int sel = m_lstInfo.GetCurSel(); + CString strDetail; + m_lstInfo.GetText(sel, strDetail); + m_staDetail.SetWindowText(strDetail); +} diff --git a/windows/APIExample/APIExample/CLiveBroadcastingDlg.h b/windows/APIExample/APIExample/CLiveBroadcastingDlg.h new file mode 100644 index 000000000..bfa0b6020 --- /dev/null +++ b/windows/APIExample/APIExample/CLiveBroadcastingDlg.h @@ -0,0 +1,84 @@ +#pragma once + +#include "AGVideoWnd.h" + +#include +// CLiveBroadcastingDlg dialog +#define VIDEO_COUNT 36 +#define IDC_BASEWND_VIDEO 113 +class CLiveBroadcastingRtcEngineEventHandler + : public IRtcEngineEventHandler +{ +public: + CLiveBroadcastingRtcEngineEventHandler() {} + ~CLiveBroadcastingRtcEngineEventHandler() {} + void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; + virtual void onUserJoined(uid_t uid, int elapsed) override; + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override; + virtual void onLeaveChannel(const RtcStats& stats) override; +private: + HWND m_hMsgHanlder; +}; + +class CLiveBroadcastingDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CLiveBroadcastingDlg) + +public: + CLiveBroadcastingDlg(CWnd* pParent = nullptr); // standard constructor + virtual ~CLiveBroadcastingDlg(); + + bool InitAgora(); + void UnInitAgora(); + +// Dialog Data + enum { IDD = IDD_DIALOG_LIVEBROADCASTING }; + enum PEOPLE_IN_CHANNEL_TYPE { + PEOPLE_IN_CHANNEL_2 = 0, + PEOPLE_IN_CHANNEL_4, + PEOPLE_IN_CHANNEL_9, + PEOPLE_IN_CHANNEL_16 + }; +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnSelchangeComboPersons(); + afx_msg void OnSelchangeComboRole(); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + //Agora Event handler + afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); +private: + void InitCtrlText(); + void CreateAllVideoWnds(); + void ShowVideoWnds(); + void RenderLocalVideo(); + IRtcEngine* m_rtcEngine = nullptr; + CLiveBroadcastingRtcEngineEventHandler m_eventHandler; + bool joinChannel = false; + bool m_initialize = false; + //video wnd + CAGVideoWnd m_videoWnds[VIDEO_COUNT]; + int m_maxVideoCount = 4; + std::list m_lstUids; +public: + CComboBox m_cmbRole; + CStatic m_staRole; + CComboBox m_cmbPersons; + CEdit m_edtChannelName; + CButton m_btnJoinChannel; + afx_msg void OnBnClickedButtonJoinchannel(); + CListBox m_lstInfo; + virtual BOOL OnInitDialog(); + CStatic m_videoArea; + + CStatic m_staPersons; + CStatic m_staChannelName; + CStatic m_staDetail; + afx_msg void OnSelchangeListInfoBroadcasting(); +}; diff --git a/windows/APIExample/APIExample/CSceneDialog.cpp b/windows/APIExample/APIExample/CSceneDialog.cpp new file mode 100644 index 000000000..2684d32a4 --- /dev/null +++ b/windows/APIExample/APIExample/CSceneDialog.cpp @@ -0,0 +1,17 @@ +#include "stdafx.h" +#include "CSceneDialog.h" + +IMPLEMENT_DYNAMIC(CSceneDialog, CDialogEx) + +CSceneDialog::CSceneDialog(UINT nIDTemplate, CWnd *pParent) + :CDialogEx(nIDTemplate, pParent) +{ +} + + +CSceneDialog::~CSceneDialog() +{ +} + +BEGIN_MESSAGE_MAP(CSceneDialog, CDialogEx) +END_MESSAGE_MAP() \ No newline at end of file diff --git a/windows/APIExample/APIExample/CSceneDialog.h b/windows/APIExample/APIExample/CSceneDialog.h new file mode 100644 index 000000000..a423d5225 --- /dev/null +++ b/windows/APIExample/APIExample/CSceneDialog.h @@ -0,0 +1,17 @@ +#pragma once +#include +class CSceneDialog : + public CDialogEx +{ + DECLARE_DYNAMIC(CSceneDialog) +public: + + CSceneDialog(UINT nIDTemplate, CWnd *pParent = NULL); + ~CSceneDialog(); + + virtual bool InitAgora() = 0; + virtual void UnInitAgora() = 0; +protected: + DECLARE_MESSAGE_MAP() +}; + diff --git a/windows/APIExample/APIExample/Language.h b/windows/APIExample/APIExample/Language.h new file mode 100644 index 000000000..0c8a8c66a --- /dev/null +++ b/windows/APIExample/APIExample/Language.h @@ -0,0 +1,76 @@ +#pragma once +#define INFO_LEN 50 +//main dialog +extern wchar_t commonGroupDoc[INFO_LEN]; +extern wchar_t commonDocumentWebsite[INFO_LEN]; +extern wchar_t commonFAQWebsite[INFO_LEN]; +extern wchar_t commonRegisterWebsite[INFO_LEN]; +extern wchar_t commonDemoWebsite[INFO_LEN]; + +extern wchar_t commonBasicScene[INFO_LEN]; +extern wchar_t commonAdvanceScene[INFO_LEN]; +//agora enum +extern wchar_t agoraRoleBroadcaster[INFO_LEN]; +extern wchar_t agoraRoleAudience[INFO_LEN]; + + +//common ctrl +extern wchar_t commonCtrlChannel[INFO_LEN]; +extern wchar_t commonCtrlJoinChannel[INFO_LEN]; +extern wchar_t commonCtrlLeaveChannel[INFO_LEN]; +extern wchar_t commonCtrlClientRole[INFO_LEN]; +//scene list +extern wchar_t basicLiveBroadcasting[INFO_LEN]; +extern wchar_t advancedRtmpInject[INFO_LEN]; +extern wchar_t advancedRtmpStreaming[INFO_LEN]; +extern wchar_t advancedVideoMetadata[INFO_LEN]; + + +//live broadcasting +extern wchar_t liveCtrlPersons[INFO_LEN]; +//rtmp streaming +extern wchar_t rtmpStreamingCtrlPublishUrl[INFO_LEN]; +extern wchar_t rtmpStreamingCtrlAdd[INFO_LEN]; +extern wchar_t rtmpStreamingCtrlRemove[INFO_LEN]; +extern wchar_t rtmpStreamingCtrlRemoveAll[INFO_LEN]; +//rtmp Inject +extern wchar_t rtmpInjectCtrlUrl[INFO_LEN]; +extern wchar_t rtmpInjectCtrlInject[INFO_LEN]; +extern wchar_t rtmpInjectCtrlRemove[INFO_LEN]; +//rtmp stream state changed +extern wchar_t agoraRtmpStateIdle[INFO_LEN]; +extern wchar_t agoraRtmpStateConnecting[INFO_LEN]; +extern wchar_t agoraRtmpStateRunning[INFO_LEN]; +extern wchar_t agoraRtmpStateRunningSuccess[INFO_LEN]; +extern wchar_t agoraRtmpStateRecovering[INFO_LEN]; +extern wchar_t agoraRtmpStateInvalidArg[INFO_LEN]; +extern wchar_t agoraRtmpStateEncrypted[INFO_LEN]; +extern wchar_t agoraRtmpStateConnTimeout[INFO_LEN]; +extern wchar_t agoraRtmpStateInrealErr[INFO_LEN]; +extern wchar_t agoraRtmpStateServerErr[INFO_LEN]; +extern wchar_t agoraRtmpStateTooOften[INFO_LEN]; +extern wchar_t agoraRtmpStateReachLimit[INFO_LEN]; +extern wchar_t agoraRtmpStateNotAuth[INFO_LEN]; +extern wchar_t agoraRtmpStateNotFound[INFO_LEN]; +extern wchar_t agoraRtmpStateNotSupported[INFO_LEN]; + +// inject status +extern wchar_t agoraInjectStartSucc[INFO_LEN]; +extern wchar_t agoraInjectExist[INFO_LEN]; +extern wchar_t agoraInjectStartUnAuth[INFO_LEN]; +extern wchar_t agoraInjectStartTimeout[INFO_LEN]; +extern wchar_t agoraInjectStartFailed[INFO_LEN]; +extern wchar_t agoraInjectStopSuccess[INFO_LEN]; +extern wchar_t agoraInjectNotFound[INFO_LEN]; +extern wchar_t agoraInjectStopUnAuth[INFO_LEN]; + +extern wchar_t agoraInjectStopTimeout[INFO_LEN]; +extern wchar_t agoraInjectStopFailed[INFO_LEN]; +extern wchar_t agoraInjectBroken[INFO_LEN]; + +//video SEI +extern wchar_t videoSEIInformation[INFO_LEN]; +extern wchar_t metadataCtrlSendSEI[INFO_LEN]; +extern wchar_t metadataCtrlBtnSend[INFO_LEN]; +extern wchar_t metadataCtrlBtnClear[INFO_LEN]; +extern void InitKeyInfomation(); \ No newline at end of file diff --git a/windows/APIExample/APIExample/en.ini b/windows/APIExample/APIExample/en.ini new file mode 100644 index 000000000..51654763e --- /dev/null +++ b/windows/APIExample/APIExample/en.ini @@ -0,0 +1,63 @@ +[General] +Common.Group.Doc=Document +Common.Document.Website=Document Website +Common.FAQ.Website=FAQ +Common.Register.Website=Register Account +Common.Demo.Website=Github +Common.Basic.Scene=Basic Scene +Common.Advanced.Scene=Advanced Scene + +Common.Ctrl.ChannelName=Channel Name +Common.Ctrl.JoinChannel=JoinChannel +Common.Ctrl.LeaveChannel=LeaveChannel +Common.Ctrl.ClientRole=Client Role + +Agora.ClientRole.Broadcaster=Broadcaster +Agora.ClientRole.Audience=Audience + +Basic.LiveBroadcasting=LiveBroadcasting +Advanced.RtmpStreaming=Rtmp Streaming +Advanced.RtmpInject=Rtmp Inject +Advanced.Metadata=Video SEI + +LiveBroadcasting.Ctrl.Persons=Persons + +RtmpInject.Ctrl.Url=Inject Url +RtmpInject.Ctrl.Inject=Inject Url +RtmpInject.Ctrl.Remove=Remove Url +Agora.InjectStatus.StartSuccess=The external video stream imported successfully +Agora.InjectStatus.Exist=The external video stream already exists +Agora.InjectStatus.StartUnAuth=The external video stream to be imported is unauthorized +Agora.InjectStatus.StartTimeout=Import external video stream timeout. +Agora.InjectStatus.StartFailed=Import external video stream failed +Agora.InjectStatus.StopSuccess=The external video stream stopped importing successfully +Agora.InjectStatus.NotFound=No external video stream is found +Agora.InjectStatus.StopUnAuth=The external video stream to be stopped importing is unauthorized +Agora.InjectStatus.StopTimeout=Stop importing external video stream timeout +Agora.InjectStatus.StopFailed=Stop importing external video stream failed +Agora.InjectStatus.Broken=The external video stream is corrupted + +RtmpStreaming.Ctrl.PublishUrl=Publish URL +RtmpStreaming.Ctrl.Add=AddStream +RtmpStreaming.Ctrl.Remove=RemoveStream +RtmpStreaming.Ctrl.RemoveAll=RemoveAll +Agora.RtmpStateChange.IDLE=Idle +Agora.RtmpStateChange.Connecting=The SDK is connecting to Agora's streaming server and the RTMP server. +Agora.RtmpStateChange.Running=The RTMP streaming publishes. +Agora.RtmpStateChange.Running.Success=RTMP Publish Success +Agora.RtmpStateChange.Recovering=The RTMP streaming is recovering +Agora.RtmpStateChange.InvalidArg=Invalid argument used. +Agora.RtmpStateChange.Encrypted=RTMP streaming is encrypted and cannot be published. +Agora.RtmpStateChange.ConnTimeout=Timeout for the RTMP streaming. +Agora.RtmpStateChange.InrealErr=An error occurs in Agora's streaming server. +Agora.RtmpStateChange.ServerErr=An error occurs in the RTMP server. +Agora.RtmpStateChange.TooOften=The RTMP streaming publishes too frequently. +Agora.RtmpStateChange.ReachLimit=The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. +Agora.RtmpStateChange.NotAuth=The host manipulates other hosts' URLs. Check your app logic. +Agora.RtmpStateChange.NotFound=Agora's server fails to find the RTMP streaming. +Agora.RtmpStateChange.NotSupported=The format of the RTMP streaming URL is not supported. + +MetaData.Info=maximum 1024 byte +MetaData.Ctrl.SendSEI=Send SEI +MetaData.Ctrl.Send=Send +MetaData.Ctrl.Clear=Clear \ No newline at end of file diff --git a/windows/APIExample/APIExample/res/APIExample.ico b/windows/APIExample/APIExample/res/APIExample.ico new file mode 100644 index 0000000000000000000000000000000000000000..d56fbcdfdf6eac0f4727c34770c26689271d96af GIT binary patch literal 67777 zcmeFYc|4U}`!{@SGetCs%!DQx%1~mPDN~e)khut%$88(;HqRkMBs9@rPAH+2l%z67 zGG~a|g#E0oy6)?`?(6>jp5NzvKkxhe@vJ)cI@em?<5=T)Oy>yz1I!>U&WdsxaG(Qt z3jln4Kg*+301ET~+qV5GV*rGi09aXnmPJvSWj!EzK=cey!~!7AOrif(W&r5hPNDx< zZbAGbgedes%MP>vy1P+_C}DsPT9X0F5wD;8_@HP9Kyc%4eyEJ-c8>q%#|K14fLBYu z`SF1R4S)#^21F4*#0D(a_@YXb@ISM)`@jC+Q6s9s<9}x87u})@5B2r+sDZrpAIN0N z9lFpzN)_ej?};A&_Zmu>-cH@_-|Ok^oNR0Y?ElulU~d=T<<(@TZuyr6db@xCdnX%@ zfB+lUKR3|DjEp$h+d0|U8L9tjpqG?EyW(x{L?p%7+apd`3IV;8prxP)(2q>U$HzxF zdD*Ksp?Z25DQjyfYXfomW?VceF2c(xz|P1LWKgw?Mm$)yXh9<>ZA@GZx{=QSKD{4pGE@ zWHQ2Oq{-gS61*$oL){BSWJDx+h{W#^5jX^IYSM>_LUJh4T}DuHt882lIe-`w5Hn(L zR}X{=5;;E9T1HyZdz6S4p6Kiq;N)cq(V=8A$z4W7%372-5>Fn8s-cDZ42p>fzR!I5D$Ot+RM~R~&gg6{w1dWGSK_(ChGBWw@vZI7i zR2x9RnFqK6k$^gj_H%a^LHq-70WopTE#57NPc#}sl)t;XyR2v8$p9SA+k0dbN5K<) zD*U}=3MGzlaL8@-@@{K!3W#upXks)W+DBF<86^&138NzkbR7km(zm>y3^t3oY*;tvdU z^fWY{KgLh#p1~(FI+EZU85!y8>q@Ekl^BSX1Y&x6dIeghzwoa_wUw1s-iY9Dcw!~u z66yc9eu=0$+B-cngW!w*%^c-uQ3;j4kyVkAY2JV4Pgzv&%5+~}@65D6|CMj})jt|PC2jbX^P(J&%9MQISB^%%R$l&< zQ=pV~^1%PgIqGPQFY0J5Cj*8|>4#j;`!oNDRvy;$3?CW;7F`tmxt5U5{O5%KIUziL zZC;dLbo)QmGk?`E41duq3|@B4PJhxU5yQj?buV=+WjOSbt`OlvBsh6FAzei8F6rjx z8bgW;K-xwfkc@U0bmxmBQ3SW05y<9;ib%Rj`;hEEH%|uGfxjX_%GzDfhd9z~=Vk8% zGDTnAq}<$aWa9Uj7_TOX4kCSbbC>oBB1epj*m(g_mK2JFEYc@25iv3LNdA5GlgW1@ z5=Y~Rao$cqEFqEHL#2I22_v}XIB(QW3Pr-yJ5?hfB4Q*Ch@qjx3K@w+jsx~~IP;UJ z9TkzB;_%&K-)uh$@x)4hByN0?lM^@lpvjRcqY1L<1R{Fk*(j6UK&QcGndy=LYOkzJFY`^0{EcTIrdJ{1mHxX747C&~ z@kbFLvT9A}qZ%@KHHb_eP(+XQ2J$k{uW|wP01Z&1rvJ&MNMVKl`M6Ld14T;wJkI}= z<5AlHHJLo4NT%3R+t4MBuHWaJ57~bIobc#SqZV|y*D~~rZvRK;{I@7V2i3;L9`T~2 z2s;< z3<(W~0d!xHM$BPPq#O{2O84*aL1{nLW^^4IXLpR>wK!~vqb(0byHhI~&&520IdBu2#l4NA!zeU)Ge)kp`@g}wr ziJ{)!an8i(Xz%2V&E5_qV!BUSB3e}>Kz=@n@j2;hPhg#FdLo58!6$m{2_&M233Y>Z zE)6|m{Rm13C7RkbPbXGF=rQ*FhNa zoOZ#r3wt5gNgN8?_Cv9!1Qhy8!%e^aQ0O6x%5qTXCl5FM4?>QM8r%+4hMl3Na3Iti z_C#BQbd(*4B{+a&iX%v0as!!sUpP*11l0^Luu1g?m4YBB2|fsSLk~e2Q4wwhD?@3B zGL%OtL1nBm+zr=)vZ$lzUK<`Hs=_4G zRZBs`?HagTxB=W^4Zth@2zE%fz#fHm*n@ouvYOA}z=`J|ru-TXXubtG{XS5z?1#ff z1Ax_g1}ev1fX2x#IA+lWdJcVHXw?lmu03Gn@d3`b^n;B@4=9@rg1X%>7@ZviZMRW4 z;XMkrKErSUHv)1uL*VdT0%+a{hhsO1png9FG#?~`QB@i^6~%%>NfJ0zW`Ji^HW+8! z23*w@IQb|GOq;KO?bB=E`urxGYrhRHuS&u9O&RzQ-huzc9yk>`0d|pN;2kv%4vCZC znf?VF(`Udldj|ZjeTA&VR0u80ftcz7NO*W1it>t~xsU*D_v7GgO(?WiCO}%#JqUgO z0P-8}LuqR*^gIrSw~Z`v}d5zPGaxnm%+u zM|T$tysU?huO7i*UpIUl=z~YCW6;zw0Xy@xM=}9{l&1-w3mvyj+|+f5l6FSN@0moUEvj06#A;*KU6P zlm7wpyV_CzfVjB0s1SvKOC0?O{BHTDT=$5U)&VJm7u_Mm&(AACq1t}%pO8Q640Lt0 zG${mPs0V(2Ng+WrtnEDJf2C00KtsEAt;)baR|^r?J#B4$ih7U~rS!5L^GlpkAi0Ox z*jQ+3X*biVqLKw7IAS_6i&EVwix0=C0! zEX=etPEJm>D=Q8*0-wbt6yQuh$r2JN-26BOV__(FtV zT$)tLtIwnKph%eoU1Ot@!|Lj)!?Dv(C-meF7#)yATP-R`ITJUFu4ONww761FSyeR( zo}~#9%pd}kCJglt8Ed0Xe&cTz<*iWCw*oY0tm0t`K@%ddpQga4&lw%lw>qXRyGDTc zH#FS5wz~2yKTAbLNePQpqpT}S3x&YR>72u9TT@HpV^&7T4p9hp{KV(2u1;Oc$zI#H zH9T9(F9Iif+p}lwZSAd%C_U_^*s$FV4HSG{_2WmGXrnc-Sk%E!d}HH7CntNGGZvOM zj>blMhomGBzNedlr=+RuObs;+MJ$>@OH0d>3KLUP<1=S$&YZD8$@VlNkX^%f|HMxg zy*=IeQ;+NOi;Ax08x40~lYb#!$N3@mhXbd9Y}Q1FNV&EaNIaZ%p2tA0LSI9yLq$A#bk59BbqFw!FmJqHSwk_J%f>qP^)em#jm zAwUUtdurIjgGiYMA~?_S6Z!M^`&d7kLBq`(*9()A2`S-WZ)acOUe6+YWB`T0)z#(C zaDeZ9y=cBS*6{O-NimDF^Y~Yb!vO)2fxkNVD;`bZC;P&Z)WyY!_T}Zp#Mg^+2#@By z*1_NL=+ND~URZdotYm2^Vt#Rc>FukfIb1*#TG+KI|2rPK*YKq)D{(6;@hi)(R_1WH zD9XZ8I`{`XK+(0L4urqG`YCCC<=ZL+kG5j1gMY-M%8t_2)laK067HbGHy0EXy@p2} z{3rYygkN1PO-rEQ!-8VNesukNOoq@<)I zMMb4Wg$1u2zW>DkG3H~G1!kdmY{7?3Ta7seX%zu$Oe~u;<4TV4;{MXo@Y)aQgpOk#( zzu@|prkAM~+x}AV=K`{U{%?E|nStbi{}bYqzx-5W0{xLFM$a!p33r$tRQE~&r>XQG zKB};#0+=evLy(~;>=ZZ-3I|RDJ5M0+*kOU!L3zzj75L?&?(o(}eyRb8;!c9ByCEF% zGl896b|7)qXU#W_R9^=%+N{VY-2zF5=sLjxsmLeIIL!m;<^pTJXqKZGWIM`3?%ALI zX94m*ueeCTRhL6>)k6}By`BoF zD$WyBuLgkrl_0o{mqY&PVW^BzM7}B(`KX$3CrtGZAN5YSHrz)(YE_&bJV-tQN^qLKH+;>KPsRy)NLq00PJ<1P+=ePXf=L{L^OGtMCeB)S5tA z;|<6i?}o!CJ_1(vDX5%y0h%Y@fR0r!oUnNd76E-=iTqIO!1v%5)DOz0gP>_Y49Cw7 zt@)ycKBHhCi2TqScsN`d4jP$J;1!+)TE$^tcr6T0T@450Vj?J)$ACsnBAlqX2<~}N zU{{_2ZnZfOSd#~O4Hb^s9<)<}&HMO@9YTiDFy7z5R_q-S42AUvks1>qC+aZ6f1FDeEn%08+(-)Ia z)-()-t&4CAz2v_CZW*ePull(2IXwCB3i^9{;p3Zn80hbVHv{jX`{Oh`Ul@fa!z<7? zI15O9!KaZ)m>3^N{^=L^Iy(&$Ulw3`ZUz<>767ULH8JpC_^BqR{ty)Zc2g_C#mOPc z_iy!-ibp4R3-j@8=i=PM!zuXh2nTJAo%#>!M7DE@BY$?=zW`aAX||w}gNF8t>FMc{ z+&mJzJlnVZlutQWNwy8lwDPnn;H3F-q3xuu2=YCVze-_{nRrlozvL#i4J?P5Y3NL? zNndvE78Vxf*A?RD*^VsGjHH9I+57jiv29RbSx;^Dc)3nkLw&cfkghO4FApch?>pEt zElU9?ZeXE3{dlGE=+Ps4b_*K_Qy3tJ^U|T-1=;!uz2cXV{qoA z^%+BZJuMMoK7bE5u1>C8RK-e3U)(Rr_Tbsm78j@bdZ+VF=M1%WBS)vdxuADtX61>T zT)H%BZ+-ggQN4qWm6he0^QVsNMRs`qwaMk48pRB?beRKNQ+&PLnD%KOvpi<0bIifs z7*GtO`0~}fg2IAib{}s~4-a<_+&X#@2@M^Tj-lwl;K#v%?(XZQVL`~+5Abkz^9b>9 zV`LE6siC2*cOGD9XmGIm=Cxb+Ak^#^`pOfvd$_q$37-AAd2{1~{msP%xA1X6xBCdM zrae7EQ73K}{@B{Nfe$x}uHGViBYa+X|9ZhQAk5Fh-ThzfXbQzw^Y7dzmHk-$_G%fm zBU9A zw({-Us;c;ovapaq@4xr|X=HTdU3K}r_?VcOvhWbx-`l^Ab#+mi<6@$tqsyYg{@xCw zUDcK4@rXP+7^QzQE`O5;$8`J~^;*T-dvP%dl#hJ=l>X0pzx2~i!T$L@>YwbCBl`~m zm&HL8Lzf5f-R5hy2)Ba@h*)8P&*@(=^S$nRu)|9qcK8{>&cKr(;e+052AqbyR?ZM$ zZw{6x10h(65rUObyj*Pq5H*;AfMVwat&I??vk{_nwm^(NJH!}mUyGq99p8##=-VN~ zoCgw5@xet4en>VKL2-0ZNVDFtX1}D_?t*MvQOI@@gBa@raLMT)Tumpd(DQ~8)XFtVjVys&IuG#FM#AFS2%FR z8`ROeD$Tg_U>Ir-hVkxjG{pmSGX20h*%#EW1RxuQ5=&Qr61)oB4mk>ULX_YhQ5o4J zs&Fq{2kKHa;by2l6os5bwv92AM<0W7WUrLR8ADCtaTGg04iyO|DAsO@V(q7)_M$D+ zWm+S<#eL0Yxl!Z-B_&>Pw;Trzmvm5k-2h(Pv_p2vd1%VNfNT{nXu9RLX0N=s<$-Jz zZ+LYd2b;Es0|Q$cFl@~P7LKdHyuBFMxQo}~>TG-^uu0%Pu!~d!2a2zA?s@=xa;31- zFcl7IJ_OTKNx;3k9{432VfUeDps3RVl4_lB=x7JX>GXoE!!wXSJ^%{FgP>~g0#prO z!BMj}pmFv&V7;Ehu?sK2#PcPnTEBxMc70%A(+)cR?O=}UfwNw{plmS&sy3ex{xckP z9$B+#j=O#a3)f*d<~a(-1INME^Anu+8$|K;K~PI3fZi` zDF{fN0;dcVm(QI89Ey>r#^*rJjW{T;4Tr8;B6QZ}K-k-Ai0rI^50B!Yza&I+mckdl?=eyQOAu6`HzV z!(hjwHJjx_{}jCMn}zPtkI+9j3QcpLU~pgn#y_KLY!qfDhGAxE6z0CpqVJnX{~S*@ z{F4y-eQO}Jed|^!+26&V`8h4&eaB69a!B*A|87vHUk7kbOQMrRGUAfq+fIo-UzcNM zqNT!8DWBc@X7RKTpU6>u3V{N%Jl%RmS|vs*3!UW`+>(3u>51?myFjscj+vR6QI(0- zQuoK~u02BH$M;e6{k7ty;tkA9YRrshY|W8@wMYBZUNL@v(wnO@ta2>*a!gjQtdAN< zNu0FP-X{WZ?*_S0g-Nd9Aam>6j@Rwa&pVyB*OmZiyG34EU^#sCkleGUfg4X4+gR(L zb1*~7@^*2a#-S^0{(in5E&(*V51=@qt|`*f{cRsVCWVCr;oRdc1baARL?txs(X_sN z|NQBGctXhg-sm}ZBBI&!YY{&6m)(h3O8&MKyW|n+>*4u(ZQ%3WlFHSZ)vu$gK2brw z|EdRgS&nL}S66*gf^dIPa1~_ohe$FRpNkLr;m>%0iRQWo>1h!WnO%Ra z2WY(Xu=`JS|KGkp|K)E}bl2}hx&Ku@E+-0`kRID;DF@rF6k)rq64GT#z;RX;xIOiN zGe94Na7G~Ic^uBWt3&irR-}hE0YwjGm{Z>6^1x-g9gyj;8?w&HBON0I`7WYR=!Se} z*S&Dva~I^DmxTiN15n^93;D=rzUg}i`Ok`Q>8vu+L#l8arwYY>=p8e9mns}<34Spq zpb~BiD$&R{j&g*Pg!7=6a28BrFMv_17o5%tf_q_yke<;+KCm8CCmey&FhjUcG)DIp zfX}dn+Dm7UziSIo#jfxuLkk*nPQvROCh#Q35?Tt~;Mom-=tDm1Y_hKY z4=C5e0o7KJQ*D96TCYLQ1nGiPgP>>j7}QVofWCPr=$(H8Cv7^wz_uUE&b|XH*IrOJ z{Rm1{!=T~t8T7oy;3SgsM-zfU^LiMVT?qrzvScu;O@}iDL@;}i4bDy1z^$zWeBYLX zfA?K5Pn`v;*eUP}{|vs-6M%~u2k+QD11_htmpmh8l+@0!%s7EVM`)C>pn@LdfW)W(T+u(G@ei%aMm=hgqM z_m{s<_W#ZQH&@{A{Pa|w(YXKZ2X}+$O-El8Kkk~d@h{CCc$|7YYsd23dt$SAC?Wn^Pmt| zR&L^MyCd4Z0S6Br!Ud){pARuJ(LAB5qm1F$CrQY=lHz(S&h(urJm;Ra%{m#b0c>H-QVTZ3vMxyQI^MlmoH_cx!G8G5Tk!rqZ))=cX`7+VUDr41&DHR<~Cg6pQ9yd#%2nlAIQ z`8UV4$dB~wI-SsXm_NHZF(WZCF=ICHNB1ECso)Eog}?rP@O>)Z#k{TXRzY$_?Sj$f z*zRK&qgC(6+%>y~b6Fg4L9ZHLdUiLBg=aR=%*g8%;>ONvv}|pTz0(!S;7Vf2$1`W88H3_gp#POu)sN6(7=6dWaFk3mElQkQ5HPz?n{AuB}HN?=DfvU*M_dqGsc>>=MEz(kOGtQUzB~yIy7`I&g&9 zR=O?D%*Mwtp2-r5WgPHLxx891eY$>fa7z4}vr3k$n!vxpBBZccRlLSpp zzCHO@H}Rbkc56)|uV#>9m52I9JR@E&=Df9!>13Tt!}FH*laV*GI9j6tY*f6uo@=#2GHJnb4o>iAMq#O2F%+h8ru1uTxt`3k>iI7v6Csw1Sj@(yWFnFA!a%IOgC);YHo?5ZG+5A zGaQUz5gKl?7|VYR3iA99G@SSIN}aqH9GTMU$nB<7Sji`Z{}?`tY+aRQO@Rp!quz{131cPD*1v zE)OP7N!5CAmCMqx^i&xvE~jjSs_VN4vgotoHt6eazDk8VW5Y*XoudJ2RBbXzke2dw z_YQ@GDh50&w&x33foWKhYcV-Kp7EpaC3G@8b?t+uK8IV44V)LfR6#8q_u^~iLoW;w zpOo?>t}#Jlbtns5KISiT%mBMu0tcN7JGu(AvuQ_Zc z04*Kq;I*&QE5#Gf8z(Ppj?LH4jo;e8laKH|(3X$pFnz8hS5a@UHZ4uK{`ScZCFP6X z3n4BZSh7zxeV4qjKlza6C(y~h9GI-u#sJ8J0}v1a6{bdyry4$ua|a~u%VJY zJw6i6`;u>DtoGCvnj5DL_Uv9&X!RLZu)!!A_|AUa6s=brU4J#<2Jn3;nPWdn6}2wq z$PAN`IwyWOKWH`bNBLJ=Ovk`}Vf=YrcHGE_i{!1bp=%C%3^I-^M==$#;tlAk-q_nF z7~`h4hK*pdE-rFOwF_Z)R&Kfr_X~KBP;oKzh;3}22;RbdTz)B7f0IRPYnn0z;!y#dz&44mWak(Il;u8EBrsD)=RwT2)=5SLQ3S<(9D=puQsp z2YFbZ@@GA0v(D7SCrvWpZS|P$FXwH*xoI)&GM}AVsq?v!Vg7*IW^37wc&O8y zP;``*)9-~ZCwk^Ng8L1aF`+VQ33zTFosYN)9`7?c#o@Fh5HGHBu5@Oc);!a2u)rwdS! zFWT|YXr2C6^JJxWr#0(`@wfPc4`N4z5?aW6lkvKdtuuLb+crHiLd?Y^&M!Z$^OF%~ zca|x|#9$_e88)``U@+BlvxWwi?Hke=QnbjL>p2IsInSBgtTChk%^uL~rQ*9sB8DYm zeh5U+J8I(3J$t+5sb=mYMn?V^-e8`DCK}hovqO5g#e-6{KPq>g(&!-8ej9TqKb*(z z9GWpt1*^-gpC1OMkeTL>Y{4^#9ivsvMstdGI8Yy&#+ zS^M?DG2y|~Ce%X=HZlEOB!#gF3H(=I{3FQ*sbgd`8pa?$#=Cig3P~7bTGHF1Y)&7cq0q- z!S20k3(|>rs_#ac_1Zf5J%Jnti3EVcN#hnU<+Lmt%E# ze3hAw1vTjM*e1`>3B%!I-NJ&wMO&^5=_k%v&~I!(k(;d-+cQkC?kIN^2yz|?7rRY#?&y3BpACohMbremJCU@jA6dWmB?k>b}x0LdXIbtULaDm)W4PY zML8?|<_pH8z^q7o`PQbY(ireTQM?*fy3Ko}1}~`iZVNX!A)KVTYr)ahUs*e&F5YiHzsvx30UZ%6e@*6r#|2lcBG7@OjnWtVu%bF-Bh#t(RI&u2Gt*6$ohe)*$f zVb^Y#SmQIi+wlVQ3)FebBh@Cf_+akwyG`_CRHK7;u?G#gV^|)GRf{mDJq@rZ5?CB2 zZSEzEJ`u%+o}jB>R^m7&#Mb!uO%t`pbwSMWiK0)K+*jZ=rDSi#dApyzeWG8svrqz4 z^rmK{zizwX4`;$1h1X(pheNtHpQ)OEt4LdZ@sm29BQRi7sNY+f8{Flla|;JI-EtXp z4pYB-qoF~AubS!YZVVg==PS<%47~GYrr8s(o+`qkR4c-+x{ydiE5~!?(fl(}jSfX3 z&AIyzjuCY8h9CmI`Y=;*%xN$=Yk1BSPKKfWK4qrnPKFy@KcYzGb#eQeBK^RwrLnfPwA<98S2P8i)a zA6qBN$@sQ5g65r*)T>Xk_~>mMny=wxy|#9U*OW@L^uWQ>`udKzU7m8n_`TP-bzr4# zv6$9mKnU#arLX6>ncmKEH$N8*%~I9I_KmWT43MB zU(F=Z-u&R|7Gl5duBQ4!^!Tqce3JDy+#dE~NPCphJ;pV$Rx~d!)6g|h@3HirQgJ!Q zvSQBr#`>v6gx2wb?<-oHu;(jXvr0o5bC-MS>R6-*@tIBY$MPiOCfr4|ZE6KDi55FTQFeY++T)zV2}^-@PU{C3`K&T%SunGUDg)wl>r$OYBm&k&>ImJYIy7?g2y5Ji zuy0859XU)qu|6bSJC`a%o9|4)-FJ^8=!Z$BLYPB`sVgekGuu?F_F3*5R=OU>+Qek( z@Zkc@z?bC=S}vcC3))|5GjiU2y{H?UB}%vO?9HXen2qa1Qy*uVOjnbXX!e@oj#O-? zS?7F)*vsluR{uB@Z$P_egkOF*(3?h}9iv)y_|6j6gALGM#-x;u1O_tpJKxr?;=gi} zg~_?K1%F4pW}iwBS`6JnqrnZ!uhJo+fLjATKbiJf@8uV4wjuX6{-h>W?fVm}dt1_q za8OK|q`v9@MY;6E<|hd(81)LQ$+1>R1@)2qUAe3-d<7ei*Rx_bVpB5kHx)vjr}-#j zd26I*Y*Xms7pRKj))%qS?3{N}r`t1$p1ttHqx0OQRldh^*(VgeFm%^Y&!7C(l?LWY zFyH?iyn2nCdOCNqAzug|lkz}sPg&%E;N_;wDkkZ7M-S}QpR;VW1LJLm!pV^jrd=$# zHXCnI0xfeZR(TD+^-9;2RKnbe9Z4U@sc{l^Kx-+u@WX1e7M51%@q7Lz>V#dyTTRrQ zI`2-WUFphVGE!8qmtdNi9lnm^l`#V9jyOSZx=h<6bw^5O1pC4y_rN;qOS!9b?T-G+ zxjgbS_fxtq=G>Ci>p8Q(}dlaO#z->>;p<0qE>4dx1OS>+MBoCDsLUzX=+gB z#M98aTkssKZQINQ+ zB5^$yN#YbQ9?VR%I0K(-?mepeFENwxXgs$#(m%^Tx1kA^1gw!of&Q}uO%{kjCqd)3A4Ms}YQGhaF{B;m7YsD}z>`C{fyLu;54QG&kl zS)S*Jd%+StK|OZ;{Y&+Ik4NRA-K1z1mGRQtecM@l%wMWhThofmPRUcT&TN_=Dw%Vb zxF$kF#syICw-0{1UfU6q?gYKe`YzO?-ts$V0`T$)qDBf17^bhwXC9fsf!;J;PNs{e z;fDQ6#!MLBBVw?&U>sj6mTyyn@VaC4EywZI`-NLIg)T>i>&t61*2;huIn9&2Zo)a!>Ps%OT+tK zy)(mn*nMHEnd8=L2dJgwsEyan%P3_Z$n9FVTHg`&q(A;#FfVPJHRG%BT-M~64YWJL zum?wpq?XceSA2uG$Jo8GrVC(a{YHO#!NA3OksV)x@`f|C=Uag9YC;0Ao~GT(Y1mPJ zn|kycDYlN;<1MzArF{apRK&T=R8ziQ6xqB}Yu`QcySaOJu{0;!dp2tB zCt8!GC$Hmq?b+ts^hL2wo7RWaT@e<$<2Tc#(#$60nrUFr0vcmy>I+9 zJZ6R2P{rh@oK2;9vql&&I3bLTFh2NfGaKL;oJ4a~>ckvbN%W1(LetpH8?IBGSTQ;W z-ACGO_1b&u+c@;Sso$AVFMI&cp~s3F-xwzKlPVZ7VjM5K_HATa=Lp-@S!Y*#W|?ge z6nm5yD7^mSj}P`EACx z7Jd${q8dF9nKyFH=|}JLOHi+*@ab_5o>7UE;9KY}i@zNi{6ajQli>_atIK}ldw7e% z$GaI>BiQr}#^$I@^-oS$Z3zALq< zSQ=AT^)EiNT0Yr;o_|wjBwn~v-ARH$0lXRU7}%X@7`01%3!y%V|&X* z!d3b8tyXSGv0-@Kv4dplXW0ps+=DTSwC4M|-dkM@R$%N2E);HVJ?LOlzu#2czXV(2 zIAGKrSyEyfq_#xwSQ42#CvoEZ)ICq#XS4!5g&*!yGXi6gA+~VqgNn#7*~z{IbKNQqn2&Vd2oAu6n0t75beRblus{1LhRf) z?PkT7GFgVh4~!DLcfB>I{W=Fcbc>{FGr9l)rddqV5_M**p$^i{GdBfR%@m>q^{LL; zOq@He{#iiC^W4d+9=Ux7mnIy~WCx$ssn>m3ue(dxp@b@1x~OK1*Rh=6jQu#q<{MAa z*n^J+j}sUk9>W|Kbfv4oQ0H(AT+w#a-@~K&K3$Ehy#03n4d@>`Q+-fTk(}g~Jrj|6ddy!T+-Xk)htM5Ja>j-9V*Uh-MyU>!JRsSgA8jDnz zEumT2%t3NQ%K7o@I6?f8#{M${9s@@j>)Hss+h$Kr=v&wyk=BQ<<{MuOk8MrzM#}ox zg6F&*ZFHYQ!}GS>^s4n<*BC3M+f8Z9x?MBR@|?^8hf|tcInD}6n*ShqZdKS<68y4t=y;|V7v`!F4|cEYfg-+%`@TCpqBJ!7BQF(Qkgz#DHsH5CH`a4Lo0`qiG+ErRL)7m3qc6^n zQqJdApv}Nf_$d!`5hJ-EZ#R|(J%;W-UQL(lU#@~@=1*b|Dq7q;taUu6&RUjX{;X^K z39Rr`wo0*ia*Y-&(B7#R1Qkc`B{gt4F$& zGDjR6PBVY8-D*brWBgX_^&7g3;ti}U5}%Ks2@qX!KirZZ9LZ( z!>vKAqK{&UQmiOM|d6<|O&33!YdMa7Gqr+j(7v($q z8Hc3LJY%kGqkG#PJ}vxGVi;6xmyz|x z(D`QQ+pc#14;EWGF5$B?A2&V{YnS4#G^fA7v~NdlSHlC3Hiex*K~U*fan`kPBFoJB z@_c?k(2&yrwpUHzSoTs6$>UJ)R*bsn4C3a<~Y%C`K`uy&wZD@ zmQE!4{>5kK zPBu^O?v`xbr+`zK7a6%aZfK;KRI;g+6U8W&DwprC5=n7S=rGHo( zm(IZUa-wR~eqX|ULB@e3!Bx&>s`aX+U8LnQPrIlqr|iA7)wbpfuHvwxAOE2JlAqcsG{7-vUmj%&wYaN@jET`@1oGo!&i}y z>bA^?DAY~M*DmPXl>fF_XfP*qS4E55JE^A%tSx1q!1hVmv)r)F=WgL}Swdc{)V9T) z8s%BT+3UXkSaGaAc0C>cY~AQl?mfrvgjT=9x_zn2%q?6PpWx~~`g(Pq3o9h}fU+Lf zsEY8lOgPpv!>>ew)B1_Y>_)ENq`awL%170nNIaj*`7eH$U#17D=FFeCE9RgNKdOwN>#S$ zZIH(YUmE@0_Y#jd(6KPk_jypCS{Ge8r-9oD?Fyb7?Wf6HZGqo5886Oj-0^Ug*~(%O zu}JN|NsWyWW7%Kl=2RG$u}Oo)#)M$cJL@e*wWBB`{X3r^wlmU?9K<)XWhXJ~WyIIb z#j1-Iv=0RXvklHpCs$wQ`e2ikEMUD6IVDI2Dk<93$9G4H;*?Aaid(-8wP(6CUXkf% z08ts43m-r38+=YJ;<_XlgsJ(q->Z%!{`vc~n!A-i@=eWylDri>qbF=HJY@@_s}Z15 zX4!M~Y7teq#K1}QGQNhI=Xo_fb$Xr9I4F2$e$1<`ZHFp%FFTVZyKU|s+!2~HbuQRC zzbh1H@x!yDgzcMW`$L9Bg+=bnU$-{)>y$8Cd|ZLPvDC|HtoorhkVu|)nSH(eVIa2A zB3N;3xd`|xCbd}i(FgJH7Tx<|QoEkCAByTXeCs9X^l?Cd4pT;I*Fed}{JSW&y*YzZ zU|MQGg9G?OC=XKt==Z<6zc5^v=0hwF{2{T>+aK-zJ&4YAM3PVCQxyx-H5L4`C@KC< z<3-JFn%(9YpL1HC@404JkDA`AEB{P2bIEs!gHiLa9El!sZq>bMXxDuMC*o5t+EpZB>wfi z{QCxFz7O7T9lx^g@a`^DN#y zmzh6);8lJ6c@?W!TVs8(-fsyc8GnlK-#+{D;Aw%b95u=uSL3aqltuQ*o- z55`~p^2uzQ6Z@uFz0U*g{?E3}^3nxhybsKzH8M%w^|;DA_li$9IA=6)F~1kDFEf3I z`TK0997QJ9hp|Z87`Mk1o!dRut~0ItWBJ_VyR^---|O0z4z^8JQB9QiaPuhoV^BP} zwQ}ZphQ3kj=_7O7*k<*X=O@`iLldslJ&UPZKiM}vF?7dNpBDGz1GSskF%lEWY2|GC z!iXpFM~q?MhhU}p>reFXi7r7G&whDw^5d(0iczg4ix)q#k$coMZwi5i?AK4pJ_|vl zlF}DjXZAT$r|ytmJ62zwWW+CTc{^RlF7-nAn!VjCCmqolJI~=w=RF!NOoDb6+OJ5+ zp6RpCnrkGn$7esOzi6yu{YqT^ptb=fvwZ)JD5`{Wf-?onvYnKNsgc-r=%^Y;3y)wbHprSgb}S>fdqdy6*gX03_g4=4 z8!t_WtZtm+V4by448mvxjiqUn7swqVobGzKwdQunxV#FE7V> zTVFWq&4goaySt%l>d`{AQr~W@@?jbw)r_{GlIzU09tH|Hy9VxAN$SHDq*)^vyQM|@ zQ26}A+t%!s#viUo!1>g3ZzZ52{h+-rbMM26cN4SEtu1by@>NrAsn2iFi<_CxD7-_8 za@@D%5xZC1eKFc~;6;DDZpo&U*t_$#yu+XAmK@pjZ{KS0Jj6({6~Yrlec$ORR^Jfe z9y|N+2qu9FC)BrRrg?|WqQK2MGj*N5M{Gm;`KDxP6HYDe8r`MhzO6UtnX|nEM~72h zkN5st{kF|FBS{lpQ`NKdmpv6ffB#YAEMvUH(~^qOe>N^at!S0`daP#rU?(OgDC0>< z4|SvU@y+C3~ZKR)Xm(#5QgB2CaA*-!E;w{OuMEvYZLC1$aGMw0Kb&yft( z+zspIpE#yh(-JM%MON%@)OSs>;0bLS6E8<3bvy45F~If5Z>|G7zP{Fdoptbb3x6A% zi~`4p%rE6PKldmXsm)Z2lTcMHUPf}0!!CSmek0A51@yS%I+rW=%E&=`B z^@ZnfR~PhB@B-9Hg7Fk*iz&BlZr$iTEhST(O;R1kzB7G^!{2&HZ62>*;>YSYZs2@yq;w47(wlA}GzTEx3)uyHv>rGGeg1fXhjp>np{~P1NLD zBsI&&Rv6#=vR8u7 z-bdM@gk#E7sty%h7iO}_PK~qNPWL44#=_!;fKT|&#Zv~Br6(J5b`gD8*xdJY^4EI~ zeEn>cc&aaCVPs{IwQ7MNrdLgp?YzpZ1)gj{Q!J&!;+lI$b1m-N-*A+k#cJ3+XPb%F z_gF>I$ANyLdvkzBAgliY{(ag5H;2I9d-iy%N@XHbz0k!?mf{3?0iWGlvtHYZ)omI0 z>UNx7ZpN46x_KuHmJMV7_~HIa`LW>(*LC(eQ29)2Je+RvR}2_RjD9atQO<|$qt8_w zWV=T7<9kRf2?bFlA`4eZim`iY=9eZee4HGk(f2Hwcbk&lS~v1JapBhLV|$H?_#kzR zM(9CmA5MBK-K0DZYw-49G4iO>RH+3^pC6wiSuu(DCLvL?lgw*apF1DIMN0}&Sh`5- z$XUT&?zvr#(7!yY6MxXHwP0c|we0NI{*{y8nR`r3e823m5~y;w-^cLYfaWrTVXaQe zl;^vrW5G`*->jF;q_s=kcxJ}1ZbL;m)47TZXTDOI&j%{*pLMP9aT^s!i@Vo^13J+f|8@~p&`XIB1 zi`9>$<4wC|kErrFTDI`)#a3)C_l(Y0==N`VZzz+|zkQpk)>&VW=Aau*Z1~~F z@l!{#RvP=AYC}z_$4>?>U+*kz0K1v|2+ecfzqY0woRoRDM6e#OPA~~-{K`?dG#|o` zC;N<;vNLt~>75aAmJoM!#l^9h9uU}OZF#KTxW*yUnQqihgN6LjrOqXsc+thU)-6%G zjJ9>}DIuEcl@OXN0bEz!XEkQT_x>*c$Ury0fyLKdKeYV(u{YrKpZp%0Jp!$-DObS% z?YR zTK{U>#wkxP2m<)6yWf6OvoU?#qFCgYL>e+61DMb;jLdX5GJB7RV2y>bW|4?)UMadb zl1cA09+3WY5O8QRM(VMTe+jPNhbabM+QzQ^Sl?X5LPr5b{oOPj9D3~yBaeIL|NCuB zz3N-HtN?rvFjoK?d>L@H#nt68%=!Zf;xrJ2bP~Rh`f>%3$auu-BP~dPPf|XTkk$s{ zRF|IDLBQX-`{pD6@5g`eqf@PgKWo_LqA>=>dZ-&lxiK)tMBMACyGAV-fK5dj@z;b9 zitr?zkZ8nz#z5SMnT6fh`11WD_gQ-9KaX;mO>J0izUc;_(HOdaxxRwl=O2VA%*bPj zWwl1gLIYM?eFlsMzsPFdmsCCj{-s*~xOc28-hiA$NRgga1M2u0iHuWydfpPi@lU?< z*6E3*6BDhu>y5D<%*OaXHsk{p$S&CXf`IW za_66q+-Lr^H=u`psGj6+&-AhHtv^0;{|le_C|dnO)W?>7!3P)}@mGM0j8OsWAm9s> zHHjp^uhu1(Is-1Lb|~I~sxCc#O@5pPr{|pu@H-!W$F;5I?D1wXc}&=wr?3GC!aVx_ zgy5$e-N*fq7c309WcW+uE5)UMmYBr;}!f$4dr0Dk||Kl<*O$-O5g8nefYvB8=L>unIEez5LVOgjvsM~wjBKGr{e$-^hWP8@CRd1uAD>fsjs3ua|)BrqW$RSNA9=uuAfO>K0-v8|Nb8w zxnKX8C((GO4S-;*-MRp<7OB-oq5uG@N_IKP2>dNsf3Am%OQ65;ki6hI`7 zye(q|Fg!h{1n|3m|IUSpV(#`t7`uthkTza~^THFOYy=2ngT^AOU3jM?E?G zM?pn!8aVt{lQ$-Iv|-6u6P}J0vx)v^?gsrtAF##1{Th1@qdQq*V%=MD`_e06=az5m3 zK0RkHz#rWE<2TK;c0W4Z+I5>X%^196*>6mg_5ie?=U^aUe5Y1Hz`9@{Cj+WP{F6s= za}^L$d>E$w$7Nz*5t!^Z(fR5ZhVJJGnEw8E003Nru<*7YA9<|ym+pmKCjkg6fUW$D zQUKb=&m;b6UIR{{PFs9UK+0mLz)$zDRRA@>kGqVr{;{Fj`X@~ur%L*U6TpAD_gzQ+ z_`aY0)A`8*e>TyWUrc>_mhgIr5B1S~O&B&%fZ9LC1LD3SSGl9P*r}>209*d)_yX5u zN`tkJePHCiv#|U-s5@DH%_s_9b=O)ICc`NNxf2=z+9%oNCiIlmPzdzMsBze(KPPnbw}0ttm1q zZ=!XF0S5t-Af8eKV)sor4XgL}DGmiH4MC_p2F!moLAY)g?!ws!fME*2Al*MGf&QoN z0+s!t`!+9o5z1+xc-fVp#>DXBv{%tN@j$fT;iR^z0A#`v7)S#m{tEn>Kn4LHHNd?z z>mLsn3f3-HiHFoVgc3sNifG2ElD;7^fd6*lM~}?3_8o5(v)B9KItReOkP&cFF88^^ za!^ksEYJBfGW_m`{tU<}q~On=!4I9uwKw2a&%>==0GWO)Gb|Ye1_mbq zjgCR@$uFXD=oJHZElmOJnZ^9~{Mg9jY<}Srzy*%}g==E%==O0ltx;BANBnE#Kh(K^ zAm0>3yjF?DXBoR|TY<13;1z-h`NBkAIl05s?@%;4ZYBk_jQrwm) z2_clEP7Qp-b3@uTRjIP@sywS4WXpWKF$)Y#UpE5yqX&NCy19vi@0lp(kNKP7K*qpO z=(WLW8xx23AXK0x_$ZYCvfge5a$w)vgWZGGSP#PZtU#y&h`?6hr(PHRGf#oq8wq&5 zvRCqXNHXeK0O`o#Z~xPGfo}dqzziM@m_GJq(8TOeb7j{~gPyoh0jLQt`rJygQ3Pd{ zo*_#q_*Gu)|3z84YZ`FGPwVrnJr3A~D7_B;QH=0|EMQz*C)Pf?1Qgb>m6xy~69zF?c-7!t0l$(u zZS=l&5-7_A{JL|A^>NaTMgz3qA8F%9EW4R@JVH2?Fwq zOX>le0yG>1I$ogcvmk3bzV4$fIA6SYN-3cb(z^8d08H2^ag0e|aC+7R@S%r){?_@{ z6}L|mvx@`=M=tf}gVhJrc)4sRwcUs>Z;gRVrU2`h0TAUm`PqU*GS2U(55qgW&Vq~! zghQasjTHP0T5a`R?CX3eHOBrcE?Hd-k%7j?!NhAgW`52Kz#uP9(T`~dO z@$kjL{N|Q*MC#Qp+zEhyTi3gVhT(h9nQHydDMCHHY${kHLJ~yDs`V7u3hb zJ)ezW$$a&T8U{30fj# zkmne{mL>vmydbNilGo=Q^3gQ=b=w*E3l~d7m{gsU2<2^KOCL!@$U?VkoCc=W1x#U>8`goA-oJCR>vJ8^rt;wUgK1ownPAb_t-BiOcuLupKo4%TfFAKi~6Ag+KAg#}EB2!198 z?;5bbo^A(3$D2qJ>0^F8BuEnM5=S9CttY*%CgQJ2LDqE~`oDcEimQ*Ic-eQLTsVTV zIaeRzvDWQn#}H@o)*kW4o#fK(~d@K>m*LKQN6XfR8=#?(1e7`;SjG_8w*6 zC*VX>0CDOri*xm(IKEG00XPA_pCANZP6Z7)7$}4gVg~Y{kEj7sBLJZ;RtNAMz}RR( zBH%;5;tm9I*mQ6YokjV@kD&KwABJ6M0J8;(t6zb}%f1z~|5Yfbc7t3mcFGD^qZ;Uc z;%`CMykpBZ$Nl4-=%4E*om|%!7{JG0wvbGi36xv?I>4q1APxgEK~{mU>P6i#P_h20 z?C0Z3LAiH{#aASvt$#{r@%Y-U7^i9)NC3-U`yUsk82b}4l|H!@Qe&}A92@AWs1v8}saaFK#zVq-I%(S0IcXIFO8)FSt|MdNtg{w+j z!;^cql0-d43z~qm0$7&dke8$;!+tsNYsp1j-x?C(o1lGm;pWWx3kj%w6ZZtF9Mby6 zsXo;bz^6|Bo0}F|FFrm|EG-f_I4V8F6!7DWzI0jp?^*>|GANlWh#-Etni$0EDzgKV zslOcMr$|5m^5TU*k~gF~7DWI4-IwndJ?S*-xn zwPtv0uxrxF_T_7>L|vNS($(3SDItK5o&4n^bB)W7FSK5KJy1aA?`xTlFqB7>MCGHz z&y+zHBZwAW#pn}vLO&NkieLy#Ch^#ia`Kne0hFr{)&od^o?CeZ^dwMNGh!eS|6mg9 z{PQFq%xnLXe}~qK|2uT-%+MR-?tVX9$0bA}_DusTJo~Vfe$F1|Nm)zd6bBj)VeQk}kKTi>` z6xR!IbwE&!5?JE{f>I{{z|a1ZQ3Uqe5lMnnTtJQ!EIiLFBreUoK+!dj*Mf0pNFx5# zb($ceixA5uf0gwanh(`pxa%>r9{y>x4o;!@vR9%wb{)#OE6{1~Lf`pwY*~lZyFOh7 zYo;hDD1a@y0Q@wNssll_FtF?MVG>dW_?k$n`2_fiSbVl>{Y7y=fm?4^B%*_Wkm~_e zf2?E-|G}wo&*^`4?PBv~$7dRcj~U~wek#ccVF1~KlC5|0;7%IwOGg3_%SfHk!fUs| zmk$9#M3RUBMpDOMmjFRs1k#}39`M+F2nzC^VnO6DCF=y(iHney9To9s@Jk0&`xAi8 zC)ct0#2V=DKMMNYkD#@C0(3BgFA2>dGQBk+Yp)OD>6`{}w;(8uzseTr1ZshS!Gr*AmXG;<*8 zLn8c{{|+$7_@Nao8#1O0ib%-V4|pWQUUv5unGXc)%$uoXEw2Ux($5(Ea;Ah2GmDMeNwG8 z{$;9LNczam0zNlpS;{e!JPUqDrt+9wu|DkY!shio}NCstl# z{0~lzo?C-K2bMe$Skr<*fdc-sQzbfZ)PsPXC+;wSg(z4(AOIeb9I`nBmcry9SbwVw zPY`lSJ&+IvOy&mUBLm@B!C~-cCXWJBTnE3LJo1~o7!+bX^xu>)(#|LyE(2~Pf;=x9 zEBWeh-(VsEyk1-V=qIr_F$MdQ*P%0W6djsEudKh>F$h>ww*q^DQ{lfF;L|AJXM_U2 zKEtg)=Vh~M52-dKM8MZj4yP5sm;wf+M(KJ0y57*k0H%OJ0gDDabSw;-Fos|aP`WOh z=|#Y)AR&2yFY5%5wf;YEH3C+S9f+SFRE5kPAhljSEeJjiDE_iSwZ4$3Xx2E)!+_vlS5=aC85|La${-#6 zdjbglEkQ24Er|2gZ6w<{@4%l7b0DYkL}7pO>-Ar9z8%4VzxI?X{R-d#PgY%l)v{g+3MJQ&bv9ML6_gyIbe0>*)@Sy|WiHDC|2U}R!qJXg$wy-eP zz!vs|EsAAR*kx;r<%fUo)*VL(jltkY=m}2UY==H|K(q-e2|yqOQ^2AbhVmv*pao+} zkSPJ`!l5TpUym?wOd+}fRzi8XMVI&f$*e=plPCmvF^7rjfZY@p0&#X<3IG8-pZHMl z`&Q}eq&vP?zsz!7GWhvcsQRjPUkv!wHQ?6PfuFaA^|5R`f8G!+ZcUph-B;J05C}|$cyzHO7_k=0T zvbA>E7`y!7Z~lvKdO~POpA9MY;gkq!iGm#Z)K{P}Fs6aRG+<2=Ad3Q%urvXO9>|n1 z=modI178Ay9MnS`>f>QNjvWv|1tDYJD}E1pKiSAH`}zp-PyiD}-8%s4BK~;?+!9zb z;A-*!R6c?g>N*RQBp=D6@(~a2^$aL=ulRr(n01n0TjvV+8C0Mc8-Y3&(qqZ_hkCf3 z3iWDP6M^n{HNe;HQ`apeDF5GSJApe6eJ372{OvH-q9`n^Eno@@Q&?DQ{IVwi|A16s zJu#R-2o|>)YjMrb|IUe`**HN&%huTC&;DOO_E-&uUeKu_7E3xWb9JQD2!5yzo0TC? z2%tXt(&+;spb2Z5Fs23LEE;AK4qX`Z;7lJ5T>*0H>aQq*?6ch|SaX05$_s*OR7C8=0|{3u9Q@gCzC#hi-)E%Y@!f(iWPOW%q!dtVM)c&l%0p@45- zm=H9;dD(vFb2lhqsHJCW6Uka8hrcz{D+SkW0qmevN3k~6Su$p1xE-C z0W)7xZS_gr-~i~v$|R)0Ozxx}F6#t1C3>z8LL2O>TX;ffm=>C7p`?Czt8f=3bz#vD zq`=P%5aNSI6ebYqNkEjk4hU_RAuxnau0T->em)0(p=#y7BE4woRUR2YN8|-|3arCF z+dZhhc#Z-f$>-qIz^oyKq-|BQNrA813RRy1vI2f${rMWpwv>45tbd1q5AJ;(9z1eA zFfolrp}}qf0Tc@K;aB+A&RJs;ix0yDU;+ssyhX_fDR{dS`kygJjWM^t;1&S*C;#i8 zJ!%Y=jWNrBS-$&UzwLQX2o334l@2aFKazoT95Af8NK^spCVT6}9mvT#Q5DXiBt;1D zgiu(o5SnHZ4m~(mqNFZL>cAQYXM7BShx_=w032A1F9bo{&JCA{e`s#@@J~Vzh}Q$j zwc$Jign?VlhmvB_B0%f&x{lEie^oc>d}@u8Jn4J})CBw)80F4Gor_*hfu9nK27a}E zeZA{QLD$8%<#WXxKK#;~u)6C?FY|4b`X&bX1oYN=D<9WI>&~DDFB=Vb6Gp0)8bG>E zmSK*1GBCHm0N?p*AM}JkScb7D?)+D8xew2?6z2gjNR|Fd0Gk8CXH`c}t^Tlj2IWB| z`skroZiqrCjE^4_riH>zp>$msB9ycV3WQLi>utS^5&)hY_&Wn?K9B->B5f}s;vcV> zKu`#9FjzD4P<2pJp8}E23%1kx5-??XvGgiG5d3xERA3asL|%V-3~4h|o4L2eE+PBq z{V8i>+&^BsGer2SL*I#iJbD9cVbNfj&sJY60B!Yy)Hg*0x0d+g1_-dN+76koqCaI1 zBx(TSf*R>>M*|t$0szazvKl zAs#*jd}8VA!CC<>lL}ukr2ujjA^D`fNFH1LY&S8a27pOheW|Yw{8D{dpU;PR7};?L zkxK-6UT-87sN>{h7fC|b1$=z=3Vis=??Jh6Fhutw@J(3uWDtgwZ3Mh!i>@rbv3}TD z6oAzLkAHn0aTY7P0ij(&05Xw{*F(ztoLK~LbNJ!9fA^Ow04)Pp2C#hRuYBVbLPKt) z?yL-04fa9cuLCnt27Z|Iq5uFO07*naRQ??Jy0c{4$YmWj-R96kw;w=b;0eLB(6Ccz z**WxG2hNq~Q5(*6VN4$|{)3`ElCHpC_YsewVCBoC@(Nt3a>()w8V#U$A>#GG;NiX$ ztW?P-#3a|S4wz8+!SzXAKRH?9)R>X5x z`FLG3u&Vsvi2oMyd3{0{IeFBr*XI?_p8yn-lUUrl2eh_YbBvs%(qlQ*E@>mhVNIeq zt50tuB5XRshi9(9JuiPd+{`ZT#lr!4{*-IzY;!?`#RXCTmZK4@B{%9L7w~h z3CLwXUK8h}NGU}EngG&OG-&(Roe<0y&ipP#@I!UVJmSxvrcyU6%$U&t7SLuSP|Zi+ zR!PF8;IF9z1~@KHoD24@lk1X9@nA`uKn`&sP+q!5?ao%b4c@==;uf@NU)PRj)xj4)>K< zH%QgbdAV+WhYODI!9CaDi&wuzhW7L%9vf!vvBkH>0utD>{+$OZ!VeDcDZq0XASeMK zl@Zwzh`cOcY0Q-q3(79Hd&|G zx@xTzIZ#qd3dEW`a?obP!1c=Ug>X_rk#0@O`h)z}fb!#$L#NyTbps(7pkXIa*a^_? zMYQ+q!^*4M_;T5SJ-dpTubjiu<83TGzJbZ}eQ;Ny*h<|u-Zvux0G}-8apx=FfwetXrgC4C zfR_FS$q=6bD}pSL7bo&W3tkECMF|hX);{&|dA%>|{~3487WX1{VCOJCc-uE*ObR(fb!|D3&mm9JbxTqJ_z zdZpySQxPJl#B?fvXTYrikOpq*LO|uy`uGH5o~rfnD+l?Uxc6uhlXl5QzC{C$6Wjf@ zlJKD`uE$r8z5z5bjYd(ZC-&-w^pFni*&O7lpYPGERR9Fg;@gK-8)M}Cvqp{Qg%wc+ z$g)4@_&U1`m;&Z!M*xdUf_(`8j>s-^Azdc?7d(3Hwj4;qWtE9NHkv@RxeIz0pJpSYuv;pRY|0+|+s|M4(9})ThDD z^#Qz3eSP%`FV@EuXz3n_ijS3%fL@l>im*byLxhh{T!y<|{SNe(4#|WbqyHK$`GYTC zWRZL!04q{m&)Q4<`YgB?thai7Z4C)%$YiS9P=ypKz#e4Lw?G1gF_>>yEHny~{Stj5 zIOn#J04g^*f+m&NNVkX1QWx=u?nnSY*(^Y@)`-W_WWyF)I`uH%^ROX2z`;O5cFeT> zQ3WV6$bOCp{r);OX-(oA&0-48Vj5;{0w-x5Uz=~>-j_Df=sWB=+sEZAB@Ul0abVS9 z(hPY87Y04xlYy1bs6qr;eL@(T2#~Dj`k?BAl#7HB2{^qTIpIW-$&L%Y-a>ck*gpRy zwD5sL-+{9)`)*ik(JZ{Qx60qogM0#dJ&P|HzqbPVWWtV~sFMf%z{7X`t0{@!A5!`j zYqee#irw8nUPB$%1QMuWf+50Ss<7DGY5+v&^-BT1qis|G{$_1`j=u(vQ{^;ih#V$D z-Ed!}o&@-@V@Dux8&e`8-9DGAi3n;J_UGdY9Z6XYz^ub3KcL-R12uugnMIsGe;!36 zbhbu;XAU)R_Aqdt0UABRo-kN5sB4x2AL(&x+It}k?S1Z5KLDEB?d87A+vkUM3N^$RBKk!b(yIl& z3i^S4b>lxd0RWbt6jg)(D4*U$l(Im8r-Q`cQx^Oq=#mP@14tmt4N3)oJyT6g!=Ud< zlqDs==lpi0M%n=&zyVUQ>5jvo<((oJ>+-Ra38X6^g|cXr95W90MM6mkBtK?ePh<_X z%~i`fO)&mgA&w|*6c>UBrZ58jXkem0Ns|Vr4^QIs;Yobn07chf>FEv*p6+4)=^pm1 zlxP_f+lL6;Bu_d&0IXR)R+AG!3eH@K4XzvE6YG%>xXsYVi7i*akH`8PHSyuA--7d3 zyv{$hXDw_a0^b&1!drecS5MnjLwsW4WnR8f(|9eQfXnxXRG^Ltg7F)DeSd+pLqHnH zfiSAj^MFq=UoE+npx{iyV((-FR62CaG6B5gx7P(wjF0q&rPex-1Bky9Da*CMQ~7}K z8o=@e*+RrW(uuO_VV#cnXW-9|=}1tWZHEwB;xdTxQ0pDyymMpN^^}_|eL`JmH(~J1 z<&!vb`6TWKq0x2Nb*hW~Py65Qb0r#l7Z}7sgf(F0inRr<%h%PBS!JrJFReQ~PeJk6 zmE%cWfLa3(aJnSiv3NDU^6Ga2lQU=*{8A1-ZPzAp-&Ev2jCTzrq7MsW2ng$}miY{H z6};nVyCl(mL=s38zlpg3Rv`gI$#3|24YHOHY(yjEVx(!zWTY^d^%Z$ z>$3(Z3X@oVzOC^)hLqlC1L+X`34>FYPvF$$Eu09~boWV52A7@cV*jb0w?hMgn-W(& z5eQSKdG3^|4yf~u_g!|5_c4@})zU6yLc%dRMEHcA!`;W;iT=Kq_?L79z{h#}*|Yf} zk0i*4WGp`h^$_!b%;IC~4M05`rag9c6;d!nH=Wc9z#1#pA6!?31ZwVgD4UZ&zR%)B z6N}-aE!}>ZfV^}ufF1MB3$krUG76x!7I`Ai?0St=xYv3o~ z7f_~P7d25A@#p%7kboRR1Kz3i;pZi*skith?FI7Ya$?t!LSBIkz?uC`oW87q`(HT) za=_lFJGks*5BpDbaoN+J5b7*F__`wZk=6pDRlN>7}9R^4^_7i=F z4<3F4PQLt~!c5NiXZ2-Vp8;QE`SWSJHv01t15m?vB*T1B$}_e^<|C2-5i5cC^~nUU zL?K>4vJbdi?hXtffePm96u$u`tij%iCR)~@*YDT+`W4^bZL5iWtliwsf0`z))O?hKPfkL$3z$9>zMFGEwfYcy@Aw0dWg_C=l zxbKxya75TA3ZaJsr+V>T@iobbRRk`0Lg_Jn-t9 z(BJ>k@RANImY;!dlX?3wu;;Bm;v>4++A|rb;k+2lM+Cj70EE}d`6WUK5fA`a*^Tsx zz{m?_W!s=zyJZr{eFI?kL<38$0{wo8PPg1L=(l|oK!e$X3D6OLw&a%@@vnd|CmYp? zV_8KA$$nwE67i4qx~%lz(w5uTIW61SHyk~OknCJcY zJXm#^nlhSjPIMfWU;JG-_sZ`@Q50wt#y`1N6fhRqlY2&FzWDbBo&YRF1;B()%L~}G ze2>;YBAx?v;l@zVO$kq!nQ(CwAz zmmb_iae|L?t`hNgj>HY%KDZsJ5iMtp)nxGJRzm+x@~Jh}3gO}-{=mRF{yF$FAg5M8 z9M`F`7ZdSEYW?|U`RB?Zy~@9eEWNmbb)skiOtj7lis7%Ga+i@Fmsb}2$$brc?Fat{ zOj?Vji2_p(J%HB352AedAFy%H-RPZq68&~Nv_&0Jkz6$&J3ik}1M;yJT?VnKr%S>| zW{=>Z>wXxR+l`if5ohw~t{T(NAInwKcl{^Kf(n3@x%p|34|4JI>+anw3yojZ-0&JX zKA%7bQePxX6SO)LNG%EEdS8=(8X2(0VE04=i%pAO-(j;~1$pV55B${(`K1bA8%F_v z*zr?l=g!YXYhLM9140nti6>6u;KAKB)?3x1iGmbRRsD6~hjUrIH7b}_=U#OD*>enxlOz+f}O7c-xqPid`|`u(C#~I z^d0E%)v%Xejfw9zSiH4?=_ejR^NSClyzkRkzvpAl3Mw)&9mz6Bu`K%^u;#eMiv zs++^-ss&hx9?JQ}x&0(0KqTlNNCHtEWyt`u4U7GgO%Mp1Js#KR$UZ6)eCqNX_}lgv zKqAKzKqKjZ3Gi#cFLeM|dEx+e+pF*okKTi)E<8*aq>FBF(~{41Dy_(9P9pGNzhyU}^-DU|K? zNGJ?!eIBx28wcQtKH)>VUWSw3{v$9`GiX{Hqx|~)d~)~8TfdDHfnuji!41lTezDWlfnNjfpS=1_c-<@Ch_~Vg008GMoW)n4dIa}8 z@KJp6@lRrY7h(TpyRd)%BD8xDJ6Q()aMG6=@z-_M62XXwzjKh|`|`>#1;5_k^JulT z9H3A}pl%|Vq>Lt^gwT-vOj4fvDRDiJ%P1Coy+>HHgiH48@A0tNmb;oDGB57xu-=2uSD3qWA#3}}< z$iY1?^Vv3$n79v(8kalyOB>gXfUondUvR_{U==V#sdnIV;5bU=d zMC0{0V*Xzin0ew6%zfzr;KZlV{?wi5o;r!%#+ne*Lmh_?AAKWMuYC*5)QtH0$?%?u z!+bK4N57y$1^0~20k493P~UW5OAZD;&)GNX%7s5Buz`)&%~u;g8>g=ggBFM&PgFnv zctQdyRFJ1e;pP5x0d#ua>X)Iv4JLpL_!{(jIoWr6CIZN7!NvL_1;2Dg1%3fn0{qyK zN2O+?h0FIJ#pU~t;>I_=9e`H}kDq)5pZUUFc;Jy`OwE zRbH9I+%K3|^RLjXMl_y#tN?MGi)?q~kKuub@5PCS?!u|{FW~UuCG6QVhi0=#)Jm=V zhhE1;8PsYSNY0}!;xBop&o=-)Tq?i9FGP#$*Rg`}MOfQtvW3Jqc$xSO#+vvtM91sS zZP4J4>LZ?Gby?kN-yR3_DJX>20?fC(5sg=VCw5H~cxO>yb7K={o>{|Fr_bYSPn|{A zQS!XLRd3^(MTcIBw_X230DzU%v-rYS?!!NR^*(&^!9U01t|qR! zYF}u3j3cD&g(5aeBL19r;wmU&$idG9$)v(v(8O_mg~SkyLU`e*ZWjOnI?2aL<$XI+ zJX-pM2$c1YWg&G7c_Sw{AQA+{ma1zc_f*yAh|nj(X20~Y4*<=@SzNVe0k6L1DB2qx zoIAgP(<>V|y|Rj4Ny#g@lDG1(|E>rj0^Nq|mXd((Mj`YHLU?#LSZ}!)WIYKmQh7f@ zWC{gzo-x435a)nNzywz=>&i?5)&RRF3M@?&DEkiUopOM$?`r+{TK~Rg9jR?X4%7{J!fpz7~rAUA+q{X>ic*C_f;0@Q_fLq>r8~*t3eh+8yS4o?ONBmP@G0+)A z{vuQr1G8?w?4e)wKxEOdlaS#(5TJuW0%S#yvN`~rkE^dYD-##@Nr4?|=eDWZHTaY5 zvSYp;RW(4;`h;u%l30r)pdTde8S=h(b7l%hmuB(u=0WtkU97HkaOOfAE9;x+^aE=s z0`N#H_;ZcmDY`n~$JW=V%V_}rCF#&mW5Q$A;Mscs!YAb9o(e&SV-v-B032kL11QE( z@<6P=)(_2}o#0|P$IS-e%LGSO#q2B{Gx+Mr5 zSQs>m2KMh=z>5y=g6lb~b$VFY=wM}|i~qm9FORb9D(n57TeqsZyQ;gZx;p93Kn9W! zAefFAG$@!xoWS?uywv4W`?;3$6cBhKEbT0wpyCkLdQasc(?WfyU=lz;7h(b=gcp${ zBoN48I^7w1uCDQp=X-ygv-kde-`?jARn?iiyVvcy=j?sH{Y}5$-e;e4&uMk?68PmJ zo|)>~g*~rhxluzggK##gyZr^l;$L1vhP*s|4@g$)dIWYpkN5W$!08CpF3W)3o9ozG zA48{;W2M>dyTadV%CATN975Oni#jBU!9B`;y`>J3XvN1qW| zgl!Q7*)(dWz^_Jk63qShcJ_GJJOO@7UZGE*D>*t{V5QZ8ESEEcu?#cQn{oEsG^CSb zx!uJ=vx9|33(ZbRpvb(Q;SAh6*S{HB8C{@M%^CnH7ZPj8BsZhHpY)d(8r+tX?-a<) z<-uaTXY2SF&YY;DRuil?+vRorYS2e3|B4850<{A@%AB*a0F=a_2d#}L_0)>L12kuW z20kUY`SA~rI;Xp2$mo$?2>tgUg2LIsks^X_-a)I~M7!HcfS$q6318ZmIiDf;%Z{W@ zr}D-hKZ57w>b@ZlJwl5IDqwY>5RnQ%Od#+?5c;p`!?(>v%OJUYdJvAWWDMlU(QN~( ztqzVY6?mGc)v$GZ3}XiSWN=;u?)K=#xXr!L#xxl%4#> z6aZN5bg?yjA3rPxaWJh*+!=v^}EUQcz3&QVl6=8_9?Kd zX}8yLX<4`dEEn<%{dX zPG1M8kci=OU!iBG+eWM1K)c&Qx7$r7u0CJ33C=(a`?9P&jq=mw^5bvyEfb9OftKM1 zQ{Q*s6u{`{t6MJeRh{3bZ}D{lQq|pj5$Mf=U;%!8Lz}-{eFKVmEO^y- zq+a5o0<5pUXYO3BU&(-NyOyxJ`BvQY@1MjIhfe~XX;OvzSSQ9ZOxA1I zJy}P6^Eg(zIhMP{?aj?j7buqefElO!?lwhIUJ(P(Qm)r2 zlEpD}vKfqYY>yTH2>h;1iZq}>AAz6q$mI^=_POL(=?a#cg5yi8$WX&XJ;Ubu7|xm) z$N1(+EO!N~-5iUp9F2CT$RYO&L6LGHu(&c%SebbrxO0XKz@}OaXHM2JSx3)eqtB&wl_%k1nE)?RehVFU7-;K7hINi{pxgyat+`Rdl)? zeeRzaX@uA{MGUFq7*#&)RRWVg9H?oAz@SqgHejh7eSLeDAAGIq!3_fu0HMDylPSLs zx#ACRhqfj3hYJ0j-(2n_NKFw*h((SZD^0<2qYcO^1cFWVIyTkEuxql8iLDb@=?GTx z97~-XjaE0DB+$(Td=pR&8RjNxn5ox`QGd0GPB*N^Cs+D=f!<8xQ|I++nxC5X6WIN> zZ_9+gzT$5M_EGEkNUylAh@gI?7v*H{QeK$#AW*>;ohT4&-8zZs>2Zh%mgRO#o!LaI z-9e+Xigu?}0p2QL2g2)nT%M{6r0Id57dG*)6XE*^J_#U20Fd*UAUZ|?o^=;3-wRbh zBM=%}RsXq>p>)vTX7EO%xFrwv83_Em&Y078Ns0jRCtR$1w(Awbd#|{TS?(*YRzeUQ>VCpPc%a zF;JKL%Jl_L1nh$iD0QDiQg)<9_K;8{=^PkwEAN=^iDAn0Utaj~&8p(IHt zVb)(Z_A!vX9U$N)`tjR&XzSAtVfIOng$y$|&cj@=(rja?A&|ue0AR9S!=`!-vy*k~ z-ZF_sSI`77E`rTjacASHW~+EmM+InmUh;Eo2VL2BVD>o=KggtSP%G*^d2A>FIA<%c zgbWM73%AI^wI^b5TDo(SffN*kOL2rL0bgbxN?EQw6OXYo42KBLeUQFBt>;TLT4K&KqA>j43K>o4?UAm=`)P9k7ZawsR$G=7*a3vAUP8Omh(<&e@BtU`G^+To-ZzM>(6>u^QOEj3R*6^vF48FmCkPOlBtm@;@GC-z z^#=$P9&~iPA{K6=fzI_#A8T`HPq~At_Wi-{^vp@`0CZ7x(M-X`s|2gPwx9fEo)~cV zTjZnf(P*!}^J#$Sd@j%Zi~XP(FZp2uO5OFS!Cw8??V{i6*LFkr=dpc?i)AiocN=K5 zm(c306xZv4IMM9i$~J2w3$0XdvVihWZyf;I2E05Y&VbwyLy87=X~mD*ys&s8jue^raR5 zKnXFpT}2F1+n@E7+wBqPd(n1jq6vOVulTEeh)DR{+WVJt+K^pXyvzOTw!-KiZtT$` zJYuk0Qb^S41wE*CcE1{M%^HA+-sc0i&Qj+NoQItf{-G7(!xaTL_1bPY5cDaVCZ_R= z-}lE5$+6s6z{7{Xg0CL@Jnnz|vyl1{CMJQgx<{2taG&Tp57$o?G>TTr^2tlUM$n6~ zOuNest&1GPliCIAPD4&=OP^|32p4ZRr&&$hwj7OhC z?*ENp0RLhTFk`OcwcR2^oC5fgVQSNMTz39TaoPDV1@Kz5yG+Dll}_>)PVSyh}0;nbl1cafTv|DGN@Sb46~;2yIa2ohEi0%)JFvR%_Qb`p~I_A}OJOA_#&=cOwmopmd9* zAkwWMNS7!L5(<*i9fBeupp-O7rx_$?svMRd^c4o+RM*EpG1Y44Ac?ipSm(Yiax4YJ4d2PJn76zj)! zFZLyE&x;^+1fl1~{fxIwFEMJL1zQnfNbR6mnCfsn)ZJ1LsvO~oeRU~F!`t2XZ0;59 ztJJ7w&KC`#8n}~na|-8#UjC9YSGPN~<5ExN3|FM<9*!jzYvp@YqG)bT=xIy$JfCnq z+clYdNdHsUm1llQ^X26#%B?Rk8SQKFab?l=8nW za@+8d2BU%(wz>5HA&Q+I7r(*Q&v$lUh`%=2>;axa$CDhRbXXS34#c&uZNL;c1`zrZXz9kHVm z{_GV|2_1~?MOvh)n?k6-Ob5-H^XgFLY>+oz!tm)h~hO@o| zMG~94!6$zvD{`kZ*EG^iEjZMMuU%jc^z~h-Um|V9Q*GV6xBmDMnG=pNZdvde}NPN%b8&wK#DJ zTk1pLX5PlB1cN++)=qTH&2{~^n-96d zyBXe(ElNC$(PJz`Z%a8$Xj_onh!H+|aU*y4jKM9p{&!tLUi5z5bZHNcd?=PGs_#z! ztgNima>6^mFt*#?+Eyjh=P>GAXWzN*v&cGg0Vy}{$azoV@GFEEW39Dg;yq)y`)i}T zfdd1dR=b>xh~t1YydRCSwe;hN^AUf3Gk8LPb2WsV~s$1r;u35J*rp zlhord5h$Bn5a}*FZAwUcYqMSaeG1mc?RUyUhV}aICpqrcLXx1H>prH8S@y+51txNp zJcEfoe9U@n^Hp3CYNHm>cf1S0+Q{?{!;_#rWJ>FPBK}f~%)>|rt{B&u9)0nh;17*IcrdLK zEQA8@(K!=`bM~pWYVkZH=sGZ~9$&I;{l4ikz{MXx`2Lf$m;!F?TJ2Ui*5@%=IwBi? z>(`Zz3^|NSD99ppt~_i@Fd)5w)B(pL)r?vc_D4Doc(!ueuBAa zYqmVvCd*;e7=I*bx9`{k!8t-P)K0=^%or4Ej0m0lshyB=6$WqYWYeAt(*MB zWk>ZQ&rEK4JBt;`En>XBjArfN4ED%4sKxjqWzOyK?c>$w$|Ib4ygmVosyUV`4& zI|qH@2XmYaIK5Am2EH_6EqLaS^Km-Oht=1KSGIVhF+u(ST{)Sh(3)=C?uo%mABfI`K*C%s?*fl&=_ zt9ZBCdsK4JJ>oX5b~UWha5Oqn(qVHNKXVAuW{fQyRqy(FI`-bB!X7@Kca9he6`q&d zA2pWyU+=s;eEK227=Lb9mVbXrHp*)3o;Pn2TX;`==#G{09*(HGS0_pAWwzb3Boe zdXj?`eUH;ws!iWJ^Oz=rXeU^wC{QC;#K#tEn08N@Z|kj15l3ch75F;r;A^(ssuu=0M*< zEAP!1v&XoK8!608eC2WlMscGS<0Wj<`@Ah*NOg(ZmeoI|MqOc&jCvAcO)2?pu+47& zUIQ?2Erj*+{MFhNhJ5A1OU!rz99(z)CbVLo5xCqU?xGs-{ z`caYcbvf)f6tBMtAg{ zvBaH@9#gv$`)ZT7?k~|VJP~Z@gk_UNb9B1})_CZK@d0&CxL*4|R$HA%4zZ^;y^`Fv z32n+(0_@i6)l9RzxNKZFywXQnCN0;oCud}`P<36Dl7S-qEv@{*%UzP4FKE`N&BV|S zA4QOoy$|>jjBgrnU&Uh)6VKy9k8a;%at7-MzR%^h6CZyM z3xm!b2S5ZjnWP zRDB1{`+#z>;jlMQO3OD+oO(vTaTc{pmC;wT@#$GK#kkblsqar`d_^_t71+>E3Y_gz2~|y3t~W*e3RR z;P38UE5Oq)XnpXRpSn^1lJntfT7mIty!xFWy9=&7{*Rx2@;qBcxWgJ5lZEnQo8+&G z5>qP4$FxuOyn=cmz>Z~ftL@glAGOjo$%huIk+cSs32>wpq0`Fm%#;R?p(v58okns4|qFVqg2+=r(`xLR5Aru!S$=Ys0)$Y8Yl zDxIIz*U6A?@Eyu}bMr#@LD7Si&HJwBxM_FPhndL}LKG>h z<}%%eK6;cYXxHj9HBjO37H-gEz7T!yTmAI|ZxU}n^3gl;iBAfTcNqOYiyD0RSm1fd z3$Kj89^XDgh}5A4sr(nTV>kHw{lt}>xf;~yGrOA+?a`RYVNTy7t2`5aMpf=Uj{8G_ z=NCz|@axBkFmv!maHW)UF|DuyH69s^yct4b_mL=7-sTwD;YX>Kh08FnAG^B>Ds<5*LFeA>*-#cy zQ;}(tnx_eNwx8+*oMcpPtGrm}B(cVs3fg=>U67>Si>F}rkn5Mw!|_?E(>GmbCBqd) zcP%&FTM~x;?$#;(RMXw<(@SX`H|Nd@C3Q39RAsLU zlva*1l%QS7z4evI^Ul)y2n3Br?6t?0{O9i6Tjr5(%{-w3+w!n9qR$KMq$Z+PxDxFeIRA&_X`>9fNoQHA!LfH(FXWY+; zG+Glf5gWO4--y8U!f|0%;mguFc$zu0piY3Nj(@IZImQs@mq1pcau0{l(P^56BaF&d zr|Dm5VUN=mW{9?=9$4h7AEnfdYqa$$YwRZ!yM0<13BxHQFpk#34rKUoWulxTFZpzN zPidCi}$rGkl$?PinIh(-uY?rtu@57$WJMjv zMc2HAFe9k16H6XSi49O9JUHPteaFBsa^dDNhl6^!*A z$XjSLqOe|v;cdkgJv+1#w?6o0`?TTF%@5>?+dj`Z@)JDWEXZAr)ig7TX|LYbXKR} z%(9LBozaKI8oOJU zretA=_aetesGUW$ZX1-eZp{r3WP$6?E9WrtKI?q-Yk5NR^`Y)$lpbdzqY$-9?mM=w zg%3qJ4g><&Au8%Y4}S6U*FB$IO4uk|zJuJ`LDvw>Tx-rD^CGI{RsPl1;=Rv!URci0 zbJ#pfv1;v$6Xuvj%Dj`Nvc)3zX`Tm_r#wD*L=al0bLvpQK@iZ5Lw6NcC{Op{otz-^7fQ7^PDbz$;`qf7_ub zBx>X>RiN8N{oxR{CX*VG%SY?+Zgj1Y`z?vrUmV`#kHHMG#revvM2dEE$xWL6dq7A; z$Kv=G;(NWCi=WmrDcrc}t)gmZ9F=J7kJjgiuxl699P<}h9@$p;({t|L=5m`^w)jS% zGcT~3iXXmSYbYi}p}i^a&Pz1H^8F@!YAWcfa*Xru{&3>01ig9gk!hMIa zr2WftYKgxZ0_jeXK3mxGw|I2MMI~)J~^Uut|tG9LW>oqWM@WM`4x`Y{+}}=Ti;zeNdIaP4#x|*}5QZo@%{) ze)%U)p`+T}{I`9#H`H(#;^q0dQmDi*ycIt3e!R!@z?%$+<<4(<8Z6}Kzd1d>U9gc- zc6gf3!$FaonVx%GIKnCj?_H@LrI=8%Ur?*Lj-Nwtjq*<Wsq;zg@PRPC%4@MSIp2*S@jUs)LDNM?!OnYF zRCiR^FP)MkWHGxRey7=w#HzGj#I%b48HKt3McY&R_c3ldUngerEsl-)prWBF;QB&Z zXfylbML#;8r)-fK&B@}L2T{%G`pJ3%EvS#JicH2uqTTk}#$wqXOtt&r8B_zR^$+cp z_8+8vX`HmAz7+RTOUv5O@?pUxFwy>%;2qu+{s+_~41 z`1p0`kvKKR+1kY6`>FdxuGjC|3lf|y#WRV+%H0ULpVh!D!#wNWEi2u+W9*n;bTtj{ z(nvZJ@ssr^W-iW+kLNUPFoNoc=x;J=VzPK|;p8g2z8ZLjNjG`UAWws%Xil2z>*3}_ zg5+jqZGHoivJ6L6Bdi5GC;dU~Y+j!F1-hLksqU2@d=)*-M(H6oE0g*(ycPFpc7#3g zXO{=KR7rKOm0`8M)J>MWcIbDgvB&xCIz?_~MUFskC#>%GE{ln*amhQ88D?u~&<4D~ zJtSICc;3m_^n;>A?`BaG(;1xhF>m#s^BJTpCeBnA=S*@iS0gsD3#d#Q?AP@LwjFbK zcdUuV%Dj@(f)fi~3Q)ec&h)tQC3+;y^q$wPP{t3nT=p*$*-vx4o18eK!1sPgqMs>V z@ZGJS^@XNhigjIO!nS2MEw|4{QD3r)WOT2*w2+&ht;-}IF60wC<(0J5WK`A&wMml~ zKZ;1Y*C>}X?R&eWHX9|odfCwybg)^Rf1TMt!*vyvMxKq0ii^zOa23<`i;#Zpi2-_I za%D#*6Jo})Z^!F`L_CbBRxxoeTu8{H|H|`dieDpE^k%y|cMOd%SNba= zj2hP`VPY~8-Owa?{yI(G9_}qQ%V|fA4SCv~)fj!R9R5ZA`_A}Sgt$hS7_R8nwMBR7{?}}8{6qK0BK#5(!^<(6I5@L$_I93we#yhT*648< zqL>tPbWMk?vDmKfB%ji7RGGx7SYQWG8M4eURO&O!oVpb|wHdms)WO9@j8U(X>%N^W zMC4(4h#ww*k4zN6qL|j6n|xk4Dou_dd)u^ z^$efFrvs~narot4Ax}9fr&(@LJ5|q}&w~J+jO6U$sD*6h3}TxK`_%YH)7;WZfsYB? ziN%=VsL;Z@r|9ZtpZVMNB3MIY>TNx6yj5#3yPx_2rxmXMqC8-V$fH)XOf}BJofk&YpKYsFHXFN(ru?k; zXE_?}yy>D5W{-%eS(>$)-7RdwE>zE7P28)V< zP*>n_7sg$S^gm`et9v(>GKn!il3j2nx4J{;`(xz6!z=-E3p<7j>CJa{f~hQtmjcFr zq!^IdsZU?qor}kgAB@BAra$B}CvwxFOSCq6k}@-MeYzJ-VNZ^Uz_(L?4)@mdB@sP4 z4{RO#E+ttTw4lY^0CH;QwcQJv_pJN*y!}YK@qQXiXQ<=dDaq;Q`hHMf=rg*(=n~pr zJDE25I*A+AoL&~5?C3@MzPMCy*s9h-3_n6%ic~L@`8DI^#JU5s-Lau;ZxyG9%2gBv zQsg*6PrJzVZ3BJGG~aJT8HSjooZhRUu3NSw8DycF}a*rrIz_QgmW%bPSmFKFmg z&xd6Pq6fK_qS<=2)?u}7b2s>FDIEmM3}5q))p7!Pp2dO+~Qr zw*J^5|9q^9f#$_pg*40pm*KLksR~c`v{0ghW?rN2ICNphBA>C{adL)4cC_d9xEOb_ z`W&n1FWFpTTH7o2TUmWxaerw*C) z+@$=Rjqb($QqzxM-Tf*Gb;d|uO8k~Sro|1x-OoNQIvz*cKBNnc@$%K{b?z9WdtW#( zmP0qf7F&Hq=ZuCK=9*C^$=m3n5;TKdn=MNi=ffOpmS4%(tZGK#Hk=N6yWe@Sj_z<| z)UG;iexZnpcx`wK|Lk~Id8^*~!mrw_Ls8d#UDOKt+G&(?ufEq$TC{C^ll&A$e?2jQ zQ~ArZ+f1}ET>XmYTJ(2hRtAudac^QP9r1Nvkw`oGPKbB}?54#YMQ_U8T1xY%R>~MR z$GwJUI~0sN`tw(S{nv^(WB2;UF7EC8z0OlN;-+>)w@n?Xu5L)nd2$N4ULF)+##m81;&PG{wFib&>EYxI$3?OWOG*(u7EAI?#1X8PS@IX>uhgu7>VN0#U% zjm!$(N&E9wuYM9%|4g|3!-b4N4(@wy3S^3;(Aa(9Smo_d`Sd1SzKFS%*Vx8}RdYBC zyZ6!~OH$$V@T~|J)PCLOPQcg~4($9r(PaDhH{PkG9x}`e6bA{<31v)nx7#}#^Q)(q zQa7fYueUz1-Q`lI(G?pFF;_gtmow;t+@q@K5@#H#)NIn9Zd=#!22;#2@zTqpg!(I7(e^&0_F_c8 z@7P*CU3>YshEK$l0#iq?7)@r9LGxfsm310@C?Lqwb%}M=vaeq9)z%T=eJ0)>YCm2hT8fkG zY)89V`)kpHEjRo?WPHc7aJl4YRI!KBXww{3<;0(Te!u;_Lv4txmt2CrA+_r(#=-1) zo=G>OhwB?2-#_h5)^n0}&_BM8#%o@jg{#-wyH`7_e>iq$DZ+@ekltU1{W6OCbKvK( z-ir^54(o%1-;FJ7SA4NGazEp=@;ylAL7^=iSmrn;if$X?zB`;86Y=c5hI~Vhpe>1T z&qY)`S_&%CM#D;7(1JL`I=)%|pxgAtJECMBelGWUEex-t!2r9-UDCVlr>18lQn5w0 zctxIeT<>iY)Mca9?Pg33G(>T6J~Ce!2pSx``i#>1r~KEsr0hEwaoE>5HU{f#rUS~y zV!Lrwwp_8p(0_r<}JETVhu9EmwZOis8xhmOMg?1n*OAlg??B(wRIOeH~Krdymn}x5tiFr^<4> zipj=h2i_sAYQJxCR+aMTvr9kLhrC=-UI!!OhFsLUmQh!X+w9kGJq^w(MGg2S*BP0= z)^#Zh&UKemBij{s`X%T5%4p4vTA00>TvDiGed*%B(c${!7N&&FFKaR)Y%d`{xuMy~ zrI-ea%|^OU%T(y&y1L|IZx41iGDy9zuDTow2N8QN?C3eymiJ;s)KpyZM-y|W`gj4I zKfIi(p@KA$nK5j@X@7P1RcmD2_R}kbxTDPKxF414Wxk8N#0$i9voI0bp2MqN(V#pU zk0Cd3V2-#+ty^?AWQkB@hSlu*HPI#|v(@#w2@!|wpQUuY&ZXnlsxRzx=MzrTxwv7GUnA!*216IR(=VG=b~QPd z^fcS;)~i(?Md?- z^$hG%Z7ad?w)EEZ4`DoOQ5;_EdM-cwz51tQ$e~-!){HQGuCHEv$oo!9l*b)YTd6Zt zovzBnW-n>HlxXlGNw3C~1@mzl`VUudk8M}|U0*xt8>T^fz}ViF2Fm7& zX!(yVa$E8SJr z(U(W3mn@_4ON+gF(h~}%bEmo^Tf48x|qn8>jSlK6TqYq2O9E34QGuJG6RZ ztwme3r1_aM{h}GT6M|m9e2t#g`-?p@LQDEtTl<(~NNtQ$NN4FCP63qeoTu9B8C8`I zu~hv?aGC4MZ~*4!l#69_M&%~=tEl(k6%QZc>F<8`DBn+F(Q%%L-z{wKYL-63|6yaR z1OGdf7-r|VFQ(liq;%alm5sgNC7egDt1=x)b0{B&8lsP%`_$}j>MvE)JZo~{fU4jb z`mW^cP;n5->Q`T~a4zn|Lb6~NNh2Al8NQlWLoUH(85|sHL$AO@A*7nfTNN(pRB-bn zyK$jny0Bh`9%lmcLKTMUr|oBqcRp&B5sL=gelkFM1m?U?h=k8zj+@uYt z-QtPu&5s_T0@S>{l-TxjnNjy_T>396;`XD}mmPiPzY||1VZ{gu@_Ki=G6T)q{NzWcqyHxDUf zU1xc89KZ4Cl)ABY#?!V|O!;!+mi9deSH_uh3Rkj`NPm@nmGboa>)dy!lxG41qdTSC zjh4*9=OZ-FU=UAdlqR?f(_4`CWl$&$H}O2VNHgcExVY-TvC59VD-d)akoVPGL6?ge z9);{Zyv-O<`&b75aAy(hm3VIk=EoPBYP*hR8ctP|@ZL&QllK{0E*v+%Ac=pO-mct9 zb-9O8{8=!!4;u~t6O90siEd%vdpBL~nPsZdEIEdb@PpptS?O?r&ILw z&u_SPv5e8~8nd+zT-Oe-CTj%^YwM;(kQp*=wiPuSm^~0`+&d!O&L+`MK35@}iWQY; zepC3ahQ9b}3PCxC8Q}#?j`U#{n&sEYF>a%W9}RzIym^kBqEfLa89>IMvwdi;qnjUA zSEPx2Z?(A1}$$jv(UJ1N}F#365#X|su# ziLrB5?=9Z0C@|l{^H|s16=hBh`Z5;&^scB~Et(B>kw+rO!O?xu8XA)N>(z78!WL@| z>P_fkVUbOV!LK&6)Oamrn{V9+`jAB-Y(}Xj*zA1+b58EkeL-KLZp{>iJe5z6N#@rH zeb;Cw87t%L4urfP442g{A4*j(sX-oS2@G+iKxy=znW{;ar$qdUAie4YdoY|7alL{!m%XmV9-9 zi4>~qz$hx&J9AMoGT^>Q8m3YtW+0<$epkD7Zhn(tzmv;|l?;q93RTA!|%&NHzo%?i^6E7~o>^kaV z3jG&$EI#x+w4hCkS;OXxm&ZIqjcr7G(@}JwlGdNdns!GQTSl|J%sO+=?+O|p_L~RhxR}C2IT7WvY#8F^ z3;KSiY9nYPsB>*U>UF(u`(h(Qgv|MtvRB344%mkU?#dQQ z2FVrFBz9jE|ejg%z7~-u{b--ckc{gNFM+S2( zxw?8pp7Sz)j36>2P`+B`x~Yxj`J!wKpMIkNwSNxg%aS$}+?t|E(4K!% zoq1Asgrqj(aK_eo zgAS`q+*AscUX(hMmh9HGeN7Pey8jL2adjt*a49-2``*LR>)y^EQe{Br2ij6H>@Ft9 zB5eZ;BGWOwciDGWSBKd5K4jE5apseHn{}Yn1d}Fr_*gdKT;X~3uBaC=ix`uy1RXiMtDWEtiSLN9#rOwC3}AER5CO(qatAK5SIlP zwC%)$Ia`rsB=?&!H8hQT=(2Pe@B597fnv_%bDxmb^_t$jRs~|#e$gy9!^xjtR46g zBw}mVF!w{frf+m*|7B)x?Na#wjT`TM+2wo)}L3Wn&+KdK9}{C-n!;X z1_O?p65|T)me{BYN?#9InBYw!`*TH)oVtUnZuG8CuL%lt1H@hP2eKp~5~w6fGY z2?O8D$o4g47$5@;`HP(6#hdA5^?%%tXEFqIPbF~m{e&@-)2w)3L~4)`{U2xK-wcY^ zJx>>_O{E`s>s)e}3hCJMo2MaA8XumBVMCHB8$_y;jUmTX{`Oz~f8ES>mfU&TVH{c`^=DNasgiIA7h|KFpxvI+F1xuB!)C=u0Obrj|D3b!&7NO@D|0ba~H&> z`|m(Op~=ZXt;cUmXDET|U@*P_ z@p`lndzbozGvNqlGVHj2AJe7+Bt8&sks>}g4So{%;4Xx{X2XRM`2Q5c#fJ(U3|2C> zw5DSDH2MOol-k@tV;}&W4r*)Xjf8Cf*Xz|r%Rp7Q6qG-gfcJr-P;`vJix2WWd7vfJ z7QVH_zv3hM4#kOI{_=sBC@whjVS*7Gx*+m9k*_EE zua~PKrW~w+2DU6d+WE|Gw^kV+DZ>Rjd7!tH0$LLhK<55r&E=#4=aGE`Qyta48-ILT zA14PjQ8G{&E{R|ehxY*@Q1?<7zJG0k@zK$LjPE^F@XCk*Ug(}b;eECv-yd$pYEvUV zAV+*~1_I?zgD>I(Hz91W;KUF>ET={W-Z29Hx89;W87{WmiH`Z4aW<+1V3h`PsZ4{7U(VyhtASaXwP>CM3er^`J2arkZi_;>?4?T&ON25UfZ7Ph<$;*ayeIROMejki`Fo{o?O~ zL8veQ_;V2qneK2S^)c|KIDy*RKwu9uM=%(|6@MML?5PP%&T0q-MPRU&feZFGfyYZ1 z!Grh&@x^%~VW8IG1&Z68&{ysZUy2=|J;w~1Q}keMb@gP7biDtqNj`sR5~8b!CS}>5PKhlV0a3WCC{OLup9aY z`=RDr2V9GO0PLY=!1l}#Sp4q6B@YC{V^u)n8IEIu*H8aso8C$q@qyTJ9KdmG_gA?? zZ`ot`Qse;L$h9|r{yZ5UG9CVCQo-Lf>EXXMDc?&RUfZ%ks^w)QPawQ9pg+;msM{2X z56&WSK=cp$Wve1VvOE+-OM*bAEDR>b$4*AwKo@Yu+rhOcOF-fokaz|b-@9yrL#0P_Q-teu`4SGwRV4xudc6WA8#>X6IsC%IaPzce-m(bI4Z#0N-D`-}U>YlXU4IKfaB0NoN`kAx4t6UH2NU`h7k+{HJ;F#`4A2c4o=3_`Z9cY?FMDf zm7p=v2Jy`snCNama)dmRAB2${&5fK>fjl=p1P>QvAUsMz>W#l*IR??wV;}r|{#|;C z;eLA#s5iVs><|7EYk$SuU+dVGA~@Dnw&35IbnFYENbBGJIMG)`o2(ISLiBX}Q!tFS zJcZ!~-xCfkjP}6M(b0c7#=GjFB2483LxGP3)Wm2b91=tFHG;vB6Uo)ANGu~fI?fS@ zo{=0i}F?YNknVkgBid483V+HKt$C_kx;tP=&```NN zdFOXrBbr2SDGieyp)me22u2VLL-jt;{>Ba_dz#^YT_(RYA-Ta8s-tfsF`<0IoyG(c zq;`@=Fo;90D?d{AaUptyU_f%hOC*+$een1B_Z_H)V+@bK6oFCIOW4`oJ{e>4)8Jf@ z1ZsKD5M6bH8;GWIy|hO#Aet0rc9I{&;vIi$6B5_QF>#Wo5j~ymj)ck2p)hugq4~)P zhGR`?f9njjaSsqpb%6SK187Y*fuyT!}hUgI!Qftut!~THbdhi{n0{6aBFs*zEd%u32jP{W}(5ZU`>J`x-Q}7G~ko?A- z{OGqPA-c*LZ3PmE&cJ@GO~*0er3FkbNPa-H^+#_kf*}II5CUUu&)|EL|35UTyYL}& zZsUh>11`9&LiB zL$z=png7GX!~b%89PR<-q7aZrFi5`k0+EErAeV&jDiZMp;)AQl+UkvHE0Px$1``kr zFJPu88oo70LqbFhBn4VQb(|qo#oR?|Ic;c4z6&jBci}^t7JNuOwp|^X5|p7K9;uyT z<)Ai39zLWa`8(AH%0q8M(Gvxv?huD8q`vz*|6``xA$+10f<_wQLB*^8n?|htT!+^F zPVjr53>xK8pj7xAfm|PHC=R*_oZ}@9SL1n1qNgs4v zgV)4pAUVSlN&?mYVSmzm55)iIgy^YH5IXh&o_%iszrlZNl6^-WSbod~la@5lt51YG zrHP=G@D5}jW&(@!YhdQBMaD=^c)3Ki)12LiR&s zki4z)5Bt-WzCz;s7kKfb1EMBBLdaMP1b+XwCb{*#2bZ1_@a!vt+mDCfrp^TL$PdGH z>3-ml=mR#9ZeS7U0HzZREkMiB2-GJSDo^H{guWQTkPo7YAAy49H!c!}A_PMokWl)9 z8V@go>o7yS1yZxwBR#SU59E6CBXtFW<*5jQMf9YXM*8Vhq#w;k#y|SKtknTXTkM0x zxo(J?`3&*XpW($+JG`3u4ADqz2OwD72P(j#I}b$fO@ffdIPfcu0*~Afa2;b1?*&%j zF1Rf48JKw5fPw26LjzE;*1(P1pW*DqQXr-;0x^|OC&$PyAwIbH9*F4*fRO49;F2W( z4V4bqNHRd!Jw|w8#tJF6*C6xpjj?y$0{Mmh!nP#=q8xvZ*}rcWZ;V0d`WO_geut8k z?~u9B2k|o<@N}#ZJcg>k@#}lA`jQVO9XTLwI1M7&2nO|W;8Prd8^;)=z5%;fFK{aK z0=sNCFy3ebkE9X!{B;DXyT{?Ty`>I zL!d6`Hobn7;bpqN+xWlRuHBp-tJ;`=qLpDtL3nhmN5SLG;Pbr}T>8twuD1{@kOz7U zKV^cH`412`Krm=c!mWpsz^^(AH)IFlP2TY#`S0f(W*UidmixnABlG?WiQ{7}eL7MP z9)p$O*jEBp-S5EUb2jLi8)&S~(&o+q#0sn!tCc2Asc@ zg6)?Au;_RL1|MI8_J>$3>bcGG`qY!QPoc$PZ(XaBgzHF6t*sNC_BV-4Lu{-sHE zAgkE}7rB3H)W75VJ&+)AaEdwy@j>eUC;R`x;WJ$0<eyQh54v)}q&*9CTGK$Y zDG?sUuY%r_AAf4>WBWV4Eu8HCwa%%WhKQ{3lVc5?vxu&?03D)9@>+d=;`=;165m&9 z5MGrddV1`GTts7E|F_tGjKjP;m(IHDU7h*o9586h0PSWZ_agm)OY%Ax1^)O`V=LKx z|FeC^e&}R-c3}+?5dIw3-Hjb{e{5E``}HI?E^@a5{k5hOUY+PEV=0i(BR-(X`ERrT zFJB;>x7BG$S-stu04jBHU7oKuz$9oIc6N{&8yT*VLnrIf##xZjnS}0d%P0HaCs$9_ zji2Y?GJpGtCMoF*0E^(?^TcnBCBO79AJFFhx7&Y=1L=>6kpA-IKBsT)CYU1j@9iNq zHZn?TXHM2W(W9XA@CSH=e*bgs_KW`HyprALo($&#ViXbH@G7Qn!H4oYigVP$m} znm;arqt926P#*vRg+9=?LUNw`R|LZs1VaZ>Gact@L{Hi4kyx&Rb4;cGar;AScflfT z@*g#JNWv)CMXZ2j;1Za6FTgFt&fE7V;FjqWDCv!X?49o*t~LM`PE#PRJ_rIg`+!Tb z8{twrF!TK8(eIkC;y-SGWYaIOjF^HC?Thf@^*Fdije%R@GC00i1>3M?utc7RG4Y%S zy+^a4Z8ZZL#*?6^I|eeE!(i?>4T?G=Aa!d11QmPXx>Of};S=JA4~QN$05xm%f874q zwmpbw`~@LZI}lj14Sso>;F-ArE=gzXP$=+Yny14W4f|!8&mrOd?l7 zH)sVkk$OYTbpaF++vSkjN!ok{l&yY%fx{G-J{$ujoqmv1??Gas131Oo{^Rz)9z24Q z?}v~-Z~%E<_aUWy4?=2o!KY{&oO3q84$05vv1?!uvI5%vOQ7Mt0LqW%;ikEv7Sd(nAPqPJlGh51Boh z0u%dTxT)RqAGiNF7bJG=tE6`9jm0(pjsf3-ZE(r_33do?ETUGyAZQu1eUZ6Gc%$qv z2l7@3Z_Ivx1k(G6>Hgbxp<5FteUP9kQiB^zf`#MA|A_s^7+$sR5k=PSh8=5==Nn}1 zQ#QaV4w-vIe{`QLfhNKm)kkxnU^5G{$GkB@c%z5#=I$hj+?fF3zu7LJG6n)lV<2&B zyzcng|C7t(tW8mujGtY0uaLP%a+m>^!}tl#6EGw*xma?p$!<1S_}W{k-Qp-3(zH0k1!bkl{#B}z%?iLP`NF_k1l7o$Xs zlqaHOQsgdOB+50KVR9M2^II!V?b*XYalKzu)(7S(DD+ zyh7Lf>c4!vuR4cmirbo&KDU(So}7Evx&|Yc8|h;muDg!1t^HrMgIBflrpJUP@5eib zRnxyU*S=~B@wrJ&jWZ={uAb4v&vd-u>m`69wI;O=vMXP;cYbriRgU<-s^)mb_7=}W zY$~N))OjyH-+xi_Y~(_38oN%lc_)Plv@?Kgq!TW`ssknKYR*{dMKHoQZdw^8)hhm&y_ME_VT zei5AMZ3(tP__%%Oe+u79cyHsv=1Rt-o1>m&VzzIdjWfA1ctl^aG%Es$!XpnHE_o!u zkO-bCk^G48Mg(^u*tQt!Zse&t$T?8;ZQTsxnmE?tk=ZjHQQGvnq(Zm=8r}NqJ z$ z9pBSm%!_wyiTTgxCF4rbKKXfXh!yV(eU3p3*=wfBS}=YI&OH%h%Q<+-tM;V7Yg4cV zBQgSTxcn3v8t$RsN|~%JxB8)9h=aTq-)!`5z8>UD#P1;^!wYBj&PNWtUe)%?PYo#9 z8%ytJ92qN9&b=XhTW7L*BgifYul5Vcwyn47(sKU3^f!gaY&&L4mi=b(`Ni|aWtH4tOAErWjSB7C;W7GKk! zH{b5hxtJ;M3-O!G%3g_UC6TBWJ}{XG;bWKW^}xC805Uc!x$lG0-JaxymeSw$rblFo zj1{9f25pX^Z_D|I)1M10KZH4C9mIJHpY&|?C0WPi?}pAs59n@MjA<#s7$DfIKwJ8` z^u(1x^rPwJo{T_ENj%OS48fTn0@>Fb6sJ0HPUwGbHluGlk^ZMS{pV%$JQvbCH{=+G zw)8K21>sFCq>ocbHm9NSKJv~KAs{0TMzLPfTQ*Gch1K>TXs?-r0jnMHxu-Kc12)3m zF%7-?r%|U)#E3!G*yPUVF`178QO5Kxjiq;~TyG?qyPPOP6s5SKFljLkedp5B|3>;t z!sA;^PrxlV0ZxTmVSP9rZUsBw_2VuqIJzB%ajWsQix>J%j=`t8ne_5K53-!@OW}xuvM$v1e-$-^;aEsZI<2g2)mi~oL7gt}3ZFObX zR8x%gl?7OLC0}}TGdAZzkFm7yQu@=A6Pl&)6oudL(I>m{VUOKt)nS|TMMq31kp5Mh zE<5n~Cl*kc_o0XQmGG-Tzv_kOHd1(Q(r;7!{`NOk;{biC9kJ@a>+AqDQk>3=dJ$+2!0k-Otf;Jzo z#F&0s2%r9G)uwrx2`S#%wizpRG*tbn>Y_*WRfigD=rNUH4f|e6f60U1mNs5lL5YwWA?RG6seao#g5i#@_S5+RtQhJK>Pp4xh{RxXr$6%|d!cD&4Y?o9btKhoa zPd<1Jk=rWeez(B~rDkkkQ6k47Jgl~24(Ofy$4BwM+rMf&{*`%pD=+7i3V%d+JJ$3@ zoYM>78eT)s;~o~hsKtJ5-5o@3t&+#P4#=SnUx;z^afEg){LOaMOy3uC&|&Lq_pchq zw%#ymTeieFq?A?iZJnfY(Dm> zmQw21lO4;co0iCHA-wXA^bf=wsM`7?b%e4>5wP_}i!MD&aT)fCn=oNtlO0b(pE}{- zv1QZ@%V9_DaIj$+$54!(1CL1`sXgc5kMyhh4mC|hz|OnyU0aU1t1Ibq-G|%SdvKwi zEPRP+)RIl?sWOJ3 zPq6Jcby4Lna8GQ6!L2LA%(>|5gpW7b0 z{wwxU*Ni&c1V7G!$F`r~LQULe)m>ODrv~fRtYHcrO>hwU-S) zt~P9y&N$fh&o;~aAx*|ut|6A)mElvmG_E#o2fwlESTU+KlH7)iyeDOlLF?DP7K|VM zT{R{V*Nfbe4Gz5+OMc1tdJ^_WS|Z-54}y%^Ld5eTw~AVVh@%y%@4Z};H`QZ|qF}t9 z&fJ3r#%v8;>~-XME29nB{s?Sw)54Y02T@a9Ez7>}Y19nbW9Kph$>oO`x5Wzmcf~c8 z8yQ^%V$*OTsRB=cf~9udU6DpmUfVi%wX8OIUfbJ4|RjLb=p{5#|SapChISbhdxk$Eu`#NgQ96>y}&bWEHWXbxF^VF2_tjGZn%&^cCRP77? zarX8Q@-4UFyd@Z4driS-%&idYuW_8W%ykhQc6z!exmai9#<;hu?ku7jbi{hH+XB03_8?ww=GSY%=owU_g<`9U!GWYpNHa9PZOr*at zcKS^s$H&}}1p{$#jRj+%xzq^sIA5B~0r<3~{l&$*;JzagPoF-8Q(_>@Bi!+cn=!s* zp3CIqK*`dIzV_t?kU`x-hBg+J$JdgZ4abGtVDjWXjP(}dRHhI4(uKUvquIxRmiGP6 zXJcu~I(g3be|~`S`m6Y2*;MF}^|ne1!oYCGcK+5#NDD`FL;|d)M`7748|;r@zD$e- z^5aD;$CxU59Ex`?VqEKq-1SZ^?XRgk2KVeun3=p9Cf^6aAaNPA!)9ab+933sIUk>! zN2B}D47oNG?BF|Go9m1_g#LYP5b7`pX^fZl1`C$4na#|OFl78@-O_%1T`9sV@)3Og zAd)IiU{ggQjF+CmP~!@+5Er=KC`31Ma36F{fu%<&+H~9oJ>%mtCi<{*0LBj-h7C?% zP#YPD^c6aSrBsqRRH&|R4q3N?##&_Exr}YsOEJGJ14Cw?z<6iIKZa)!yrmlPd-z^+ zDV920+peh?HK|y}fr1%)=i@kh+1*STW!qa%)#l4}(w*}ru{TaOh#13@@r^SXqLH4( zxOKB0Ha=HSRZ}nbO&6Y&bvwp)29rxAb19fO!D7AK-mCT_uNJ5)E@nrNQGyNQ2g|5a zXl#6drRy)r`f}A>WF5UO_dAl28b9rfWR3)H^g;LZ-)&#jr_+fYdQ*y^N3$t!pEsU(swQw+f z$+|3Dew8tCvE)TMk`;N~c2)mp5pevLD*s}P!$nvuxB)Xq#uB#Y$rYc)EDy4bU*zSd!$vL_l~;;yYQPZ6xZx%nREdDDOUri{G8o39n= zdn@;qKf|umPmoy9gs2}L!FgQ+rgCj2)`enCx**^t*Tpp$V}AOL=jY_D=O)Q#o;F0$ zkM^M#EqrL3sCYuH}Wl zD!f&Cd#d$hDgDTZ*PZuQ{omZ^20i+SRi^Y1=^vKrTVIQy?dvBChmHIjKm5UsIpA%=#;aR} zO;itH-ui2uW5Jryx*02mB(JyY-WX%kiR+vXnYTQIxu)$9IHr~F%R^z#Vvink#?I|z zrJc<@%bfRT4EeGo#=vWpv;Qp4{}ow6tOGF#?k>dAapztQiV(Aw%%+-cb) z)ctf1ZS97l^GrQhZ&aWo*DT(lmiXyfA&&2G!xrYLCAklx*5@R16TYMN9%9_K$WfV4 z)H}>hO2+#y6hX_w0`^J4=*oOQ-xw!UQqTSM*<(DsSBtHSbWuWGdf#dj=DYR6+Nm9i zmX+=)8kg#i#>c;4MxsB)t)7D^(VqC!Z#q_|EWm?P3Y4W;GVj94KO-H2nUe#noRz`T)h zIGQk(TCP9Wa<1nSZkGM%R+5hS1>3Qb{I$uvV=$RP-KUolL&qG)yPfu--Dib(uYEWy zhW0_K#}~}?))Bb^jd^i4!3B@%b{^w=5@?lLJoPx$#^Ud`x%$2p5XBl;MBQ?7&IymGh8lG zmpROL3iXfoQN9c#|d8B(L4=t0R2xWc}0cuRiiCY@!*{hTcJR`p*bR zXh29}1IIvyeaw&4lk)!Q_j9j3e|(V7;2nicn91jtiRVq|&!i3zavK4WH(+31;{U2~ zzkF;})}yHT-`&Sl#`A(J89|<8m}zx`u4#3$h12yBFaIy{)zqHTr_X!&;6Lv3@#IUd NK9A-8OQnhX{{?OVn?wKr literal 0 HcmV?d00001 diff --git a/windows/API-Example-Windows/API-Example-Windows/res/APIExampleWindows.rc2 b/windows/APIExample/APIExample/res/APIExample.rc2 similarity index 79% rename from windows/API-Example-Windows/API-Example-Windows/res/APIExampleWindows.rc2 rename to windows/APIExample/APIExample/res/APIExample.rc2 index 063d70bc8d40fb010c1861d4b26e61ad52d355a7..f8e7af3a1a5705262387323c5fbaaa892efea0ce 100644 GIT binary patch delta 9 QcmdnQwuEhh%0eS%01(9j?EnA( delta 24 fcmZ3&wux +#pragma warning(disable:4819) -//Agora Info #define APP_ID "aab8b8f5a8cd4469a63042fcfafe7063" #define APP_TOKEN "" #include -#include -#include +#include +#include #include #include -#include +#include "Language.h" +#include #pragma comment(lib, "agora_rtc_sdk.lib") using namespace agora; using namespace agora::rtc; +using namespace agora::media; #define WM_MSGID(code) (WM_USER+0x200+code) //Agora Event Handler Message and structure #define EID_JOINCHANNEL_SUCCESS 0x00000001 @@ -58,15 +60,27 @@ using namespace agora::rtc; #define EID_USER_OFFLINE 0x00000004 #define EID_INJECT_STATUS 0x00000005 #define EID_RTMP_STREAM_STATE_CHANGED 0x00000006 +#define EID_REMOTE_VIDEO_STATE_CHANED 0x00000007 +#define RECV_METADATA_MSG 0x00000008 typedef struct _tagRtmpStreamStateChanged { char* url; int state; int error; -}RtmpStreamStreamStateChanged,*PRtmpStreamStreamStateChanged; +}RtmpStreamStreamStateChanged, *PRtmpStreamStreamStateChanged; + +typedef struct _tagVideoStateStateChanged { + uid_t uid; + REMOTE_VIDEO_STATE state; + REMOTE_VIDEO_STATE_REASON reason; +}VideoStateStateChanged, *PVideoStateStateChanged; std::string cs2utf8(CString str); CString utf82cs(std::string utf8); +CString getCurrentTime(); + +#define ID_BASEWND_VIDEO 20000 +#define MAIN_AREA_TOP 20 #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") diff --git a/windows/API-Example-Windows/API-Example-Windows/targetver.h b/windows/APIExample/APIExample/targetver.h similarity index 100% rename from windows/API-Example-Windows/API-Example-Windows/targetver.h rename to windows/APIExample/APIExample/targetver.h diff --git a/windows/APIExample/APIExample/zh-cn.ini b/windows/APIExample/APIExample/zh-cn.ini new file mode 100644 index 000000000..cc3b14efa --- /dev/null +++ b/windows/APIExample/APIExample/zh-cn.ini @@ -0,0 +1,64 @@ +[General] +Common.Group.Doc=ĵϢ +Common.Document.Website=ĵ +Common.FAQ.Website=ʴ +Common.Register.Website=ע˻ +Common.Demo.Website=demoַ +Common.Basic.Scene= +Common.Advanced.Scene=׳ + + +Agora.ClientRole.Broadcaster= +Agora.ClientRole.Audience= + +Basic.LiveBroadcasting=ֱ +Advanced.RtmpStreaming=· +Advanced.RtmpInject=ý +Advanced.Metadata=ƵSEI + +Common.Ctrl.ChannelName=Ƶ +Common.Ctrl.JoinChannel=Ƶ +Common.Ctrl.LeaveChannel=뿪Ƶ +Common.Ctrl.ClientRole=ɫ + +LiveBroadcasting.Ctrl.Persons= + +RtmpInject.Ctrl.Url=ַ +RtmpInject.Ctrl.Inject= +RtmpInject.Ctrl.Remove=Ƴ +Agora.InjectStatus.StartSuccess=ⲿƵɹ +Agora.InjectStatus.Exist=ⲿƵѴ +Agora.InjectStatus.StartUnAuth=ⲿƵδȨ +Agora.InjectStatus.StartTimeout=ⲿƵʱ +Agora.InjectStatus.StartFailed=ⲿƵʧ +Agora.InjectStatus.StopSuccess=ⲿƵֹͣɹ +Agora.InjectStatus.NotFound=δҵҪֹͣⲿƵ +Agora.InjectStatus.StopUnAuth=ҪֹͣⲿƵδȨ +Agora.InjectStatus.StopTimeout=ֹͣⲿƵʱ +Agora.InjectStatus.StopFailed=ֹͣⲿƵʧ +Agora.InjectStatus.Broken=ⲿƵж + +RtmpStreaming.Ctrl.PublishUrl=ַ +RtmpStreaming.Ctrl.Add= +RtmpStreaming.Ctrl.Remove=Ƴ +RtmpStreaming.Ctrl.RemoveAll=Ƴ +Agora.RtmpStateChange.IDLE=ɹɾַ +Agora.RtmpStateChange.Connecting= Agora RTMP +Agora.RtmpStateChange.Running=ڽС +Agora.RtmpStateChange.Running.Success=ɹ +Agora.RtmpStateChange.Recovering=ڻָ CDN 쳣жʱSDK ԶԻָظ״̬ +Agora.RtmpStateChange.InvalidArg=Ч +Agora.RtmpStateChange.Encrypted=Ѽܣ +Agora.RtmpStateChange.ConnTimeout=ʱδɹ +Agora.RtmpStateChange.InrealErr=ִ +Agora.RtmpStateChange.ServerErr=RTMP ִ +Agora.RtmpStateChange.TooOften=Ƶ +Agora.RtmpStateChange.ReachLimit=ַĿﵽ 10ɾһЩõַַ +Agora.RtmpStateChange.NotAuth=Լ +Agora.RtmpStateChange.NotFound=δҵ +Agora.RtmpStateChange.NotSupported=ַʽдַʽǷȷ + +MetaData.Info=֧1024ֽ +MetaData.Ctrl.SendSEI=SEIϢ +MetaData.Ctrl.Send= +MetaData.Ctrl.Clear= \ No newline at end of file diff --git a/windows/APIExample/README.md b/windows/APIExample/README.md new file mode 100644 index 000000000..4421a8e99 --- /dev/null +++ b/windows/APIExample/README.md @@ -0,0 +1,68 @@ +# Open Live Windows + +*其他语言版本: [简体中文](README.zh.md)* + +The Open Live Windows Sample App is an open-source demo that show common scenes. This will help you API examples. + +This demo is written in **C++** + +## Developer Environment Requirements +* VS 2013(or higher), default is vs2017 +* Windows 7(or higher) + +## Running the App +First, create a developer account at [Agora.io](https://dashboard.agora.io/signin/), and obtain an App ID. define the APP_ID with your App ID. + + * #define APP_ID _T("Your App ID") + +Next, download the **Agora Video SDK** from [Agora.io SDK](https://www.agora.io/en/download/). Unzip the downloaded SDK package and copy the **sdk** to the project folder(the old one may be over written).Finally, Open APIExample.sln with your Vs 2013(or higher) and build all solution and run. + + + +##Basic Scene + + +###LiveBroadcasting + + +* change client role +* support 1v1,1v3, 1v8, 1v15 +* join/leave channel +* render local and remote video + +##Advanced Scene + +###RTMP Streaming + +* Add publish stream url after join channel success +* remove publish stream url before leave channel +* show information returned by rtmp streaming callback + +###Inject Stream Url + +* inject stream url after join channel success +* show information returned by inject status callback +* Receive 666 jonied callback after inject stream url succeed.You can mute video and audio of 666. Also,you can render it. +* remove inject stream url before leave channel + +###Video Metadata(Video SEI) + +* You need enable video and joinchannel. +* Send video SEI information. The maximum is 1024 byte. +* Receive SEI information and show it. +* Clear SEI information + + +## Connect Us + +- For potential issues, take a look at our [FAQ](https://docs.agora.io/cn/faq) first +- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials +- Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case +- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community) +- You can find full API documentation at [Document Center](https://docs.agora.io/en/) +- If you encounter problems during integration, you can ask question in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io) +- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Video-Broadcasting/issues) + +## License + +The MIT License (MIT). diff --git a/windows/APIExample/README.zh.md b/windows/APIExample/README.zh.md new file mode 100644 index 000000000..01de269a7 --- /dev/null +++ b/windows/APIExample/README.zh.md @@ -0,0 +1,68 @@ +# Open Live Windows + +*Read this in other languages: [English](README.md)* + +这个开源示例项目演示了如何快速集成Agora视频SDK,展示了常用场景的API示例 + +本开源项目使用 **C++** 语言 + +## 环境主备 +* vs 2013(或更高版本),默认支持vs2017。 +* Windows 7(或更高版本)。 + +**注意** 使用其他版本需要自行修改该配置,编译release还需要安装兼容xp相关插件。 + + +## 运行示例程序 +首先在 [Agora.io 注册](https://dashboard.agora.io/cn/signup/) 注册账号,并创建自己的测试项目,获取到 App ID。将 APP_ID宏定义内容改为刚才申请的 App ID + + +* #define APP_ID _T("Your App ID") + +然后在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**,解压后将其中的 **libs** 复制到本项目目录下(并覆盖原有旧目录)。最后使用 Vs2017 打开 APIExample.sln,编译整个解决方案即可运行 + + +##基础场景 + +###直播互动 + +* 切换角色 +* 支持1v1,1v3, 1v8, 1v15 +* 进出频道 +* 显示本地和远端视频 + +##进阶场景 + +###旁路推流 + +* 加入频道后添加rtmp推流地址 +* 移除推流地址 +* 推流回调处理状态信息显示 + +###插入媒体流 + +* 加入频道后inject 媒体流 +* 显示插入状态回调信息 +* 插入成功,收到一个666加入回调。本地mute 666的视频和音频(也可以不mute) +* 移除插入流 + +###视频MetaData + +* 加入频道,发送视频流 +* 发送视频SEI信息,最大1024B +* 接收视频SEI信息 +* 清楚SEI信息 + +## 联系我们 + +- 如果你遇到了困难,可以先参阅[常见问题](https://docs.agora.io/cn/faq) +- 如果你想了解更多官方示例,可以参考[官方SDK示例](https://github.com/AgoraIO) +- 如果你想了解声网SDK在复杂场景下的应用,可以参考[官方场景案例](https://github.com/AgoraIO-usecase) +- 如果你想了解声网的一些社区开发者维护的项目,可以查看[社区](https://github.com/AgoraIO-Community) +- 完整的 API 文档见 [文档中心](https://docs.agora.io/cn/) +- 若遇到问题需要开发者帮助,你可以到 [开发者社区](https://rtcdeveloper.com/) 提问 +- 如果发现了示例代码的 bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Broadcasting/issues) + +## 代码许可 + +The MIT License (MIT). From 2749843c169342cedf40c0dcd818de289b1648b7 Mon Sep 17 00:00:00 2001 From: sbd021 Date: Fri, 19 Jun 2020 15:19:53 +0800 Subject: [PATCH 027/430] windows CI --- azure-pipelines.yml | 19 +++++++ windows/cicd/script/downloadsdk1.ps1 | 2 + windows/cicd/templates/build-Windows.yml | 67 ++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 windows/cicd/script/downloadsdk1.ps1 create mode 100644 windows/cicd/templates/build-Windows.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e8132498..b77d03a39 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,3 +18,22 @@ jobs: project: 'APIExample' scheme: 'APIExample' +- template: windows/cicd/templates/build-Windows.yml + parameters: + displayName: 'ApiExampleWindows' + workingDirectory: 'windows/API-Example-Windows' + scheme: 'API-Example-Windows' + solutionName: 'APIExampleWindows.sln' + sdkVersion: '3_0_1' + Machine: x86 + release: 'Release' + +- template: windows/cicd/templates/build-Windows.yml + parameters: + displayName: 'ApiExampleWindows64' + workingDirectory: 'windows/API-Example-Windows' + scheme: 'API-Example-Windows' + solutionName: 'APIExampleWindows.sln' + sdkVersion: '3_0_1' + Machine: x64 + release: 'x64/Release' \ No newline at end of file diff --git a/windows/cicd/script/downloadsdk1.ps1 b/windows/cicd/script/downloadsdk1.ps1 new file mode 100644 index 000000000..ccbcd1a35 --- /dev/null +++ b/windows/cicd/script/downloadsdk1.ps1 @@ -0,0 +1,2 @@ +param($SDKURL, $LocalFileName) +Invoke-WebRequest -Uri "$SDKURL" -OutFile "$LocalFileName" -TimeoutSec 10; \ No newline at end of file diff --git a/windows/cicd/templates/build-Windows.yml b/windows/cicd/templates/build-Windows.yml new file mode 100644 index 000000000..4a45f582f --- /dev/null +++ b/windows/cicd/templates/build-Windows.yml @@ -0,0 +1,67 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +parameters: + displayName: '' + workingDirectory: '' + scheme: '' + sdkVersion: '' + faceUnitySDKVersion: '' + Machine: '' + solutionName: '' + release: '' +jobs: + - job: ${{ parameters.displayName }}Build + displayName: ${{ parameters.displayName }} + + pool: + vmImage: 'vs2017-win2016' + + variables: + solution: '${{ parameters.workingDirectory }}/${{ parameters.solutionName }}' + buildPlatform: '${{ parameters.Machine }}' + buildConfiguration: 'Release' + WindowsRTCSDK: 'https://download.agora.io/sdk/release/Agora_Native_SDK_for_Windows_v${{ parameters.sdkVersion }}_FULL.zip' + sdkunzipPath: 'AgoraSDK/Agora_Native_SDK_for_Windows_FULL' + steps: + - script: echo "${{ parameters.sdkurl }}" && ls + #AgoraSDK + - powershell: Windows/cicd/script/downloadsdk1.ps1 "$(WindowsRTCSDK)" "AgoraSDK.zip" + + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: 'AgoraSDK.zip' + destinationFolder: 'AgoraSDK' + + - script: ls + + - task: CopyFiles@2 + inputs: + sourceFolder: $(sdkunzipPath)/libs + targetFolder: ${{ parameters.workingDirectory }}/libs + + - script: cd ${{ parameters.workingDirectory }} && ls + - script: ls + - task: VSBuild@1 + inputs: + solution: '$(solution)' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + vsVersion: '15.0' + msbuildArchitecture: '${{ parameters.Machine }}' + + - task: ArchiveFiles@1 + inputs: + rootFolderOrFile: '${{ parameters.workingDirectory }}/${{ parameters.release }}/' + includeRootFolder: true + archiveType: 'zip' + archiveFile: ${{ parameters.workingDirectory }}/${{ parameters.displayName }}.zip + replaceExistingArchive: true + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: ${{ parameters.workingDirectory }}/${{ parameters.displayName }}.zip + ArtifactName: ${{ parameters.displayName }} + From 8b72e8adadade5a9008257097c267fba01fe7263 Mon Sep 17 00:00:00 2001 From: sbd021 Date: Fri, 19 Jun 2020 15:23:38 +0800 Subject: [PATCH 028/430] windows CI err --- azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b77d03a39..147cbd6cf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,9 +21,9 @@ jobs: - template: windows/cicd/templates/build-Windows.yml parameters: displayName: 'ApiExampleWindows' - workingDirectory: 'windows/API-Example-Windows' - scheme: 'API-Example-Windows' - solutionName: 'APIExampleWindows.sln' + workingDirectory: 'windows/APIExample' + scheme: 'APIExample' + solutionName: 'APIExample.sln' sdkVersion: '3_0_1' Machine: x86 release: 'Release' @@ -31,9 +31,9 @@ jobs: - template: windows/cicd/templates/build-Windows.yml parameters: displayName: 'ApiExampleWindows64' - workingDirectory: 'windows/API-Example-Windows' - scheme: 'API-Example-Windows' - solutionName: 'APIExampleWindows.sln' + workingDirectory: 'windows/APIExample' + scheme: 'APIExample' + solutionName: 'APIExample.sln' sdkVersion: '3_0_1' Machine: x64 release: 'x64/Release' \ No newline at end of file From 8da9443baf941cbdd5e0d652003ec47ed1e4fb75 Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Fri, 19 Jun 2020 18:18:46 +0800 Subject: [PATCH 029/430] Add PushExternalVideo example. --- Android/APIExample/app/build.gradle | 1 + .../app/src/main/AndroidManifest.xml | 1 + .../examples/advanced/PushExternalVideo.java | 280 ++++++++++--- .../src/main/res/values/string_configs.xml | 8 +- Android/APIExample/lib-component/build.gradle | 3 +- .../lib-push-externalvideo/.gitignore | 1 + .../lib-push-externalvideo/build.gradle | 35 ++ .../lib-push-externalvideo/consumer-rules.pro | 0 .../lib-push-externalvideo/proguard-rules.pro | 21 + .../src/main/AndroidManifest.xml | 2 + .../push_externalvideo/Drawable2dFull.java | 51 +++ .../Drawable2dLandmarks.java | 34 ++ .../push_externalvideo/ProgramLandmarks.java | 144 +++++++ .../push_externalvideo/ProgramTexture2d.java | 125 ++++++ .../push_externalvideo/ProgramTextureOES.java | 130 ++++++ .../push_externalvideo/core/Drawable2d.java | 82 ++++ .../push_externalvideo/core/EglCore.java | 385 ++++++++++++++++++ .../core/EglSurfaceBase.java | 198 +++++++++ .../push_externalvideo/core/Extensions.java | 38 ++ .../agora/push_externalvideo/core/GlUtil.java | 282 +++++++++++++ .../core/OffscreenSurface.java | 39 ++ .../push_externalvideo/core/Program.java | 74 ++++ .../core/WindowSurface.java | 95 +++++ Android/APIExample/settings.gradle | 1 + 24 files changed, 1975 insertions(+), 55 deletions(-) create mode 100644 Android/APIExample/lib-push-externalvideo/.gitignore create mode 100644 Android/APIExample/lib-push-externalvideo/build.gradle create mode 100644 Android/APIExample/lib-push-externalvideo/consumer-rules.pro create mode 100644 Android/APIExample/lib-push-externalvideo/proguard-rules.pro create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/AndroidManifest.xml create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dFull.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dLandmarks.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramLandmarks.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTexture2d.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTextureOES.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Drawable2d.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglCore.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglSurfaceBase.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Extensions.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/GlUtil.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/OffscreenSurface.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Program.java create mode 100644 Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/WindowSurface.java diff --git a/Android/APIExample/app/build.gradle b/Android/APIExample/app/build.gradle index b9037ec90..80481c791 100644 --- a/Android/APIExample/app/build.gradle +++ b/Android/APIExample/app/build.gradle @@ -48,4 +48,5 @@ dependencies { implementation 'com.yanzhenjie:permission:2.0.3' implementation project(path: ':lib-stream-encrypt') + implementation project(path: ':lib-push-externalvideo') } diff --git a/Android/APIExample/app/src/main/AndroidManifest.xml b/Android/APIExample/app/src/main/AndroidManifest.xml index aab8ad6d2..a9373d2f1 100644 --- a/Android/APIExample/app/src/main/AndroidManifest.xml +++ b/Android/APIExample/app/src/main/AndroidManifest.xml @@ -17,6 +17,7 @@ android:supportsRtl="true" android:theme="@style/AppTheme"> diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java index 10ebab758..d4b3a1cdd 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java @@ -1,11 +1,18 @@ package io.agora.api.example.examples.advanced; import android.content.Context; +import android.graphics.SurfaceTexture; +import android.hardware.Camera; +import android.opengl.EGLSurface; +import android.opengl.GLES11Ext; +import android.opengl.GLES20; +import android.opengl.Matrix; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; import android.view.SurfaceView; +import android.view.TextureView; import android.view.View; import android.view.ViewGroup; import android.widget.Button; @@ -18,18 +25,26 @@ import com.yanzhenjie.permission.AndPermission; import com.yanzhenjie.permission.runtime.Permission; +import java.io.IOException; + import io.agora.api.example.R; import io.agora.api.example.annotation.Example; import io.agora.api.example.common.BaseFragment; +import io.agora.push_externalvideo.ProgramTextureOES; +import io.agora.push_externalvideo.core.EglCore; +import io.agora.push_externalvideo.core.GlUtil; import io.agora.rtc.Constants; import io.agora.rtc.IRtcEngineEventHandler; import io.agora.rtc.RtcEngine; +import io.agora.rtc.gl.VideoFrame; +import io.agora.rtc.video.AgoraVideoFrame; import io.agora.rtc.video.VideoCanvas; import io.agora.rtc.video.VideoEncoderConfiguration; import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; +import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT; import static io.agora.rtc.video.VideoEncoderConfiguration.STANDARD_BITRATE; import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; @@ -38,16 +53,35 @@ name = "Push ExternalVideo", actionId = R.id.action_mainFragment_to_PushExternalVideo ) -public class PushExternalVideo extends BaseFragment implements View.OnClickListener +public class PushExternalVideo extends BaseFragment implements View.OnClickListener, TextureView.SurfaceTextureListener, + SurfaceTexture.OnFrameAvailableListener { private static final String TAG = PushExternalVideo.class.getSimpleName(); + private final int DEFAULT_CAPTURE_WIDTH = 640; + private final int DEFAULT_CAPTURE_HEIGHT = 480; private FrameLayout fl_local, fl_remote; private Button join; private EditText et_channel; private RtcEngine engine; private int myUid; - private boolean joined = false; + private volatile boolean joined = false; + + private int mPreviewTexture; + private SurfaceTexture mPreviewSurfaceTexture; + private EglCore mEglCore; + private EGLSurface mDummySurface; + private EGLSurface mDrawSurface; + private ProgramTextureOES mProgram; + private float[] mTransform = new float[16]; + private float[] mMVPMatrix = new float[16]; + private boolean mMVPMatrixInit = false; + private Camera mCamera; + private int mFacing = Camera.CameraInfo.CAMERA_FACING_FRONT; + private boolean mPreviewing = false; + private int mSurfaceWidth; + private int mSurfaceHeight; + private boolean mTextureDestroyed; @Nullable @Override @@ -95,17 +129,36 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) } } + + @Override public void onDestroy() { - super.onDestroy(); /**leaveChannel and Destroy the RtcEngine instance*/ if(engine != null) { + /**After joining a channel, the user must call the leaveChannel method to end the + * call before joining another channel. This method returns 0 if the user leaves the + * channel and releases all resources related to the call. This method call is + * asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. + * A successful leaveChannel method call triggers the following callbacks: + * 1:The local client: onLeaveChannel. + * 2:The remote client: onUserOffline, if the user leaving the channel is in the + * Communication channel, or is a BROADCASTER in the Live Broadcast profile. + * @returns 0: Success. + * < 0: Failure. + * PS: + * 1:If you call the destroy method immediately after calling the leaveChannel + * method, the leaveChannel process interrupts, and the SDK does not trigger + * the onLeaveChannel callback. + * 2:If you call the leaveChannel method during CDN live streaming, the SDK + * triggers the removeInjectStreamUrl method.*/ engine.leaveChannel(); } handler.post(RtcEngine::destroy); engine = null; + super.onDestroy(); } @Override @@ -136,32 +189,15 @@ public void onClick(View v) } else { - joined = false; - /**After joining a channel, the user must call the leaveChannel method to end the - * call before joining another channel. This method returns 0 if the user leaves the - * channel and releases all resources related to the call. This method call is - * asynchronous, and the user has not exited the channel when the method call returns. - * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. - * A successful leaveChannel method call triggers the following callbacks: - * 1:The local client: onLeaveChannel. - * 2:The remote client: onUserOffline, if the user leaving the channel is in the - * Communication channel, or is a BROADCASTER in the Live Broadcast profile. - * @returns 0: Success. - * < 0: Failure. - * PS: - * 1:If you call the destroy method immediately after calling the leaveChannel - * method, the leaveChannel process interrupts, and the SDK does not trigger - * the onLeaveChannel callback. - * 2:If you call the leaveChannel method during CDN live streaming, the SDK - * triggers the removeInjectStreamUrl method.*/ - engine.leaveChannel(); - join.setText(getString(R.string.join)); + fl_local.setVisibility(View.GONE); + getActivity().onBackPressed(); } } } private void joinChannel(String channelId) { +// engine.setParameters("{\"rtc.log_filter\":65535}"); // Check if the context is valid Context context = getContext(); if (context == null) @@ -170,13 +206,12 @@ private void joinChannel(String channelId) } // Create render view by RtcEngine - SurfaceView surfaceView = RtcEngine.CreateRendererView(context); - // Local video is on the top - surfaceView.setZOrderMediaOverlay(true); + TextureView textureView = new TextureView(getContext()); + //add SurfaceTextureListener + textureView.setSurfaceTextureListener(this); // Add to the local container - fl_local.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - // Setup local video to render your local camera preview - engine.setupLocalVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, 0)); + fl_local.addView(textureView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); // Set audio route to speaker engine.setDefaultAudioRoutetoSpeakerphone(true); @@ -189,15 +224,27 @@ private void joinChannel(String channelId) engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); /**In the demo, the default is to enter as the anchor.*/ engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_BROADCASTER); - // Enable video module + // Enables the video module. engine.enableVideo(); // Setup video encoding configs engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( - VD_640x360, + new VideoEncoderConfiguration.VideoDimensions(DEFAULT_CAPTURE_WIDTH, DEFAULT_CAPTURE_HEIGHT), FRAME_RATE_FPS_15, STANDARD_BITRATE, - ORIENTATION_MODE_ADAPTIVE + ORIENTATION_MODE_FIXED_PORTRAIT )); + /**Configures the external video source. + * @param enable Sets whether or not to use the external video source: + * true: Use the external video source. + * false: Do not use the external video source. + * @param useTexture Sets whether or not to use texture as an input: + * true: Use texture as an input. + * false: (Default) Do not use texture as an input. + * @param pushMode Sets whether or not the external video source needs to call the PushExternalVideoFrame + * method to send the video frame to the Agora SDK: + * true: Use the push mode. + * false: Use the pull mode (not supported).*/ + engine.setExternalVideoSource(true, true, true); /**Please configure accessToken in the string_config file. * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see @@ -225,6 +272,152 @@ private void joinChannel(String channelId) join.setEnabled(false); } + @Override + public void onFrameAvailable(SurfaceTexture surfaceTexture) + { + if (mTextureDestroyed) return; + + if (!mEglCore.isCurrent(mDrawSurface)) + { + mEglCore.makeCurrent(mDrawSurface); + } + try + { + mPreviewSurfaceTexture.updateTexImage(); + mPreviewSurfaceTexture.getTransformMatrix(mTransform); + } + catch (Exception e) + { + e.printStackTrace(); + } + + /**The rectangle ratio of frames and the screen surface may be different, so cropping may + * happen when display frames to the screen. + * The display transformation matrix does not change for the same camera when the screen + * orientation remains the same.*/ + if(!mMVPMatrixInit) + { + /***/ + /**For simplicity, we only consider the activity as portrait mode. In this case, the captured + * images should be rotated 90 degrees (left or right).Thus the frame width and height + * should be swapped.*/ + float frameRatio = DEFAULT_CAPTURE_HEIGHT / (float) DEFAULT_CAPTURE_WIDTH; + float surfaceRatio = mSurfaceWidth / (float) mSurfaceHeight; + Matrix.setIdentityM(mMVPMatrix, 0); + + if (frameRatio >= surfaceRatio) + { + float w = DEFAULT_CAPTURE_WIDTH * surfaceRatio; + float scaleW = DEFAULT_CAPTURE_HEIGHT / w; + Matrix.scaleM(mMVPMatrix, 0, scaleW, 1, 1); + } + else + { + float h = DEFAULT_CAPTURE_HEIGHT / surfaceRatio; + float scaleH = DEFAULT_CAPTURE_WIDTH / h; + Matrix.scaleM(mMVPMatrix, 0, 1, scaleH, 1); + } + mMVPMatrixInit = true; + } + GLES20.glViewport(0, 0, mSurfaceWidth, mSurfaceHeight); + mProgram.drawFrame(mPreviewTexture, mTransform, mMVPMatrix); + mEglCore.swapBuffers(mDrawSurface); + + if (joined) + { + /**about AgoraVideoFrame, see https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1video_1_1_agora_video_frame.html*/ + AgoraVideoFrame frame = new AgoraVideoFrame(); + frame.textureID = mPreviewTexture; + frame.format = AgoraVideoFrame.FORMAT_TEXTURE_OES; + frame.transform = mTransform; + frame.stride = DEFAULT_CAPTURE_HEIGHT; + frame.height = DEFAULT_CAPTURE_WIDTH; + frame.eglContext14 = mEglCore.getEGLContext(); + frame.timeStamp = System.currentTimeMillis(); + /**Pushes the video frame using the AgoraVideoFrame class and passes the video frame to the Agora SDK. + * Call the setExternalVideoSource method and set pushMode as true before calling this + * method. Otherwise, a failure returns after calling this method. + * @param frame AgoraVideoFrame + * @return + * true: The frame is pushed successfully. + * false: Failed to push the frame. + * PS: + * In the Communication profile, the SDK does not support textured video frames.*/ + boolean a = engine.pushExternalVideoFrame(frame); + Log.e(TAG, "pushExternalVideoFrame:" + a); + } + } + + @Override + public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) + { + Log.i(TAG, "onSurfaceTextureAvailable"); + mTextureDestroyed = false; + mSurfaceWidth = width; + mSurfaceHeight = height; + mEglCore = new EglCore(); + mDummySurface = mEglCore.createOffscreenSurface(1, 1); + mEglCore.makeCurrent(mDummySurface); + mPreviewTexture = GlUtil.createTextureObject(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); + mPreviewSurfaceTexture = new SurfaceTexture(mPreviewTexture); + mPreviewSurfaceTexture.setOnFrameAvailableListener(this); + mDrawSurface = mEglCore.createWindowSurface(surface); + mProgram = new ProgramTextureOES(); + if (mCamera != null || mPreviewing) + { + Log.e(TAG, "Camera preview has been started"); + return; + } + try + { + mCamera = Camera.open(mFacing); + /**It is assumed to capture images of resolution 640x480. During development, it should + * be the most suitable supported resolution that best fits the scenario.*/ + Camera.Parameters parameters = mCamera.getParameters(); + parameters.setPreviewSize(DEFAULT_CAPTURE_WIDTH, DEFAULT_CAPTURE_HEIGHT); + mCamera.setParameters(parameters); + mCamera.setPreviewTexture(mPreviewSurfaceTexture); + /**The display orientation is 90 for both front and back facing cameras using a surface + * texture for the preview when the screen is in portrait mode.*/ + mCamera.setDisplayOrientation(90); + mCamera.startPreview(); + mPreviewing = true; + } + catch (IOException e) + {e.printStackTrace();} + } + + @Override + public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) + { + + } + + @Override + public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) + { + Log.i(TAG, "onSurfaceTextureDestroyed"); + mTextureDestroyed = true; + if (mCamera != null && mPreviewing) + { + mCamera.stopPreview(); + mPreviewing = false; + mCamera.release(); + mCamera = null; + } + mProgram.release(); + mEglCore.releaseSurface(mDummySurface); + mEglCore.releaseSurface(mDrawSurface); + mEglCore.release(); + return true; + } + + @Override + public void onSurfaceTextureUpdated(SurfaceTexture surface) + { + + } + /** * IRtcEngineEventHandler is an abstract class providing default implementation. * The SDK uses this class to report to the app on SDK runtime events. @@ -382,25 +575,18 @@ public void onUserJoined(int uid, int elapsed) handler.post(() -> { /**Display remote video stream*/ - SurfaceView surfaceView = null; - if (fl_remote.getChildCount() == 0) + // Create render view by RtcEngine + SurfaceView surfaceView = RtcEngine.CreateRendererView(context); + if (fl_remote.getChildCount() > 0) { - // Create render view by RtcEngine - surfaceView = RtcEngine.CreateRendererView(context); - // Add to the remote container - fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + fl_remote.removeAllViews(); } - else - { - View view = fl_remote.getChildAt(0); - if (view instanceof SurfaceView) - { - surfaceView = (SurfaceView) view; - } - } - + // Add to the remote container + fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); // Setup remote video to render engine.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); +// engine.muteRemoteVideoStream(uid, false); }); } diff --git a/Android/APIExample/app/src/main/res/values/string_configs.xml b/Android/APIExample/app/src/main/res/values/string_configs.xml index 7e270394c..4939350f7 100644 --- a/Android/APIExample/app/src/main/res/values/string_configs.xml +++ b/Android/APIExample/app/src/main/res/values/string_configs.xml @@ -1,9 +1,5 @@ - - - - - aab8b8f5a8cd4469a63042fcfafe7063 - + <#YOUR APP ID#> + <#YOUR ACCESS TOKEN#> diff --git a/Android/APIExample/lib-component/build.gradle b/Android/APIExample/lib-component/build.gradle index e79e9edb1..313785dee 100644 --- a/Android/APIExample/lib-component/build.gradle +++ b/Android/APIExample/lib-component/build.gradle @@ -20,7 +20,6 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - } dependencies { @@ -31,5 +30,5 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - api 'io.agora.rtc:full-sdk:3.0.1' + api 'io.agora.rtc:full-sdk:3.0.0' } diff --git a/Android/APIExample/lib-push-externalvideo/.gitignore b/Android/APIExample/lib-push-externalvideo/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Android/APIExample/lib-push-externalvideo/build.gradle b/Android/APIExample/lib-push-externalvideo/build.gradle new file mode 100644 index 000000000..0580f8882 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + + api project(path: ':lib-component') +} diff --git a/Android/APIExample/lib-push-externalvideo/consumer-rules.pro b/Android/APIExample/lib-push-externalvideo/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/Android/APIExample/lib-push-externalvideo/proguard-rules.pro b/Android/APIExample/lib-push-externalvideo/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/Android/APIExample/lib-push-externalvideo/src/main/AndroidManifest.xml b/Android/APIExample/lib-push-externalvideo/src/main/AndroidManifest.xml new file mode 100644 index 000000000..c03c01e71 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dFull.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dFull.java new file mode 100644 index 000000000..13daafcf3 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dFull.java @@ -0,0 +1,51 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo; + + +import io.agora.push_externalvideo.core.Drawable2d; + +/** + * Base class for stuff we like to draw. + */ +public class Drawable2dFull extends Drawable2d +{ + + /** + * A "full" square, extending from -1 to +1 in both dimensions. When the model/view/projection + * matrix is identity, this will exactly cover the viewport. + *

+ * The texture coordinates are Y-inverted relative to RECTANGLE. (This seems to work out + * right with external textures from SurfaceTexture.) + */ + private static final float FULL_RECTANGLE_COORDS[] = { + -1.0f, -1.0f, // 0 bottom left + 1.0f, -1.0f, // 1 bottom right + -1.0f, 1.0f, // 2 top left + 1.0f, 1.0f, // 3 top right + }; + private static final float FULL_RECTANGLE_TEX_COORDS[] = { + 0.0f, 0.0f, // 0 bottom left + 1.0f, 0.0f, // 1 bottom right + 0.0f, 1.0f, // 2 top left + 1.0f, 1.0f // 3 top right + }; + + public Drawable2dFull() { + super(FULL_RECTANGLE_COORDS, FULL_RECTANGLE_TEX_COORDS); + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dLandmarks.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dLandmarks.java new file mode 100644 index 000000000..41d58d766 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/Drawable2dLandmarks.java @@ -0,0 +1,34 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo; + + +import io.agora.push_externalvideo.core.Drawable2d; + +/** + * Base class for stuff we like to draw. + */ +public class Drawable2dLandmarks extends Drawable2d +{ + + + private float pointsCoords[] = new float[150]; + + public Drawable2dLandmarks() { + updateVertexArray(pointsCoords); + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramLandmarks.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramLandmarks.java new file mode 100644 index 000000000..359d0766f --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramLandmarks.java @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.agora.push_externalvideo; + +import android.hardware.Camera; +import android.opengl.GLES20; +import android.opengl.Matrix; + +import java.util.Arrays; + +import io.agora.push_externalvideo.core.Drawable2d; +import io.agora.push_externalvideo.core.GlUtil; +import io.agora.push_externalvideo.core.Program; + + +public class ProgramLandmarks extends Program +{ + + private static final String vertexShaderCode = + // This matrix member variable provides a hook to manipulate + // the coordinates of the objects that use this vertex shader + "uniform mat4 uMVPMatrix;" + + "attribute vec4 vPosition;" + + "uniform float uPointSize;" + + "void main() {" + + // the matrix must be included as a modifier of gl_Position + // Note that the uMVPMatrix factor *must be first* in order + // for the matrix multiplication product to be correct. + " gl_Position = uMVPMatrix * vPosition;" + + " gl_PointSize = uPointSize;" + + "}"; + + private static final String fragmentShaderCode = + "precision mediump float;" + + "uniform vec4 vColor;" + + "void main() {" + + " gl_FragColor = vColor;" + + "}"; + + private static final float color[] = {0.63671875f, 0.76953125f, 0.22265625f, 1.0f}; + + private int mPositionHandle; + private int mColorHandle; + private int mMVPMatrixHandle; + private int mPointSizeHandle; + + private float mPointSize = 6.0f; + + public ProgramLandmarks() { + super(vertexShaderCode, fragmentShaderCode); + } + + @Override + protected Drawable2d getDrawable2d() { + return new Drawable2dLandmarks(); + } + + @Override + protected void getLocations() { + // get handle to vertex shader's vPosition member + mPositionHandle = GLES20.glGetAttribLocation(mProgramHandle, "vPosition"); + GlUtil.checkGlError("vPosition"); + // get handle to fragment shader's vColor member + mColorHandle = GLES20.glGetUniformLocation(mProgramHandle, "vColor"); + GlUtil.checkGlError("vColor"); + // get handle to shape's transformation matrix + mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgramHandle, "uMVPMatrix"); + GlUtil.checkGlError("glGetUniformLocation"); + mPointSizeHandle = GLES20.glGetUniformLocation(mProgramHandle, "uPointSize"); + GlUtil.checkGlError("uPointSize"); + } + + @Override + public void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix) { + // Add program to OpenGL environment + GLES20.glUseProgram(mProgramHandle); + + // Enable a handle to the triangle vertices + GLES20.glEnableVertexAttribArray(mPositionHandle); + + // Prepare the triangle coordinate data + GLES20.glVertexAttribPointer( + mPositionHandle, Drawable2d.COORDS_PER_VERTEX, + GLES20.GL_FLOAT, false, + Drawable2d.VERTEXTURE_STRIDE, mDrawable2d.vertexArray()); + + // Set color for drawing the triangle + GLES20.glUniform4fv(mColorHandle, 1, color, 0); + + // Apply the projection and view transformation + GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, mvpMtx, 0); + + GLES20.glUniform1f(mPointSizeHandle, mPointSize); + + // Draw the triangle + GLES20.glDrawArrays(GLES20.GL_POINTS, 0, mDrawable2d.vertexCount()); + + // Disable vertex array + GLES20.glDisableVertexAttribArray(mPositionHandle); + } + + public void drawFrame(int x, int y, int width, int height) { + drawFrame(0, null, null, x, y, width, height); + } + + private final float[] mvpMtx = new float[16]; + private int mCameraType; + private int mOrientation; + private int mWidth; + private int mHeight; + + public void refresh(float[] landmarksData, int width, int height, int orientation, int cameraType) { + if (mWidth != width || mHeight != height || mOrientation != orientation || mCameraType != cameraType) { + float[] orthoMtx = new float[16]; + float[] rotateMtx = new float[16]; + Matrix.orthoM(orthoMtx, 0, 0, width, 0, height, -1, 1); + Matrix.setRotateM(rotateMtx, 0, 360 - orientation, 0.0f, 0.0f, 1.0f); + if (cameraType == Camera.CameraInfo.CAMERA_FACING_BACK) { + Matrix.rotateM(rotateMtx, 0, 180, 1.0f, 0.0f, 0.0f); + } + Matrix.multiplyMM(mvpMtx, 0, rotateMtx, 0, orthoMtx, 0); + + mWidth = width; + mHeight = height; + mOrientation = orientation; + mCameraType = cameraType; + } + + updateVertexArray(Arrays.copyOf(landmarksData, landmarksData.length)); + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTexture2d.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTexture2d.java new file mode 100644 index 000000000..aa64caa7a --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTexture2d.java @@ -0,0 +1,125 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo; + +import android.opengl.GLES20; + +import io.agora.push_externalvideo.core.Drawable2d; +import io.agora.push_externalvideo.core.GlUtil; +import io.agora.push_externalvideo.core.Program; + + +public class ProgramTexture2d extends Program +{ + + // Simple vertex shader, used for all programs. + private static final String VERTEX_SHADER = + "uniform mat4 uMVPMatrix;\n" + + "uniform mat4 uTexMatrix;\n" + + "attribute vec4 aPosition;\n" + + "attribute vec4 aTextureCoord;\n" + + "varying vec2 vTextureCoord;\n" + + "void main() {\n" + + " gl_Position = uMVPMatrix * aPosition;\n" + + " vTextureCoord = (uTexMatrix * aTextureCoord).xy;\n" + + "}\n"; + + // Simple fragment shader for use with "normal" 2D textures. + private static final String FRAGMENT_SHADER_2D = + "precision mediump float;\n" + + "varying vec2 vTextureCoord;\n" + + "uniform sampler2D sTexture;\n" + + "void main() {\n" + + " gl_FragColor = vec4(texture2D(sTexture, vTextureCoord).rgb, 1.0);\n" + + "}\n"; + + private int muMVPMatrixLoc; + private int muTexMatrixLoc; + private int maPositionLoc; + private int maTextureCoordLoc; + + public ProgramTexture2d() { + super(VERTEX_SHADER, FRAGMENT_SHADER_2D); + } + + @Override + protected Drawable2d getDrawable2d() { + return new Drawable2dFull(); + } + + @Override + protected void getLocations() { + maPositionLoc = GLES20.glGetAttribLocation(mProgramHandle, "aPosition"); + GlUtil.checkLocation(maPositionLoc, "aPosition"); + maTextureCoordLoc = GLES20.glGetAttribLocation(mProgramHandle, "aTextureCoord"); + GlUtil.checkLocation(maTextureCoordLoc, "aTextureCoord"); + muMVPMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uMVPMatrix"); + GlUtil.checkLocation(muMVPMatrixLoc, "uMVPMatrix"); + muTexMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uTexMatrix"); + GlUtil.checkLocation(muTexMatrixLoc, "uTexMatrix"); + } + + @Override + public void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix) { + GlUtil.checkGlError("draw start"); + + // Select the program. + GLES20.glUseProgram(mProgramHandle); + GlUtil.checkGlError("glUseProgram"); + + // Set the texture. + GLES20.glActiveTexture(GLES20.GL_TEXTURE0); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId); + + // Copy the model / view / projection matrix over. + GLES20.glUniformMatrix4fv(muMVPMatrixLoc, 1, false, mvpMatrix, 0); + GlUtil.checkGlError("glUniformMatrix4fv"); + + // Copy the texture transformation matrix over. + GLES20.glUniformMatrix4fv(muTexMatrixLoc, 1, false, texMatrix, 0); + GlUtil.checkGlError("glUniformMatrix4fv"); + + // Enable the "aPosition" vertex attribute. + GLES20.glEnableVertexAttribArray(maPositionLoc); + GlUtil.checkGlError("glEnableVertexAttribArray"); + + // Connect vertexBuffer to "aPosition". + GLES20.glVertexAttribPointer(maPositionLoc, Drawable2d.COORDS_PER_VERTEX, + GLES20.GL_FLOAT, false, Drawable2d.VERTEXTURE_STRIDE, mDrawable2d.vertexArray()); + GlUtil.checkGlError("glVertexAttribPointer"); + + // Enable the "aTextureCoord" vertex attribute. + GLES20.glEnableVertexAttribArray(maTextureCoordLoc); + GlUtil.checkGlError("glEnableVertexAttribArray"); + + // Connect texBuffer to "aTextureCoord". + GLES20.glVertexAttribPointer(maTextureCoordLoc, 2, + GLES20.GL_FLOAT, false, Drawable2d.TEXTURE_COORD_STRIDE, mDrawable2d.texCoordArray()); + GlUtil.checkGlError("glVertexAttribPointer"); + + // Draw the rect. + GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, mDrawable2d.vertexCount()); + GlUtil.checkGlError("glDrawArrays"); + + // Done -- disable vertex array, texture, and program. + GLES20.glDisableVertexAttribArray(maPositionLoc); + GLES20.glDisableVertexAttribArray(maTextureCoordLoc); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); + GLES20.glUseProgram(0); + } + +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTextureOES.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTextureOES.java new file mode 100644 index 000000000..cfb437ef9 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/ProgramTextureOES.java @@ -0,0 +1,130 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo; + +import android.opengl.GLES11Ext; +import android.opengl.GLES20; + +import io.agora.push_externalvideo.core.Drawable2d; +import io.agora.push_externalvideo.core.GlUtil; +import io.agora.push_externalvideo.core.Program; + +public class ProgramTextureOES extends Program +{ + + // Simple vertex shader, used for all programs. + private static final String VERTEX_SHADER = + "uniform mat4 uMVPMatrix;\n" + + "uniform mat4 uTexMatrix;\n" + + "attribute vec4 aPosition;\n" + + "attribute vec4 aTextureCoord;\n" + + "varying vec2 vTextureCoord;\n" + + "void main() {\n" + + " gl_Position = uMVPMatrix * aPosition;\n" + + " vTextureCoord = (uTexMatrix * aTextureCoord).xy;\n" + + "}\n"; + + // Simple fragment shader for use with external 2D textures (e.g. what we get from + // SurfaceTexture). + private static final String FRAGMENT_SHADER_EXT = + "#extension GL_OES_EGL_image_external : require\n" + + "precision mediump float;\n" + + "varying vec2 vTextureCoord;\n" + + "uniform samplerExternalOES sTexture;\n" + + "void main() {\n" + + " gl_FragColor = texture2D(sTexture, vTextureCoord);\n" + + "}\n"; + + private int muMVPMatrixLoc; + private int muTexMatrixLoc; + private int maPositionLoc; + private int maTextureCoordLoc; + + /** + * Prepares the program in the current EGL context. + */ + public ProgramTextureOES() { + super(VERTEX_SHADER, FRAGMENT_SHADER_EXT); + } + + @Override + protected Drawable2d getDrawable2d() { + return new Drawable2dFull(); + } + + @Override + protected void getLocations() { + maPositionLoc = GLES20.glGetAttribLocation(mProgramHandle, "aPosition"); + GlUtil.checkLocation(maPositionLoc, "aPosition"); + maTextureCoordLoc = GLES20.glGetAttribLocation(mProgramHandle, "aTextureCoord"); + GlUtil.checkLocation(maTextureCoordLoc, "aTextureCoord"); + muMVPMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uMVPMatrix"); + GlUtil.checkLocation(muMVPMatrixLoc, "uMVPMatrix"); + muTexMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uTexMatrix"); + GlUtil.checkLocation(muTexMatrixLoc, "uTexMatrix"); + } + + @Override + public void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix) { + GlUtil.checkGlError("draw start"); + + // Select the program. + GLES20.glUseProgram(mProgramHandle); + GlUtil.checkGlError("glUseProgram"); + + // Set the texture. + GLES20.glActiveTexture(GLES20.GL_TEXTURE0); + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureId); + + // Copy the model / view / projection matrix over. + GLES20.glUniformMatrix4fv(muMVPMatrixLoc, 1, false, mvpMatrix, 0); + GlUtil.checkGlError("glUniformMatrix4fv"); + + // Copy the texture transformation matrix over. + GLES20.glUniformMatrix4fv(muTexMatrixLoc, 1, false, texMatrix, 0); + GlUtil.checkGlError("glUniformMatrix4fv"); + + // Enable the "aPosition" vertex attribute. + GLES20.glEnableVertexAttribArray(maPositionLoc); + GlUtil.checkGlError("glEnableVertexAttribArray"); + + // Connect vertexBuffer to "aPosition". + GLES20.glVertexAttribPointer(maPositionLoc, Drawable2d.COORDS_PER_VERTEX, + GLES20.GL_FLOAT, false, Drawable2d.VERTEXTURE_STRIDE, mDrawable2d.vertexArray()); + GlUtil.checkGlError("glVertexAttribPointer"); + + // Enable the "aTextureCoord" vertex attribute. + GLES20.glEnableVertexAttribArray(maTextureCoordLoc); + GlUtil.checkGlError("glEnableVertexAttribArray"); + + // Connect texBuffer to "aTextureCoord". + GLES20.glVertexAttribPointer(maTextureCoordLoc, 2, + GLES20.GL_FLOAT, false, Drawable2d.TEXTURE_COORD_STRIDE, mDrawable2d.texCoordArray()); + GlUtil.checkGlError("glVertexAttribPointer"); + + // Draw the rect. + GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, mDrawable2d.vertexCount()); + GlUtil.checkGlError("glDrawArrays"); + + // Done -- disable vertex array, texture, and program. + GLES20.glDisableVertexAttribArray(maPositionLoc); + GLES20.glDisableVertexAttribArray(maTextureCoordLoc); + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, 0); + GLES20.glUseProgram(0); + } + +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Drawable2d.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Drawable2d.java new file mode 100644 index 000000000..4323fed7d --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Drawable2d.java @@ -0,0 +1,82 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo.core; + +import java.nio.FloatBuffer; + +/** + * Base class for stuff we like to draw. + */ +public class Drawable2d { + + public static final int SIZEOF_FLOAT = 4; + public static final int COORDS_PER_VERTEX = 2; + public static final int TEXTURE_COORD_STRIDE = 2 * SIZEOF_FLOAT; + public static final int VERTEXTURE_STRIDE = COORDS_PER_VERTEX * SIZEOF_FLOAT; + + private FloatBuffer mTexCoordArray; + private FloatBuffer mVertexArray; + private int mVertexCount; + + public Drawable2d() { + } + + /** + * Prepares a drawable from a "pre-fabricated" shape definition. + *

+ * Does no EGL/GL operations, so this can be done at any time. + */ + public Drawable2d(float[] FULL_RECTANGLE_COORDS, float[] FULL_RECTANGLE_TEX_COORDS) { + updateVertexArray(FULL_RECTANGLE_COORDS); + updateTexCoordArray(FULL_RECTANGLE_TEX_COORDS); + } + + public void updateVertexArray(float[] FULL_RECTANGLE_COORDS) { + mVertexArray = GlUtil.createFloatBuffer(FULL_RECTANGLE_COORDS); + mVertexCount = FULL_RECTANGLE_COORDS.length / COORDS_PER_VERTEX; + } + + public void updateTexCoordArray(float[] FULL_RECTANGLE_TEX_COORDS) { + mTexCoordArray = GlUtil.createFloatBuffer(FULL_RECTANGLE_TEX_COORDS); + } + + /** + * Returns the array of vertices. + *

+ * To avoid allocations, this returns internal state. The caller must not modify it. + */ + public FloatBuffer vertexArray() { + return mVertexArray; + } + + /** + * Returns the array of texture coordinates. + *

+ * To avoid allocations, this returns internal state. The caller must not modify it. + */ + public FloatBuffer texCoordArray() { + return mTexCoordArray; + } + + /** + * Returns the number of vertices stored in the vertex array. + */ + public int vertexCount() { + return mVertexCount; + } + +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglCore.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglCore.java new file mode 100644 index 000000000..89b00a918 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglCore.java @@ -0,0 +1,385 @@ +/* + * Copyright 2013 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo.core; + +import android.graphics.SurfaceTexture; +import android.opengl.EGL14; +import android.opengl.EGLConfig; +import android.opengl.EGLContext; +import android.opengl.EGLDisplay; +import android.opengl.EGLExt; +import android.opengl.EGLSurface; +import android.util.Log; +import android.view.Surface; + +/** + * Core EGL state (display, context, config). + *

+ * The EGLContext must only be attached to one thread at a time. This class is not thread-safe. + */ +public final class EglCore { + private static final String TAG = GlUtil.TAG; + + /** + * Constructor flag: surface must be recordable. This discourages EGL from using a + * pixel format that cannot be converted efficiently to something usable by the video + * encoder. + */ + public static final int FLAG_RECORDABLE = 0x01; + + /** + * Constructor flag: ask for GLES3, fall back to GLES2 if not available. Without this + * flag, GLES2 is used. + */ + public static final int FLAG_TRY_GLES3 = 0x02; + + // Android-specific extension. + private static final int EGL_RECORDABLE_ANDROID = 0x3142; + + private EGLDisplay mEGLDisplay = EGL14.EGL_NO_DISPLAY; + private EGLContext mEGLContext = EGL14.EGL_NO_CONTEXT; + private EGLConfig mEGLConfig = null; + private int mGlVersion = -1; + + + /** + * Prepares EGL display and context. + *

+ * Equivalent to EglCore(null, 0). + */ + public EglCore() { + this(null, 0); + } + + /** + * Prepares EGL display and context. + *

+ * + * @param sharedContext The context to share, or null if sharing is not desired. + * @param flags Configuration bit flags, e.g. FLAG_RECORDABLE. + */ + public EglCore(EGLContext sharedContext, int flags) { + if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) { + throw new RuntimeException("EGL already set up"); + } + + if (sharedContext == null) { + sharedContext = EGL14.EGL_NO_CONTEXT; + } + + mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY); + if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { + throw new RuntimeException("unable to get EGL14 display"); + } + int[] version = new int[2]; + if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) { + mEGLDisplay = null; + throw new RuntimeException("unable to initialize EGL14"); + } + + // Try to get a GLES3 context, if requested. + if ((flags & FLAG_TRY_GLES3) != 0) { + //Log.d(TAG, "Trying GLES 3"); + EGLConfig config = getConfig(flags, 3); + if (config != null) { + int[] attrib3_list = { + EGL14.EGL_CONTEXT_CLIENT_VERSION, 3, + EGL14.EGL_NONE + }; + EGLContext context = EGL14.eglCreateContext(mEGLDisplay, config, sharedContext, + attrib3_list, 0); + + if (EGL14.eglGetError() == EGL14.EGL_SUCCESS) { + //Log.d(TAG, "Got GLES 3 config"); + mEGLConfig = config; + mEGLContext = context; + mGlVersion = 3; + } + } + } + if (mEGLContext == EGL14.EGL_NO_CONTEXT) { // GLES 2 only, or GLES 3 attempt failed + //Log.d(TAG, "Trying GLES 2"); + EGLConfig config = getConfig(flags, 2); + if (config == null) { + throw new RuntimeException("Unable to find a suitable EGLConfig"); + } + int[] attrib2_list = { + EGL14.EGL_CONTEXT_CLIENT_VERSION, 2, + EGL14.EGL_NONE + }; + EGLContext context = EGL14.eglCreateContext(mEGLDisplay, config, sharedContext, + attrib2_list, 0); + checkEglError("eglCreateContext"); + mEGLConfig = config; + mEGLContext = context; + mGlVersion = 2; + } + + // Confirm with query. + int[] values = new int[1]; + EGL14.eglQueryContext(mEGLDisplay, mEGLContext, EGL14.EGL_CONTEXT_CLIENT_VERSION, + values, 0); + Log.d(TAG, "EGLContext created, client version " + values[0]); + } + + /** + * Finds a suitable EGLConfig. + * + * @param flags Bit flags from constructor. + * @param version Must be 2 or 3. + */ + private EGLConfig getConfig(int flags, int version) { + int renderableType = EGL14.EGL_OPENGL_ES2_BIT; + if (version >= 3) { + renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR; + } + + // The actual surface is generally RGBA or RGBX, so situationally omitting alpha + // doesn't really help. It can also lead to a huge performance hit on glReadPixels() + // when reading into a GL_RGBA buffer. + int[] attribList = { + EGL14.EGL_RED_SIZE, 8, + EGL14.EGL_GREEN_SIZE, 8, + EGL14.EGL_BLUE_SIZE, 8, + EGL14.EGL_ALPHA_SIZE, 8, + //EGL14.EGL_DEPTH_SIZE, 16, + //EGL14.EGL_STENCIL_SIZE, 8, + EGL14.EGL_RENDERABLE_TYPE, renderableType, + EGL14.EGL_NONE, 0, // placeholder for recordable [@-3] + EGL14.EGL_NONE + }; + if ((flags & FLAG_RECORDABLE) != 0) { + attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID; + attribList[attribList.length - 2] = 1; + } + EGLConfig[] configs = new EGLConfig[1]; + int[] numConfigs = new int[1]; + if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length, + numConfigs, 0)) { + Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig"); + return null; + } + return configs[0]; + } + + /** + * Discards all resources held by this class, notably the EGL context. This must be + * called from the thread where the context was created. + *

+ * On completion, no context will be current. + */ + public void release() { + if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) { + // Android is unusual in that it uses a reference-counted EGLDisplay. So for + // every eglInitialize() we need an eglTerminate(). + EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, + EGL14.EGL_NO_CONTEXT); + EGL14.eglDestroyContext(mEGLDisplay, mEGLContext); + EGL14.eglReleaseThread(); + EGL14.eglTerminate(mEGLDisplay); + } + + mEGLDisplay = EGL14.EGL_NO_DISPLAY; + mEGLContext = EGL14.EGL_NO_CONTEXT; + mEGLConfig = null; + } + + @Override + protected void finalize() throws Throwable { + try { + if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) { + // We're limited here -- finalizers don't run on the thread that holds + // the EGL state, so if a surface or context is still current on another + // thread we can't fully release it here. Exceptions thrown from here + // are quietly discarded. Complain in the log file. + Log.w(TAG, "WARNING: EglCore was not explicitly released -- state may be leaked"); + release(); + } + } finally { + super.finalize(); + } + } + + public EGLContext getEGLContext() { + return mEGLContext; + } + + /** + * Destroys the specified surface. Note the EGLSurface won't actually be destroyed if it's + * still current in a context. + */ + public void releaseSurface(EGLSurface eglSurface) { + EGL14.eglDestroySurface(mEGLDisplay, eglSurface); + } + + /** + * Creates an EGL surface associated with a Surface. + *

+ * If this is destined for MediaCodec, the EGLConfig should have the "recordable" attribute. + */ + public EGLSurface createWindowSurface(Object surface) { + if (!(surface instanceof Surface) && !(surface instanceof SurfaceTexture)) { + throw new RuntimeException("invalid surface: " + surface); + } + + // Create a window surface, and attach it to the Surface we received. + int[] surfaceAttribs = { + EGL14.EGL_NONE + }; + EGLSurface eglSurface = EGL14.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, surface, + surfaceAttribs, 0); + checkEglError("eglCreateWindowSurface"); + if (eglSurface == null) { + throw new RuntimeException("surface was null"); + } + return eglSurface; + } + + /** + * Creates an EGL surface associated with an offscreen buffer. + */ + public EGLSurface createOffscreenSurface(int width, int height) { + int[] surfaceAttribs = { + EGL14.EGL_WIDTH, width, + EGL14.EGL_HEIGHT, height, + EGL14.EGL_NONE + }; + EGLSurface eglSurface = EGL14.eglCreatePbufferSurface(mEGLDisplay, mEGLConfig, + surfaceAttribs, 0); + checkEglError("eglCreatePbufferSurface"); + if (eglSurface == null) { + throw new RuntimeException("surface was null"); + } + return eglSurface; + } + + /** + * Makes our EGL context current, using the supplied surface for both "draw" and "read". + */ + public void makeCurrent(EGLSurface eglSurface) { + if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { + // called makeCurrent() before create? + Log.d(TAG, "NOTE: makeCurrent w/o display"); + } + if (!EGL14.eglMakeCurrent(mEGLDisplay, eglSurface, eglSurface, mEGLContext)) { + throw new RuntimeException("eglMakeCurrent failed"); + } + } + + /** + * Makes our EGL context current, using the supplied "draw" and "read" surfaces. + */ + public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) { + if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { + // called makeCurrent() before create? + Log.d(TAG, "NOTE: makeCurrent w/o display"); + } + if (!EGL14.eglMakeCurrent(mEGLDisplay, drawSurface, readSurface, mEGLContext)) { + throw new RuntimeException("eglMakeCurrent(draw,read) failed"); + } + } + + /** + * Makes no context current. + */ + public void makeNothingCurrent() { + if (!EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, + EGL14.EGL_NO_CONTEXT)) { + throw new RuntimeException("eglMakeCurrent failed"); + } + } + + /** + * Calls eglSwapBuffers. Use this to "publish" the current frame. + * + * @return false on failure + */ + public boolean swapBuffers(EGLSurface eglSurface) { + return EGL14.eglSwapBuffers(mEGLDisplay, eglSurface); + } + + /** + * Sends the presentation time stamp to EGL. Time is expressed in nanoseconds. + */ + public void setPresentationTime(EGLSurface eglSurface, long nsecs) { + EGLExt.eglPresentationTimeANDROID(mEGLDisplay, eglSurface, nsecs); + } + + /** + * Returns true if our context and the specified surface are current. + */ + public boolean isCurrent(EGLSurface eglSurface) { + return mEGLContext.equals(EGL14.eglGetCurrentContext()) && + eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); + } + + public EGLSurface getCurrentDrawingSurface() { + EGLSurface surface = null; + if (mEGLContext.equals(EGL14.eglGetCurrentContext())) { + surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); + } + return surface; + } + + /** + * Performs a simple surface query. + */ + public int querySurface(EGLSurface eglSurface, int what) { + int[] value = new int[1]; + EGL14.eglQuerySurface(mEGLDisplay, eglSurface, what, value, 0); + return value[0]; + } + + /** + * Queries a string value. + */ + public String queryString(int what) { + return EGL14.eglQueryString(mEGLDisplay, what); + } + + /** + * Returns the GLES version this context is configured for (currently 2 or 3). + */ + public int getGlVersion() { + return mGlVersion; + } + + /** + * Writes the current display, context, and surface to the log. + */ + public static void logCurrent(String msg) { + EGLDisplay display; + EGLContext context; + EGLSurface surface; + + display = EGL14.eglGetCurrentDisplay(); + context = EGL14.eglGetCurrentContext(); + surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); + Log.i(TAG, "Current EGL (" + msg + "): display=" + display + ", context=" + context + + ", surface=" + surface); + } + + /** + * Checks for EGL errors. Throws an exception if an error has been raised. + */ + private void checkEglError(String msg) { + int error; + if ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) { + throw new RuntimeException(msg + ": EGL error: 0x" + Integer.toHexString(error)); + } + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglSurfaceBase.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglSurfaceBase.java new file mode 100644 index 000000000..85d136eb7 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/EglSurfaceBase.java @@ -0,0 +1,198 @@ +/* + * Copyright 2013 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo.core; + +import android.graphics.Bitmap; +import android.opengl.EGL14; +import android.opengl.EGLSurface; +import android.opengl.GLES20; +import android.util.Log; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Common base class for EGL surfaces. + *

+ * There can be multiple surfaces associated with a single context. + */ +public class EglSurfaceBase { + protected static final String TAG = GlUtil.TAG; + + // EglCore object we're associated with. It may be associated with multiple surfaces. + protected EglCore mEglCore; + + private EGLSurface mEGLSurface = EGL14.EGL_NO_SURFACE; + private int mWidth = -1; + private int mHeight = -1; + + protected EglSurfaceBase(EglCore eglCore) { + mEglCore = eglCore; + } + + /** + * Creates a window surface. + *

+ * + * @param surface May be a Surface or SurfaceTexture. + */ + public void createWindowSurface(Object surface) { + if (mEGLSurface != EGL14.EGL_NO_SURFACE) { + throw new IllegalStateException("surface already created"); + } + mEGLSurface = mEglCore.createWindowSurface(surface); + + // Don't cache width/height here, because the size of the underlying surface can change + // out from under us (see e.g. HardwareScalerActivity). + //mWidth = mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH); + //mHeight = mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT); + } + + /** + * Creates an off-screen surface. + */ + public void createOffscreenSurface(int width, int height) { + if (mEGLSurface != EGL14.EGL_NO_SURFACE) { + throw new IllegalStateException("surface already created"); + } + mEGLSurface = mEglCore.createOffscreenSurface(width, height); + mWidth = width; + mHeight = height; + } + + /** + * Returns the surface's width, in pixels. + *

+ * If this is called on a window surface, and the underlying surface is in the process + * of changing size, we may not see the new size right away (e.g. in the "surfaceChanged" + * callback). The size should match after the next buffer swap. + */ + public int getWidth() { + if (mWidth < 0) { + return mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH); + } else { + return mWidth; + } + } + + /** + * Returns the surface's height, in pixels. + */ + public int getHeight() { + if (mHeight < 0) { + return mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT); + } else { + return mHeight; + } + } + + /** + * Release the EGL surface. + */ + public void releaseEglSurface() { + mEglCore.releaseSurface(mEGLSurface); + mEGLSurface = EGL14.EGL_NO_SURFACE; + mWidth = mHeight = -1; + } + + /** + * Makes our EGL context and surface current. + */ + public void makeCurrent() { + mEglCore.makeCurrent(mEGLSurface); + } + + /** + * Makes our EGL context and surface current for drawing, using the supplied surface + * for reading. + */ + public void makeCurrentReadFrom(EglSurfaceBase readSurface) { + mEglCore.makeCurrent(mEGLSurface, readSurface.mEGLSurface); + } + + /** + * Calls eglSwapBuffers. Use this to "publish" the current frame. + * + * @return false on failure + */ + public boolean swapBuffers() { + boolean result = mEglCore.swapBuffers(mEGLSurface); + if (!result) { + Log.d(TAG, "WARNING: swapBuffers() failed"); + } + return result; + } + + /** + * Sends the presentation time stamp to EGL. + * + * @param nsecs Timestamp, in nanoseconds. + */ + public void setPresentationTime(long nsecs) { + mEglCore.setPresentationTime(mEGLSurface, nsecs); + } + + /** + * Saves the EGL surface to a file. + *

+ * Expects that this object's EGL surface is current. + */ + public void saveFrame(File file) throws IOException { + if (!mEglCore.isCurrent(mEGLSurface)) { + throw new RuntimeException("Expected EGL context/surface is not current"); + } + + // glReadPixels fills in a "direct" ByteBuffer with what is essentially big-endian RGBA + // data (i.e. a byte of red, followed by a byte of green...). While the Bitmap + // constructor that takes an int[] wants little-endian ARGB (blue/red swapped), the + // Bitmap "copy pixels" method wants the same format GL provides. + // + // Ideally we'd have some way to re-use the ByteBuffer, especially if we're calling + // here often. + // + // Making this even more interesting is the upside-down nature of GL, which means + // our output will look upside down relative to what appears on screen if the + // typical GL conventions are used. + + String filename = file.toString(); + + int width = getWidth(); + int height = getHeight(); + ByteBuffer buf = ByteBuffer.allocateDirect(width * height * 4); + buf.order(ByteOrder.LITTLE_ENDIAN); + GLES20.glReadPixels(0, 0, width, height, + GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf); + GlUtil.checkGlError("glReadPixels"); + buf.rewind(); + + BufferedOutputStream bos = null; + try { + bos = new BufferedOutputStream(new FileOutputStream(filename)); + Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + bmp.copyPixelsFromBuffer(buf); + bmp.compress(Bitmap.CompressFormat.PNG, 90, bos); + bmp.recycle(); + } finally { + if (bos != null) bos.close(); + } + Log.d(TAG, "Saved " + width + "x" + height + " frame as '" + filename + "'"); + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Extensions.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Extensions.java new file mode 100644 index 000000000..6b8094627 --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Extensions.java @@ -0,0 +1,38 @@ +package io.agora.push_externalvideo.core; + +import android.content.Context; +import android.content.res.AssetManager; + +import java.io.IOException; +import java.io.InputStream; + +public abstract class Extensions { + + public static byte[] getBytes(InputStream inputStream) { + try { + byte[] bytes = new byte[inputStream.available()]; + inputStream.read(bytes); + inputStream.close(); + return bytes; + } catch (IOException e) { + e.printStackTrace(); + } + + return new byte[0]; + } + + public static byte[] getBytes(AssetManager assetManager, String fileName) { + try { + return getBytes(assetManager.open(fileName)); + } catch (IOException e) { + e.printStackTrace(); + } + + return new byte[0]; + } + + public static String readTextFileFromResource(Context context, int resourceId) { + return new String(Extensions.getBytes(context.getResources().openRawResource(resourceId))); + } + +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/GlUtil.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/GlUtil.java new file mode 100644 index 000000000..df4891ccf --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/GlUtil.java @@ -0,0 +1,282 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo.core; + +import android.graphics.Bitmap; +import android.opengl.GLES11Ext; +import android.opengl.GLES20; +import android.opengl.GLES30; +import android.opengl.GLUtils; +import android.opengl.Matrix; +import android.util.Log; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +/** + * Some OpenGL utility functions. + */ +public abstract class GlUtil { + //public static final String TAG = "Grafika"; + public static final String TAG = "mqi"; + /** + * Identity matrix for general use. Don't modify or life will get weird. + */ + public static final float[] IDENTITY_MATRIX; + + static { + IDENTITY_MATRIX = new float[16]; + Matrix.setIdentityM(IDENTITY_MATRIX, 0); + } + + private static final int SIZEOF_FLOAT = 4; + + + private GlUtil() { + } // do not instantiate + + /** + * Creates a new program from the supplied vertex and fragment shaders. + * + * @return A handle to the program, or 0 on failure. + */ + public static int createProgram(String vertexSource, String fragmentSource) { + int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource); + if (vertexShader == 0) { + return 0; + } + int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource); + if (pixelShader == 0) { + return 0; + } + + int program = GLES20.glCreateProgram(); + checkGlError("glCreateProgram"); + if (program == 0) { + Log.e(TAG, "Could not create program"); + } + GLES20.glAttachShader(program, vertexShader); + checkGlError("glAttachShader"); + GLES20.glAttachShader(program, pixelShader); + checkGlError("glAttachShader"); + GLES20.glLinkProgram(program); + int[] linkStatus = new int[1]; + GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0); + if (linkStatus[0] != GLES20.GL_TRUE) { + Log.e(TAG, "Could not link program: "); + Log.e(TAG, GLES20.glGetProgramInfoLog(program)); + GLES20.glDeleteProgram(program); + program = 0; + } + return program; + } + + /** + * Compiles the provided shader source. + * + * @return A handle to the shader, or 0 on failure. + */ + public static int loadShader(int shaderType, String source) { + int shader = GLES20.glCreateShader(shaderType); + checkGlError("glCreateShader type=" + shaderType); + GLES20.glShaderSource(shader, source); + GLES20.glCompileShader(shader); + int[] compiled = new int[1]; + GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0); + if (compiled[0] == 0) { + Log.e(TAG, "Could not compile shader " + shaderType + ":"); + Log.e(TAG, " " + GLES20.glGetShaderInfoLog(shader)); + GLES20.glDeleteShader(shader); + shader = 0; + } + return shader; + } + + /** + * Checks to see if a GLES error has been raised. + */ + public static void checkGlError(String op) { + int error = GLES20.glGetError(); + if (error != GLES20.GL_NO_ERROR) { + String msg = op + ": glError 0x" + Integer.toHexString(error); + Log.e(TAG, msg); + } + } + + /** + * Checks to see if the location we obtained is valid. GLES returns -1 if a label + * could not be found, but does not set the GL error. + *

+ * Throws a RuntimeException if the location is invalid. + */ + public static void checkLocation(int location, String label) { + if (location < 0) { + Log.e(TAG, "Unable to locate '" + label + "' in program"); + } + } + + /** + * Creates a texture from raw data. + * + * @param data Image data, in a "direct" ByteBuffer. + * @param width Texture width, in pixels (not bytes). + * @param height Texture height, in pixels. + * @param format Image data format (use constant appropriate for glTexImage2D(), e.g. GL_RGBA). + * @return Handle to texture. + */ + public static int createImageTexture(ByteBuffer data, int width, int height, int format) { + int[] textureHandles = new int[1]; + int textureHandle; + + GLES20.glGenTextures(1, textureHandles, 0); + textureHandle = textureHandles[0]; + GlUtil.checkGlError("glGenTextures"); + + // Bind the texture handle to the 2D texture target. + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle); + + // Configure min/mag filtering, i.e. what scaling method do we use if what we're rendering + // is smaller or larger than the source image. + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, + GLES20.GL_LINEAR); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, + GLES20.GL_LINEAR); + GlUtil.checkGlError("loadImageTexture"); + + // Load the data from the buffer into the texture handle. + GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, /*level*/ 0, format, + width, height, /*border*/ 0, format, GLES20.GL_UNSIGNED_BYTE, data); + GlUtil.checkGlError("loadImageTexture"); + + return textureHandle; + } + + /** + * Creates a texture from bitmap. + * + * @param bmp bitmap data + * @return Handle to texture. + */ + public static int createImageTexture(Bitmap bmp) { + int[] textureHandles = new int[1]; + int textureHandle; + + GLES20.glGenTextures(1, textureHandles, 0); + textureHandle = textureHandles[0]; + GlUtil.checkGlError("glGenTextures"); + + // Bind the texture handle to the 2D texture target. + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle); + + // Configure min/mag filtering, i.e. what scaling method do we use if what we're rendering + // is smaller or larger than the source image. + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, + GLES20.GL_LINEAR); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, + GLES20.GL_LINEAR); + GlUtil.checkGlError("loadImageTexture"); + + // Load the data from the buffer into the texture handle. + GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, /*level*/ 0, bmp, 0); + GlUtil.checkGlError("loadImageTexture"); + + return textureHandle; + } + + /** + * Allocates a direct float buffer, and populates it with the float array data. + */ + public static FloatBuffer createFloatBuffer(float[] coords) { + // Allocate a direct ByteBuffer, using 4 bytes per float, and copy coords into it. + ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * SIZEOF_FLOAT); + bb.order(ByteOrder.nativeOrder()); + FloatBuffer fb = bb.asFloatBuffer(); + fb.put(coords); + fb.position(0); + return fb; + } + + /** + * Writes GL version info to the log. + */ + public static void logVersionInfo() { + Log.i(TAG, "vendor : " + GLES20.glGetString(GLES20.GL_VENDOR)); + Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER)); + Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION)); + + if (false) { + int[] values = new int[1]; + GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0); + int majorVersion = values[0]; + GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0); + int minorVersion = values[0]; + if (GLES30.glGetError() == GLES30.GL_NO_ERROR) { + Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion); + } + } + } + + + /** + * Creates a texture object suitable for use with this program. + *

+ * On exit, the texture will be bound. + */ + public static int createTextureObject(int textureTarget) { + int[] textures = new int[1]; + GLES20.glGenTextures(1, textures, 0); + GlUtil.checkGlError("glGenTextures"); + + int texId = textures[0]; + GLES20.glBindTexture(textureTarget, texId); + GlUtil.checkGlError("glBindTexture " + texId); + + GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, + GLES20.GL_NEAREST); + GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, + GLES20.GL_LINEAR); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, + GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, + GLES20.GL_CLAMP_TO_EDGE); + GlUtil.checkGlError("glTexParameter"); + + return texId; + } + + public static void deleteTextureObject(int textureId) { + int[] textures = new int[1]; + textures[0] = textureId; + GLES20.glDeleteTextures(1, textures, 0); + GlUtil.checkGlError("glDeleteTextures"); + } + + public static float[] changeMVPMatrix(float[] mvpMatrix, float viewWidth, float viewHeight, float textureWidth, float textureHeight) { + float scale = viewWidth * textureHeight / viewHeight / textureWidth; + if (scale == 1) { + return mvpMatrix; + } else { + float[] mvp = new float[16]; + float[] tmp = new float[16]; + Matrix.setIdentityM(tmp, 0); + Matrix.scaleM(tmp, 0, scale > 1 ? 1F : (1F / scale), scale > 1 ? scale : 1F, 1F); + Matrix.multiplyMM(mvp, 0, tmp, 0, mvpMatrix, 0); + return mvp; + } + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/OffscreenSurface.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/OffscreenSurface.java new file mode 100644 index 000000000..abf0cacca --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/OffscreenSurface.java @@ -0,0 +1,39 @@ +/* + * Copyright 2013 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo.core; + +/** + * Off-screen EGL surface (pbuffer). + *

+ * It's good practice to explicitly release() the surface, preferably from a "finally" block. + */ +public class OffscreenSurface extends EglSurfaceBase { + /** + * Creates an off-screen surface with the specified width and height. + */ + public OffscreenSurface(EglCore eglCore, int width, int height) { + super(eglCore); + createOffscreenSurface(width, height); + } + + /** + * Releases any resources associated with the surface. + */ + public void release() { + releaseEglSurface(); + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Program.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Program.java new file mode 100644 index 000000000..1554fb21f --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/Program.java @@ -0,0 +1,74 @@ +package io.agora.push_externalvideo.core; + +import android.content.Context; +import android.opengl.GLES20; + +/** + * Created by tujh on 2018/1/24. + */ + +public abstract class Program { + private static final String TAG = GlUtil.TAG; + + // Handles to the GL program and various components of it. + protected int mProgramHandle; + + + protected Drawable2d mDrawable2d; + + /** + * Prepares the program in the current EGL context. + */ + public Program(String VERTEX_SHADER, String FRAGMENT_SHADER_2D) { + mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_2D); + mDrawable2d = getDrawable2d(); + getLocations(); + } + + public Program(Context context, int vertexShaderResourceId, int fragmentShaderResourceId) { + this(Extensions.readTextFileFromResource(context, vertexShaderResourceId), Extensions.readTextFileFromResource(context, fragmentShaderResourceId)); + } + + public void updateVertexArray(float[] FULL_RECTANGLE_COORDS) { + mDrawable2d.updateVertexArray(FULL_RECTANGLE_COORDS); + } + + public void updateTexCoordArray(float[] FULL_RECTANGLE_TEX_COORDS) { + mDrawable2d.updateTexCoordArray(FULL_RECTANGLE_TEX_COORDS); + } + + protected abstract Drawable2d getDrawable2d(); + + /** + * get locations of attributes and uniforms + */ + protected abstract void getLocations(); + + /** + * Issues the draw call. Does the full setup on every call. + */ + public abstract void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix); + + public void drawFrame(int textureId, float[] texMatrix) { + drawFrame(textureId, texMatrix, GlUtil.IDENTITY_MATRIX); + } + + public void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix, int x, int y, int width, int height) { + int[] originalViewport = new int[4]; + GLES20.glGetIntegerv(GLES20.GL_VIEWPORT, originalViewport, 0); + GLES20.glViewport(x, y, width, height); + drawFrame(textureId, texMatrix, mvpMatrix); + GLES20.glViewport(originalViewport[0], originalViewport[1], originalViewport[2], originalViewport[3]); + } + + /** + * Releases the program. + *

+ * The appropriate EGL context must be current (i.e. the one that was used to create + * the program). + */ + public void release() { + GLES20.glDeleteProgram(mProgramHandle); + mProgramHandle = -1; + } +} diff --git a/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/WindowSurface.java b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/WindowSurface.java new file mode 100644 index 000000000..2d03c171b --- /dev/null +++ b/Android/APIExample/lib-push-externalvideo/src/main/java/io/agora/push_externalvideo/core/WindowSurface.java @@ -0,0 +1,95 @@ +/* + * Copyright 2013 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.agora.push_externalvideo.core; + +import android.graphics.SurfaceTexture; +import android.view.Surface; + +/** + * Recordable EGL window surface. + *

+ * It's good practice to explicitly release() the surface, preferably from a "finally" block. + */ +public class WindowSurface extends EglSurfaceBase { + private Surface mSurface; + private boolean mReleaseSurface; + + /** + * Associates an EGL surface with the native window surface. + *

+ * Set releaseSurface to true if you want the Surface to be released when release() is + * called. This is convenient, but can interfere with framework classes that expect to + * manage the Surface themselves (e.g. if you release a SurfaceView's Surface, the + * surfaceDestroyed() callback won't fire). + */ + public WindowSurface(EglCore eglCore, Surface surface, boolean releaseSurface) { + super(eglCore); + createWindowSurface(surface); + mSurface = surface; + mReleaseSurface = releaseSurface; + } + + /** + * Associates an EGL surface with the SurfaceTexture. + */ + public WindowSurface(EglCore eglCore, SurfaceTexture surfaceTexture) { + super(eglCore); + createWindowSurface(surfaceTexture); + } + + public WindowSurface(EglCore eglCore, int width, int height) { + super(eglCore); + createOffscreenSurface(width, height); + } + + /** + * Releases any resources associated with the EGL surface (and, if configured to do so, + * with the Surface as well). + *

+ * Does not require that the surface's EGL context be current. + */ + public void release() { + releaseEglSurface(); + if (mSurface != null) { + if (mReleaseSurface) { + mSurface.release(); + } + mSurface = null; + } + } + + /** + * Recreate the EGLSurface, using the new EglBase. The caller should have already + * freed the old EGLSurface with releaseEglSurface(). + *

+ * This is useful when we want to update the EGLSurface associated with a Surface. + * For example, if we want to share with a different EGLContext, which can only + * be done by tearing down and recreating the context. (That's handled by the caller; + * this just creates a new EGLSurface for the Surface we were handed earlier.) + *

\ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/manifest.json b/Web/webSdkDemo-NG/basic_video_call/build/manifest.json deleted file mode 100644 index 080d6c77a..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/Web/webSdkDemo-NG/basic_video_call/build/precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js b/Web/webSdkDemo-NG/basic_video_call/build/precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js deleted file mode 100644 index 58890e641..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js +++ /dev/null @@ -1,30 +0,0 @@ -self.__precacheManifest = (self.__precacheManifest || []).concat([ - { - "revision": "63f451350ad14299fe127345f2897092", - "url": "/index.html" - }, - { - "revision": "b441cc42cc6715e3b5be", - "url": "/static/css/2.63b65d4e.chunk.css" - }, - { - "revision": "68e24559e4c5b912ff90", - "url": "/static/css/main.2d51ff4f.chunk.css" - }, - { - "revision": "b441cc42cc6715e3b5be", - "url": "/static/js/2.a0af91be.chunk.js" - }, - { - "revision": "5ac48c47bb3912b14c2d8de4f56d5ae8", - "url": "/static/js/2.a0af91be.chunk.js.LICENSE.txt" - }, - { - "revision": "68e24559e4c5b912ff90", - "url": "/static/js/main.cf5c2376.chunk.js" - }, - { - "revision": "ce1e471e59ce395f2673", - "url": "/static/js/runtime-main.1f69e042.js" - } -]); \ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/robots.txt b/Web/webSdkDemo-NG/basic_video_call/build/robots.txt deleted file mode 100644 index e9e57dc4d..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/Web/webSdkDemo-NG/basic_video_call/build/service-worker.js b/Web/webSdkDemo-NG/basic_video_call/build/service-worker.js deleted file mode 100644 index 50b1fa373..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/service-worker.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Welcome to your Workbox-powered service worker! - * - * You'll need to register this file in your web app and you should - * disable HTTP caching for this file too. - * See https://goo.gl/nhQhGp - * - * The rest of the code is auto-generated. Please don't update this file - * directly; instead, make changes to your Workbox build configuration - * and re-run your build process. - * See https://goo.gl/2aRDsh - */ - -importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); - -importScripts( - "/precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js" -); - -self.addEventListener('message', (event) => { - if (event.data && event.data.type === 'SKIP_WAITING') { - self.skipWaiting(); - } -}); - -workbox.core.clientsClaim(); - -/** - * The workboxSW.precacheAndRoute() method efficiently caches and responds to - * requests for URLs in the manifest. - * See https://goo.gl/S9QRab - */ -self.__precacheManifest = [].concat(self.__precacheManifest || []); -workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); - -workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), { - - blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], -}); diff --git a/Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css b/Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css deleted file mode 100644 index 9b4dcaf19..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * - * antd v4.2.5 - * - * Copyright 2015-present, Alipay, Inc. - * All rights reserved. - * - */body,html{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;color:rgba(0,0,0,.65);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#fff;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}[tabindex="-1"]:focus{outline:none!important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-top:0;margin-bottom:1em}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#1890ff;text-decoration:none;background-color:transparent;outline:none;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;-webkit-text-decoration-skip:objects}a:hover{color:#40a9ff}a:active{color:#096dd9}a:active,a:focus,a:hover{text-decoration:none;outline:0}a[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-size:1em;font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;color:rgba(0,0,0,.45);text-align:left;caption-side:bottom}th{text-align:inherit}button,input,optgroup,select,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}::-moz-selection{color:#fff;background:#1890ff}::selection{color:#fff;background:#1890ff}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}.anticon{display:inline-block;color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.anticon>*{line-height:1}.anticon svg{display:inline-block}.anticon:before{display:none}.anticon .anticon-icon{display:block}.anticon[tabindex]{cursor:pointer}.anticon-spin,.anticon-spin:before{display:inline-block;-webkit-animation:loadingCircle 1s linear infinite;animation:loadingCircle 1s linear infinite}.fade-appear,.fade-enter,.fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-appear.fade-appear-active,.fade-enter.fade-enter-active{-webkit-animation-name:antFadeIn;animation-name:antFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.fade-leave.fade-leave-active{-webkit-animation-name:antFadeOut;animation-name:antFadeOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.fade-appear,.fade-enter{opacity:0}.fade-appear,.fade-enter,.fade-leave{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes antFadeOut{0%{opacity:1}to{opacity:0}}@keyframes antFadeOut{0%{opacity:1}to{opacity:0}}.move-up-appear,.move-up-enter,.move-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-appear.move-up-appear-active,.move-up-enter.move-up-enter-active{-webkit-animation-name:antMoveUpIn;animation-name:antMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.move-up-leave.move-up-leave-active{-webkit-animation-name:antMoveUpOut;animation-name:antMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-up-appear,.move-up-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-up-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-down-appear,.move-down-enter,.move-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-appear.move-down-appear-active,.move-down-enter.move-down-enter-active{-webkit-animation-name:antMoveDownIn;animation-name:antMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.move-down-leave.move-down-leave-active{-webkit-animation-name:antMoveDownOut;animation-name:antMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-down-appear,.move-down-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-down-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-left-appear,.move-left-enter,.move-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-appear.move-left-appear-active,.move-left-enter.move-left-enter-active{-webkit-animation-name:antMoveLeftIn;animation-name:antMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.move-left-leave.move-left-leave-active{-webkit-animation-name:antMoveLeftOut;animation-name:antMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-left-appear,.move-left-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-left-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-right-appear,.move-right-enter,.move-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-appear.move-right-appear-active,.move-right-enter.move-right-enter-active{-webkit-animation-name:antMoveRightIn;animation-name:antMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.move-right-leave.move-right-leave-active{-webkit-animation-name:antMoveRightOut;animation-name:antMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-right-appear,.move-right-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-right-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}@-webkit-keyframes antMoveDownIn{0%{-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antMoveDownIn{0%{-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antMoveDownOut{0%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antMoveDownOut{0%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@-webkit-keyframes antMoveLeftIn{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antMoveLeftIn{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antMoveLeftOut{0%{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateX(-100%);transform:translateX(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antMoveLeftOut{0%{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateX(-100%);transform:translateX(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@-webkit-keyframes antMoveRightIn{0%{-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antMoveRightIn{0%{-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antMoveRightOut{0%{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antMoveRightOut{0%{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@-webkit-keyframes antMoveUpIn{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antMoveUpIn{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antMoveUpOut{0%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antMoveUpOut{0%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@-webkit-keyframes loadingCircle{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loadingCircle{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}[ant-click-animating-without-extra-node=true],[ant-click-animating=true]{position:relative}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}.ant-click-animating-node,[ant-click-animating-without-extra-node=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit;-webkit-box-shadow:0 0 0 0 #1890ff;-webkit-box-shadow:0 0 0 0 var(--antd-wave-shadow-color);box-shadow:0 0 0 0 #1890ff;box-shadow:0 0 0 0 var(--antd-wave-shadow-color);opacity:.2;-webkit-animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;content:"";pointer-events:none}@-webkit-keyframes waveEffect{to{-webkit-box-shadow:0 0 0 #1890ff;box-shadow:0 0 0 #1890ff;-webkit-box-shadow:0 0 0 6px #1890ff;-webkit-box-shadow:0 0 0 6px var(--antd-wave-shadow-color);box-shadow:0 0 0 6px #1890ff;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@keyframes waveEffect{to{-webkit-box-shadow:0 0 0 #1890ff;box-shadow:0 0 0 #1890ff;-webkit-box-shadow:0 0 0 6px #1890ff;-webkit-box-shadow:0 0 0 6px var(--antd-wave-shadow-color);box-shadow:0 0 0 6px #1890ff;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@-webkit-keyframes fadeEffect{to{opacity:0}}@keyframes fadeEffect{to{opacity:0}}.slide-up-appear,.slide-up-enter,.slide-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-appear.slide-up-appear-active,.slide-up-enter.slide-up-enter-active{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-leave.slide-up-leave-active{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-up-appear,.slide-up-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-up-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-down-appear,.slide-down-enter,.slide-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-appear.slide-down-appear-active,.slide-down-enter.slide-down-enter-active{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-leave.slide-down-leave-active{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-down-appear,.slide-down-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-down-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-left-appear,.slide-left-enter,.slide-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-appear.slide-left-appear-active,.slide-left-enter.slide-left-enter-active{-webkit-animation-name:antSlideLeftIn;animation-name:antSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-leave.slide-left-leave-active{-webkit-animation-name:antSlideLeftOut;animation-name:antSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-left-appear,.slide-left-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-left-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-right-appear,.slide-right-enter,.slide-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-appear.slide-right-appear-active,.slide-right-enter.slide-right-enter-active{-webkit-animation-name:antSlideRightIn;animation-name:antSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-leave.slide-right-leave-active{-webkit-animation-name:antSlideRightOut;animation-name:antSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-right-appear,.slide-right-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-right-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}@-webkit-keyframes antSlideUpIn{0%{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antSlideUpIn{0%{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antSlideUpOut{0%{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antSlideUpOut{0%{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@-webkit-keyframes antSlideDownIn{0%{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:0}to{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:1}}@keyframes antSlideDownIn{0%{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:0}to{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:1}}@-webkit-keyframes antSlideDownOut{0%{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:1}to{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:0}}@keyframes antSlideDownOut{0%{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:1}to{-webkit-transform:scaleY(.8);transform:scaleY(.8);-webkit-transform-origin:100% 100%;transform-origin:100% 100%;opacity:0}}@-webkit-keyframes antSlideLeftIn{0%{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antSlideLeftIn{0%{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antSlideLeftOut{0%{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antSlideLeftOut{0%{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@-webkit-keyframes antSlideRightIn{0%{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:0}to{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:1}}@keyframes antSlideRightIn{0%{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:0}to{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:1}}@-webkit-keyframes antSlideRightOut{0%{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:1}to{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:0}}@keyframes antSlideRightOut{0%{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:1}to{-webkit-transform:scaleX(.8);transform:scaleX(.8);-webkit-transform-origin:100% 0;transform-origin:100% 0;opacity:0}}.zoom-appear,.zoom-enter,.zoom-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-appear.zoom-appear-active,.zoom-enter.zoom-enter-active{-webkit-animation-name:antZoomIn;animation-name:antZoomIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-leave.zoom-leave-active{-webkit-animation-name:antZoomOut;animation-name:antZoomOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-appear,.zoom-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-big-appear,.zoom-big-enter,.zoom-big-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-big-appear.zoom-big-appear-active,.zoom-big-enter.zoom-big-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-big-leave.zoom-big-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-big-appear,.zoom-big-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-big-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-big-fast-appear,.zoom-big-fast-enter,.zoom-big-fast-leave{-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-big-fast-appear.zoom-big-fast-appear-active,.zoom-big-fast-enter.zoom-big-fast-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-big-fast-leave.zoom-big-fast-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-big-fast-appear,.zoom-big-fast-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-big-fast-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-up-appear,.zoom-up-enter,.zoom-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-up-appear.zoom-up-appear-active,.zoom-up-enter.zoom-up-enter-active{-webkit-animation-name:antZoomUpIn;animation-name:antZoomUpIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-up-leave.zoom-up-leave-active{-webkit-animation-name:antZoomUpOut;animation-name:antZoomUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-up-appear,.zoom-up-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-up-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-down-appear,.zoom-down-enter,.zoom-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-down-appear.zoom-down-appear-active,.zoom-down-enter.zoom-down-enter-active{-webkit-animation-name:antZoomDownIn;animation-name:antZoomDownIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-down-leave.zoom-down-leave-active{-webkit-animation-name:antZoomDownOut;animation-name:antZoomDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-down-appear,.zoom-down-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-down-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-left-appear,.zoom-left-enter,.zoom-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-left-appear.zoom-left-appear-active,.zoom-left-enter.zoom-left-enter-active{-webkit-animation-name:antZoomLeftIn;animation-name:antZoomLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-left-leave.zoom-left-leave-active{-webkit-animation-name:antZoomLeftOut;animation-name:antZoomLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-left-appear,.zoom-left-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-left-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-right-appear,.zoom-right-enter,.zoom-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-right-appear.zoom-right-appear-active,.zoom-right-enter.zoom-right-enter-active{-webkit-animation-name:antZoomRightIn;animation-name:antZoomRightIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-right-leave.zoom-right-leave-active{-webkit-animation-name:antZoomRightOut;animation-name:antZoomRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-right-appear,.zoom-right-enter{-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-right-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}@-webkit-keyframes antZoomIn{0%{-webkit-transform:scale(.2);transform:scale(.2);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes antZoomIn{0%{-webkit-transform:scale(.2);transform:scale(.2);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes antZoomOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(.2);transform:scale(.2);opacity:0}}@keyframes antZoomOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(.2);transform:scale(.2);opacity:0}}@-webkit-keyframes antZoomBigIn{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes antZoomBigIn{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes antZoomBigOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}}@keyframes antZoomBigOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}}@-webkit-keyframes antZoomUpIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 0;transform-origin:50% 0;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 0;transform-origin:50% 0}}@keyframes antZoomUpIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 0;transform-origin:50% 0;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 0;transform-origin:50% 0}}@-webkit-keyframes antZoomUpOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 0;transform-origin:50% 0}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 0;transform-origin:50% 0;opacity:0}}@keyframes antZoomUpOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 0;transform-origin:50% 0}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 0;transform-origin:50% 0;opacity:0}}@-webkit-keyframes antZoomLeftIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:0 50%;transform-origin:0 50%;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:0 50%;transform-origin:0 50%}}@keyframes antZoomLeftIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:0 50%;transform-origin:0 50%;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:0 50%;transform-origin:0 50%}}@-webkit-keyframes antZoomLeftOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:0 50%;transform-origin:0 50%}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:0 50%;transform-origin:0 50%;opacity:0}}@keyframes antZoomLeftOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:0 50%;transform-origin:0 50%}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:0 50%;transform-origin:0 50%;opacity:0}}@-webkit-keyframes antZoomRightIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:100% 50%;transform-origin:100% 50%}}@keyframes antZoomRightIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:100% 50%;transform-origin:100% 50%}}@-webkit-keyframes antZoomRightOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:100% 50%;transform-origin:100% 50%}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;opacity:0}}@keyframes antZoomRightOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:100% 50%;transform-origin:100% 50%}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;opacity:0}}@-webkit-keyframes antZoomDownIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 100%;transform-origin:50% 100%}}@keyframes antZoomDownIn{0%{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;opacity:0}to{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 100%;transform-origin:50% 100%}}@-webkit-keyframes antZoomDownOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 100%;transform-origin:50% 100%}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;opacity:0}}@keyframes antZoomDownOut{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:50% 100%;transform-origin:50% 100%}to{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;opacity:0}}.ant-motion-collapse-legacy{overflow:hidden}.ant-motion-collapse,.ant-motion-collapse-legacy-active{-webkit-transition:height .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)!important;transition:height .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)!important}.ant-motion-collapse{overflow:hidden}.ant-affix{position:fixed;z-index:10}.ant-alert{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;padding:8px 15px 8px 37px;word-wrap:break-word;border-radius:2px}.ant-alert.ant-alert-no-icon{padding:8px 15px}.ant-alert.ant-alert-no-icon .ant-alert-close-icon{top:12.0005px}.ant-alert.ant-alert-closable{padding-right:30px}.ant-alert-icon{position:absolute;top:12.0005px;left:16px}.ant-alert-description{display:none;font-size:14px;line-height:22px}.ant-alert-success{background-color:#f6ffed;border:1px solid #b7eb8f}.ant-alert-success .ant-alert-icon{color:#52c41a}.ant-alert-info{background-color:#e6f7ff;border:1px solid #91d5ff}.ant-alert-info .ant-alert-icon{color:#1890ff}.ant-alert-warning{background-color:#fffbe6;border:1px solid #ffe58f}.ant-alert-warning .ant-alert-icon{color:#faad14}.ant-alert-error{background-color:#fff2f0;border:1px solid #ffccc7}.ant-alert-error .ant-alert-icon{color:#ff4d4f}.ant-alert-error .ant-alert-description>pre{margin:0;padding:0}.ant-alert-close-icon{position:absolute;top:12.0005px;right:16px;padding:0;overflow:hidden;font-size:12px;line-height:12px;background-color:transparent;border:none;outline:none;cursor:pointer}.ant-alert-close-icon .anticon-close{color:rgba(0,0,0,.45);-webkit-transition:color .3s;transition:color .3s}.ant-alert-close-icon .anticon-close:hover{color:rgba(0,0,0,.75)}.ant-alert-close-text{color:rgba(0,0,0,.45);-webkit-transition:color .3s;transition:color .3s}.ant-alert-close-text:hover{color:rgba(0,0,0,.75)}.ant-alert-with-description{position:relative;padding:15px 15px 14px 64px;color:rgba(0,0,0,.65);line-height:1.5715;border-radius:2px}.ant-alert-with-description.ant-alert-no-icon{padding:15px}.ant-alert-with-description .ant-alert-icon{position:absolute;top:15px;left:24px;font-size:24px}.ant-alert-with-description .ant-alert-close-icon{position:absolute;top:8px;right:8px;font-size:14px;cursor:pointer}.ant-alert-with-description .ant-alert-message{display:block;margin-bottom:4px;color:rgba(0,0,0,.85);font-size:16px}.ant-alert-message{color:rgba(0,0,0,.85)}.ant-alert-with-description .ant-alert-description{display:block}.ant-alert.ant-alert-closing{height:0!important;margin:0;padding-top:0;padding-bottom:0;-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transition:all .3s cubic-bezier(.78,.14,.15,.86);transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-alert-slide-up-leave{-webkit-animation:antAlertSlideUpOut .3s cubic-bezier(.78,.14,.15,.86);animation:antAlertSlideUpOut .3s cubic-bezier(.78,.14,.15,.86);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-alert-banner{margin-bottom:0;border:0;border-radius:0}@-webkit-keyframes antAlertSlideUpIn{0%{-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes antAlertSlideUpIn{0%{-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes antAlertSlideUpOut{0%{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}@keyframes antAlertSlideUpOut{0%{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}to{-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}}.ant-alert.ant-alert-rtl{padding:8px 37px 8px 15px;direction:rtl}.ant-alert-rtl.ant-alert.ant-alert-no-icon{padding:8px 15px}.ant-alert.ant-alert-rtl.ant-alert.ant-alert-closable{padding-right:37px;padding-left:30px}.ant-alert.ant-alert-rtl.ant-alert.ant-alert-no-icon.ant-alert-closable{padding-right:15px;padding-left:30px}.ant-alert-rtl .ant-alert-icon{right:16px;left:auto}.ant-alert-rtl .ant-alert-close-icon{right:auto;left:16px}.ant-alert.ant-alert-rtl.ant-alert-with-description,.ant-alert.ant-alert-rtl.ant-alert-with-description.ant-alert-closable{padding:15px 64px 15px 15px}.ant-alert.ant-alert-rtl.ant-alert-with-description.ant-alert-no-icon{padding:15px}.ant-alert-rtl.ant-alert-with-description .ant-alert-icon{right:24px;left:auto}.ant-alert-rtl.ant-alert-with-description .ant-alert-close-icon{right:auto;left:16px}.ant-anchor{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;padding:0 0 0 2px}.ant-anchor-wrapper{margin-left:-4px;padding-left:4px;overflow:auto;background-color:#fff}.ant-anchor-ink{position:absolute;top:0;left:0;height:100%}.ant-anchor-ink:before{position:relative;display:block;width:2px;height:100%;margin:0 auto;background-color:#f0f0f0;content:" "}.ant-anchor-ink-ball{position:absolute;left:50%;display:none;width:8px;height:8px;background-color:#fff;border:2px solid #1890ff;border-radius:8px;-webkit-transform:translateX(-50%);transform:translateX(-50%);-webkit-transition:top .3s ease-in-out;transition:top .3s ease-in-out}.ant-anchor-ink-ball.visible{display:inline-block}.ant-anchor.fixed .ant-anchor-ink .ant-anchor-ink-ball{display:none}.ant-anchor-link{padding:7px 0 7px 16px;line-height:1.143}.ant-anchor-link-title{position:relative;display:block;margin-bottom:6px;overflow:hidden;color:rgba(0,0,0,.65);white-space:nowrap;text-overflow:ellipsis;-webkit-transition:all .3s;transition:all .3s}.ant-anchor-link-title:only-child{margin-bottom:0}.ant-anchor-link-active>.ant-anchor-link-title{color:#1890ff}.ant-anchor-link .ant-anchor-link{padding-top:5px;padding-bottom:5px}.ant-anchor-rtl{direction:rtl}.ant-anchor-rtl.ant-anchor-wrapper{margin-right:-4px;margin-left:0;padding-right:4px;padding-left:0}.ant-anchor-rtl .ant-anchor-ink{right:0;left:auto}.ant-anchor-rtl .ant-anchor-ink-ball{right:50%;left:0;-webkit-transform:translateX(50%);transform:translateX(50%)}.ant-anchor-rtl .ant-anchor-link{padding:7px 16px 7px 0}.ant-select-auto-complete{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}.ant-select-auto-complete .ant-select-clear{right:13px}.ant-select-single .ant-select-selector{display:-ms-flexbox;display:flex}.ant-select-single .ant-select-selector .ant-select-selection-search{position:absolute;top:0;right:11px;bottom:0;left:11px}.ant-select-single .ant-select-selector .ant-select-selection-search-input{width:100%}.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{padding:0;line-height:30px;-webkit-transition:all .3s;transition:all .3s}@supports (-moz-appearance:meterbar){.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{line-height:30px}}.ant-select-single .ant-select-selector .ant-select-selection-item{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-single .ant-select-selector .ant-select-selection-placeholder{pointer-events:none}.ant-select-single .ant-select-selector .ant-select-selection-item:after,.ant-select-single .ant-select-selector .ant-select-selection-placeholder:after,.ant-select-single .ant-select-selector:after{display:inline-block;width:0;visibility:hidden;content:"\a0"}.ant-select-single.ant-select-show-arrow .ant-select-selection-search{right:25px}.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-right:18px}.ant-select-single.ant-select-open .ant-select-selection-item{opacity:.4}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{position:relative;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);width:100%;height:32px;padding:0 11px}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector input{cursor:pointer}.ant-select-show-search.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{cursor:text}.ant-select-show-search.ant-select-single:not(.ant-select-customize-input) .ant-select-selector input{cursor:auto}.ant-select-focused.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{color:rgba(0,0,0,.25);background:#f5f5f5;cursor:not-allowed}.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector input{cursor:not-allowed}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{background:transparent;border:none;outline:none;height:30px}.ant-select-single.ant-select-customize-input .ant-select-selector:after{display:none}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{position:absolute;right:0;left:0;padding:0 11px}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{height:40px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder{line-height:38px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:38px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{height:24px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder{line-height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selection-search{right:7px;left:7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{padding:0 7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:28px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-right:21px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{padding:0 11px}.ant-select-multiple .ant-select-selector{position:relative;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;padding:1px 4px}.ant-select-multiple .ant-select-selector input{cursor:pointer}.ant-select-show-search.ant-select-multiple .ant-select-selector input{cursor:auto}.ant-select-focused.ant-select-multiple .ant-select-selector{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-select-disabled.ant-select-multiple .ant-select-selector{color:rgba(0,0,0,.25);background:#f5f5f5;cursor:not-allowed}.ant-select-disabled.ant-select-multiple .ant-select-selector input{cursor:not-allowed}.ant-select-multiple .ant-select-selector .ant-select-selection-search-input{background:transparent;border:none;outline:none}.ant-select-show-search.ant-select-multiple .ant-select-selector{cursor:text}.ant-select-multiple .ant-select-selector:after{display:inline-block;width:0;margin:2px 0;line-height:24px;content:"\a0"}.ant-select-multiple.ant-select-allow-clear .ant-select-selector{padding-right:24px}.ant-select-multiple .ant-select-selection-item{position:relative;display:-ms-flexbox;display:flex;-ms-flex:none;flex:none;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100%;height:24px;margin-top:2px;margin-right:4px;margin-bottom:2px;padding:0 4px 0 8px;line-height:22px;background:#f5f5f5;border:1px solid #f0f0f0;border-radius:2px;cursor:default;-webkit-transition:font-size .3s,line-height .3s,height .3s;transition:font-size .3s,line-height .3s,height .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-multiple .ant-select-selection-item-content{display:inline-block;margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-select-multiple .ant-select-selection-item-remove{color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:rgba(0,0,0,.45);font-weight:700;font-size:12px;line-height:inherit;cursor:pointer;display:inline-block;font-size:10px}.ant-select-multiple .ant-select-selection-item-remove>*{line-height:1}.ant-select-multiple .ant-select-selection-item-remove svg{display:inline-block}.ant-select-multiple .ant-select-selection-item-remove:before{display:none}.ant-select-multiple .ant-select-selection-item-remove .ant-select-multiple .ant-select-selection-item-remove-icon{display:block}.ant-select-multiple .ant-select-selection-item-remove>.anticon{vertical-align:-.2em}.ant-select-multiple .ant-select-selection-item-remove:hover{color:rgba(0,0,0,.75)}.ant-select-multiple .ant-select-selection-search{position:relative;margin-left:.5px}.ant-select-multiple .ant-select-selection-search-input,.ant-select-multiple .ant-select-selection-search-mirror{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5715;-webkit-transition:all .3s;transition:all .3s}.ant-select-multiple .ant-select-selection-search-input{width:100%;min-width:3px}.ant-select-multiple .ant-select-selection-search-mirror{position:absolute;top:0;left:0;z-index:999;white-space:nowrap;visibility:hidden}.ant-select-multiple .ant-select-selection-search:first-child .ant-select-selection-search-input{margin-left:6.5px}.ant-select-multiple .ant-select-selection-placeholder{position:absolute;top:50%;right:11px;left:11px;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:all .3s;transition:all .3s}.ant-select-multiple.ant-select-lg .ant-select-selector:after{line-height:32px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{line-height:30px}.ant-select-multiple.ant-select-lg .ant-select-selection-search{height:33px;line-height:33px}.ant-select-multiple.ant-select-lg .ant-select-selection-search-input,.ant-select-multiple.ant-select-lg .ant-select-selection-search-mirror{height:32px;line-height:30px}.ant-select-multiple.ant-select-sm .ant-select-selector:after{line-height:16px}.ant-select-multiple.ant-select-sm .ant-select-selection-item{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-search{height:17px;line-height:17px}.ant-select-multiple.ant-select-sm .ant-select-selection-search-input,.ant-select-multiple.ant-select-sm .ant-select-selection-search-mirror{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{left:7px}.ant-select-multiple.ant-select-sm .ant-select-selection-search:first-child .ant-select-selection-search-input{margin-left:3px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{height:32px;line-height:32px}.ant-select-disabled .ant-select-selection-item-remove{display:none}.ant-select{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;cursor:pointer}.ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:#40a9ff;border-right-width:1px!important}.ant-select-selection-item{-ms-flex:1;flex:1 1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (-ms-high-contrast:none){.ant-select-selection-item,.ant-select-selection-item ::-ms-backdrop{-ms-flex:auto;flex:auto}}.ant-select-selection-placeholder{-ms-flex:1;flex:1 1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:.4}@media (-ms-high-contrast:none){.ant-select-selection-placeholder,.ant-select-selection-placeholder ::-ms-backdrop{-ms-flex:auto;flex:auto}}.ant-select-arrow{display:inline-block;color:inherit;font-style:normal;line-height:0;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:53%;right:11px;width:12px;height:12px;margin-top:-6px;color:rgba(0,0,0,.25);font-size:12px;line-height:1;text-align:center;pointer-events:none}.ant-select-arrow>*{line-height:1}.ant-select-arrow svg{display:inline-block}.ant-select-arrow:before{display:none}.ant-select-arrow .ant-select-arrow-icon{display:block}.ant-select-arrow .anticon{vertical-align:top;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.ant-select-arrow .anticon>svg{vertical-align:top}.ant-select-arrow .anticon:not(.anticon-down){pointer-events:auto}.ant-select-clear{position:absolute;top:50%;right:11px;z-index:1;display:inline-block;width:12px;height:12px;margin-top:-6px;color:rgba(0,0,0,.25);font-size:12px;font-style:normal;line-height:1;text-align:center;text-transform:none;background:#fff;cursor:pointer;opacity:0;-webkit-transition:color .3s ease,opacity .15s ease;transition:color .3s ease,opacity .15s ease;text-rendering:auto}.ant-select-clear:before{display:block}.ant-select-clear:hover{color:rgba(0,0,0,.45)}.ant-select:hover .ant-select-clear{opacity:1}.ant-select-dropdown{margin:0;color:rgba(0,0,0,.65);font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum",;position:absolute;top:-9999px;left:-9999px;z-index:1050;-webkit-box-sizing:border-box;box-sizing:border-box;padding:4px 0;overflow:hidden;font-size:14px;font-variant:normal;background-color:#fff;border-radius:2px;outline:none;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-select-dropdown.slide-up-appear.slide-up-appear-active.ant-select-dropdown-placement-bottomLeft,.ant-select-dropdown.slide-up-enter.slide-up-enter-active.ant-select-dropdown-placement-bottomLeft{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-select-dropdown.slide-up-appear.slide-up-appear-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.slide-up-enter.slide-up-enter-active.ant-select-dropdown-placement-topLeft{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-select-dropdown.slide-up-leave.slide-up-leave-active.ant-select-dropdown-placement-bottomLeft{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-select-dropdown.slide-up-leave.slide-up-leave-active.ant-select-dropdown-placement-topLeft{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-select-dropdown-hidden{display:none}.ant-select-dropdown-empty{color:rgba(0,0,0,.25)}.ant-select-item-empty{color:rgba(0,0,0,.65);color:rgba(0,0,0,.25)}.ant-select-item,.ant-select-item-empty{position:relative;display:block;min-height:32px;padding:5px 12px;font-weight:400;font-size:14px;line-height:22px}.ant-select-item{color:rgba(0,0,0,.65);cursor:pointer;-webkit-transition:background .3s ease;transition:background .3s ease}.ant-select-item-group{color:rgba(0,0,0,.45);font-size:12px;cursor:default}.ant-select-item-option{display:-ms-flexbox;display:flex}.ant-select-item-option-content{-ms-flex:auto;flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-select-item-option-state{-ms-flex:none;flex:none}.ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:#f5f5f5}.ant-select-item-option-selected:not(.ant-select-item-option-disabled){color:rgba(0,0,0,.65);font-weight:600;background-color:#e6f7ff}.ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state{color:#1890ff}.ant-select-item-option-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-item-option-grouped{padding-left:24px}.ant-select-lg{font-size:16px}.ant-select-borderless .ant-select-selector{background-color:transparent!important;border-color:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}.ant-select-rtl{direction:rtl}.ant-select-rtl .ant-select-arrow,.ant-select-rtl .ant-select-clear{right:auto;left:11px}.ant-select-dropdown-rtl{direction:rtl}.ant-select-dropdown-rtl .ant-select-item-option-grouped{padding-right:24px;padding-left:12px}.ant-select-rtl.ant-select-multiple.ant-select-allow-clear .ant-select-selector{padding-right:4px;padding-left:24px}.ant-select-rtl.ant-select-multiple .ant-select-selection-item{margin-right:0;margin-left:4px;padding:0 8px 0 4px;text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-item-content{margin-right:0;margin-left:4px;text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-search{margin-right:.5px;margin-left:4px}.ant-select-rtl.ant-select-multiple .ant-select-selection-search-mirror{right:0;left:auto}.ant-select-rtl.ant-select-multiple .ant-select-selection-placeholder{right:11px;left:auto}.ant-select-rtl.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{right:7px}.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-placeholder{right:0;left:9px;text-align:right}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-search{right:11px;left:25px}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-right:0;padding-left:18px}.ant-select-rtl.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{padding:0 11px}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:0}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-right:0;padding-left:21px}.ant-empty{margin:0 8px;font-size:14px;line-height:1.5715;text-align:center}.ant-empty-image{height:100px;margin-bottom:8px}.ant-empty-image img{height:100%}.ant-empty-image svg{height:100%;margin:auto}.ant-empty-description{margin:0}.ant-empty-footer{margin-top:16px}.ant-empty-normal{margin:32px 0;color:rgba(0,0,0,.25)}.ant-empty-normal .ant-empty-image{height:40px}.ant-empty-small{margin:8px 0;color:rgba(0,0,0,.25)}.ant-empty-small .ant-empty-image{height:35px}.ant-empty-img-default-ellipse{fill-opacity:.8;fill:#f5f5f5}.ant-empty-img-default-path-1{fill:#aeb8c2}.ant-empty-img-default-path-2{fill:url(#linearGradient-1)}.ant-empty-img-default-path-3{fill:#f5f5f7}.ant-empty-img-default-path-4,.ant-empty-img-default-path-5{fill:#dce0e6}.ant-empty-img-default-g{fill:#fff}.ant-empty-img-simple-ellipse{fill:#f5f5f5}.ant-empty-img-simple-g{stroke:#d9d9d9}.ant-empty-img-simple-path{fill:#fafafa}.ant-empty-rtl{direction:rtl}.ant-avatar{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;overflow:hidden;color:#fff;white-space:nowrap;text-align:center;vertical-align:middle;background:#ccc;width:32px;height:32px;line-height:32px;border-radius:50%}.ant-avatar-image{background:transparent}.ant-avatar-string{position:absolute;left:50%;-webkit-transform-origin:0 center;transform-origin:0 center}.ant-avatar.ant-avatar-icon{font-size:18px}.ant-avatar.ant-avatar-icon>.anticon{margin:0}.ant-avatar-lg{width:40px;height:40px;line-height:40px;border-radius:50%}.ant-avatar-lg-string{position:absolute;left:50%;-webkit-transform-origin:0 center;transform-origin:0 center}.ant-avatar-lg.ant-avatar-icon{font-size:24px}.ant-avatar-lg.ant-avatar-icon>.anticon{margin:0}.ant-avatar-sm{width:24px;height:24px;line-height:24px;border-radius:50%}.ant-avatar-sm-string{position:absolute;left:50%;-webkit-transform-origin:0 center;transform-origin:0 center}.ant-avatar-sm.ant-avatar-icon{font-size:14px}.ant-avatar-sm.ant-avatar-icon>.anticon{margin:0}.ant-avatar-square{border-radius:2px}.ant-avatar>img{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.ant-back-top{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:fixed;right:100px;bottom:50px;z-index:10;width:40px;height:40px;cursor:pointer}.ant-back-top-rtl{right:auto;left:100px;direction:rtl}.ant-back-top-content{width:40px;height:40px;overflow:hidden;color:#fff;text-align:center;background-color:rgba(0,0,0,.45);border-radius:20px}.ant-back-top-content,.ant-back-top-content:hover{-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-back-top-content:hover{background-color:rgba(0,0,0,.65)}.ant-back-top-icon{width:14px;height:16px;margin:12px auto;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAYAAACWwljjAAAABGdBTUEAALGPC/xhBQAAAbtJREFUWAntmMtKw0AUhhMvS5cuxILgQlRUpIggIoKIIoigG1eC+AA+jo+i6FIXBfeuXIgoeKVeitVWJX5HWhhDksnUpp3FDPyZk3Nm5nycmZKkXhAEOXSA3lG7muTeRzmfy6HneUvIhnYkQK+Q9NhAA0Opg0vBEhjBKHiyb8iGMyQMOYuK41BcBSypAL+MYXSKjtFAW7EAGEO3qN4uMQbbAkXiSfRQJ1H6a+yhlkKRcAoVFYiweYNjtCVQJJpBz2GCiPt7fBOZQpFgDpUikse5HgnkM4Fi4QX0Fpc5wf9EbLqpUCy4jMoJSXWhFwbMNgWKhVbRhy5jirhs9fy/oFhgHVVTJEs7RLZ8sSEoJm6iz7SZDMbJ+/OKERQTttCXQRLToRUmrKWCYuA2+jbN0MB4OQobYShfdTCgn/sL1K36M7TLrN3n+758aPy2rrpR6+/od5E8tf/A1uLS9aId5T7J3CNYihkQ4D9PiMdMC7mp4rjB9kjFjZp8BlnVHJBuO1yFXIV0FdDF3RlyFdJVQBdv5AxVdIsq8apiZ2PyYO1EVykesGfZEESsCkweyR8MUW+V8uJ1gkYipmpdP1pm2aJVPEGzAAAAAElFTkSuQmCC) 100%/100% no-repeat}@media screen and (max-width:768px){.ant-back-top{right:60px}}@media screen and (max-width:480px){.ant-back-top{right:20px}}.ant-badge{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;color:unset;line-height:1}.ant-badge-count{z-index:auto;min-width:20px;height:20px;padding:0 6px;color:#fff;font-weight:400;font-size:12px;line-height:20px;white-space:nowrap;text-align:center;background:#ff4d4f;border-radius:10px;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ant-badge-count a,.ant-badge-count a:hover{color:#fff}.ant-badge-multiple-words{padding:0 8px}.ant-badge-dot{z-index:auto;width:6px;height:6px;background:#ff4d4f;border-radius:100%;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ant-badge-count,.ant-badge-dot,.ant-badge .ant-scroll-number-custom-component{position:absolute;top:0;right:0;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%);-webkit-transform-origin:100% 0;transform-origin:100% 0}.ant-badge-status{line-height:inherit;vertical-align:baseline}.ant-badge-status-dot{position:relative;top:-1px;display:inline-block;width:6px;height:6px;vertical-align:middle;border-radius:50%}.ant-badge-status-success{background-color:#52c41a}.ant-badge-status-processing{position:relative;background-color:#1890ff}.ant-badge-status-processing:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #1890ff;border-radius:50%;-webkit-animation:antStatusProcessing 1.2s ease-in-out infinite;animation:antStatusProcessing 1.2s ease-in-out infinite;content:""}.ant-badge-status-default{background-color:#d9d9d9}.ant-badge-status-error{background-color:#ff4d4f}.ant-badge-status-warning{background-color:#faad14}.ant-badge-status-magenta,.ant-badge-status-pink{background:#eb2f96}.ant-badge-status-red{background:#f5222d}.ant-badge-status-volcano{background:#fa541c}.ant-badge-status-orange{background:#fa8c16}.ant-badge-status-yellow{background:#fadb14}.ant-badge-status-gold{background:#faad14}.ant-badge-status-cyan{background:#13c2c2}.ant-badge-status-lime{background:#a0d911}.ant-badge-status-green{background:#52c41a}.ant-badge-status-blue{background:#1890ff}.ant-badge-status-geekblue{background:#2f54eb}.ant-badge-status-purple{background:#722ed1}.ant-badge-status-text{margin-left:8px;color:rgba(0,0,0,.65);font-size:14px}.ant-badge-zoom-appear,.ant-badge-zoom-enter{-webkit-animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-zoom-leave{-webkit-animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-not-a-wrapper:not(.ant-badge-status){vertical-align:middle}.ant-badge-not-a-wrapper .ant-scroll-number{position:relative;top:auto;display:block}@-webkit-keyframes antStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}to{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}@keyframes antStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}to{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}.ant-scroll-number{overflow:hidden}.ant-scroll-number-only{display:inline-block;height:20px;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-scroll-number-only>p.ant-scroll-number-only-unit{height:20px;margin:0}.ant-scroll-number-symbol{vertical-align:top}@-webkit-keyframes antZoomBadgeIn{0%{-webkit-transform:scale(0) translate(50%,-50%);transform:scale(0) translate(50%,-50%);opacity:0}to{-webkit-transform:scale(1) translate(50%,-50%);transform:scale(1) translate(50%,-50%)}}@keyframes antZoomBadgeIn{0%{-webkit-transform:scale(0) translate(50%,-50%);transform:scale(0) translate(50%,-50%);opacity:0}to{-webkit-transform:scale(1) translate(50%,-50%);transform:scale(1) translate(50%,-50%)}}@-webkit-keyframes antZoomBadgeOut{0%{-webkit-transform:scale(1) translate(50%,-50%);transform:scale(1) translate(50%,-50%)}to{-webkit-transform:scale(0) translate(50%,-50%);transform:scale(0) translate(50%,-50%);opacity:0}}@keyframes antZoomBadgeOut{0%{-webkit-transform:scale(1) translate(50%,-50%);transform:scale(1) translate(50%,-50%)}to{-webkit-transform:scale(0) translate(50%,-50%);transform:scale(0) translate(50%,-50%);opacity:0}}.ant-badge-rtl{direction:rtl}.ant-badge-rtl .ant-badge-count,.ant-badge-rtl .ant-badge-dot,.ant-badge-rtl .ant-badge .ant-scroll-number-custom-component{direction:ltr}.ant-badge-rtl .ant-badge-count,.ant-badge-rtl .ant-badge-dot,.ant-badge-rtl.ant-badge .ant-scroll-number-custom-component,.ant-badge-rtl .ant-badge .ant-scroll-number-custom-component{right:auto;left:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:0 0;transform-origin:0 0}.ant-badge-rtl .ant-badge-status-text{margin-right:8px;margin-left:0}.ant-badge-rtl .ant-badge-zoom-appear,.ant-badge-rtl .ant-badge-zoom-enter{-webkit-animation-name:antZoomBadgeInRtl;animation-name:antZoomBadgeInRtl}.ant-badge-rtl .ant-badge-zoom-leave{-webkit-animation-name:antZoomBadgeOutRtl;animation-name:antZoomBadgeOutRtl}.ant-badge-not-a-wrapper .ant-badge-count{-webkit-transform:none;transform:none}@-webkit-keyframes antZoomBadgeInRtl{0%{-webkit-transform:scale(0) translate(-50%,-50%);transform:scale(0) translate(-50%,-50%);opacity:0}to{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}}@keyframes antZoomBadgeInRtl{0%{-webkit-transform:scale(0) translate(-50%,-50%);transform:scale(0) translate(-50%,-50%);opacity:0}to{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}}@-webkit-keyframes antZoomBadgeOutRtl{0%{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}to{-webkit-transform:scale(0) translate(-50%,-50%);transform:scale(0) translate(-50%,-50%);opacity:0}}@keyframes antZoomBadgeOutRtl{0%{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}to{-webkit-transform:scale(0) translate(-50%,-50%);transform:scale(0) translate(-50%,-50%);opacity:0}}.ant-breadcrumb{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";color:rgba(0,0,0,.45);font-size:14px}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb a{color:rgba(0,0,0,.45);-webkit-transition:color .3s;transition:color .3s}.ant-breadcrumb a:hover{color:#40a9ff}.ant-breadcrumb>span:last-child,.ant-breadcrumb>span:last-child a{color:rgba(0,0,0,.65)}.ant-breadcrumb>span:last-child .ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{margin:0 8px;color:rgba(0,0,0,.45)}.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}.ant-breadcrumb-rtl{direction:rtl}.ant-breadcrumb-rtl:before{display:table;content:""}.ant-breadcrumb-rtl:after{display:table;clear:both;content:""}.ant-breadcrumb-rtl>span{float:right}.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-rtl .ant-breadcrumb-overlay-link>.anticon{margin-right:4px;margin-left:0}.ant-menu{-webkit-box-sizing:border-box;box-sizing:border-box;font-variant:tabular-nums;line-height:1.5715;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;line-height:0;text-align:left;list-style:none;background:#fff;outline:none;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);-webkit-transition:background .3s,width .2s;transition:background .3s,width .2s}.ant-menu:after,.ant-menu:before{display:table;content:""}.ant-menu:after{clear:both}.ant-menu ol,.ant-menu ul{margin:0;padding:0;list-style:none}.ant-menu-hidden{display:none}.ant-menu-item-group-title{height:1.5715;padding:8px 16px;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;-webkit-transition:all .3s;transition:all .3s}.ant-menu-submenu,.ant-menu-submenu-inline{-webkit-transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1);transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-selected{color:#1890ff}.ant-menu-item:active,.ant-menu-submenu-title:active{background:#e6f7ff}.ant-menu-submenu .ant-menu-sub{cursor:auto;-webkit-transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item a{color:rgba(0,0,0,.65)}.ant-menu-item a:hover{color:#1890ff}.ant-menu-item a:before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:""}.ant-menu-item>.ant-badge a{color:rgba(0,0,0,.65)}.ant-menu-item>.ant-badge a:hover{color:#1890ff}.ant-menu-item-divider{height:1px;overflow:hidden;line-height:0;background-color:#f0f0f0}.ant-menu-item-active,.ant-menu-item:hover,.ant-menu-submenu-active,.ant-menu-submenu-title:hover,.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{color:#1890ff}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu{margin-top:-1px}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu .ant-menu-submenu-title:hover{background-color:transparent}.ant-menu-item-selected,.ant-menu-item-selected a,.ant-menu-item-selected a:hover{color:#1890ff}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#e6f7ff}.ant-menu-inline,.ant-menu-vertical,.ant-menu-vertical-left{border-right:1px solid #f0f0f0}.ant-menu-vertical-right{border-left:1px solid #f0f0f0}.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{min-width:160px;max-height:calc(100vh - 100px);padding:0;overflow:hidden;border-right:0;-webkit-transform-origin:0 0;transform-origin:0 0}.ant-menu-vertical-left.ant-menu-sub:not(.zoom-big-enter-active):not(.zoom-big-leave-active),.ant-menu-vertical-right.ant-menu-sub:not(.zoom-big-enter-active):not(.zoom-big-leave-active),.ant-menu-vertical.ant-menu-sub:not(.zoom-big-enter-active):not(.zoom-big-leave-active){overflow-x:hidden;overflow-y:auto}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item,.ant-menu-vertical.ant-menu-sub .ant-menu-item{left:0;margin-left:0;border-right:0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical.ant-menu-sub .ant-menu-item:after{border-right:0}.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{-webkit-transform-origin:0 0;transform-origin:0 0}.ant-menu-horizontal.ant-menu-sub{min-width:114px}.ant-menu-item,.ant-menu-submenu-title{position:relative;display:block;margin:0;padding:0 20px;white-space:nowrap;cursor:pointer;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1),border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-item .anticon,.ant-menu-submenu-title .anticon{min-width:14px;margin-right:10px;font-size:14px;-webkit-transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1);transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item .anticon+span,.ant-menu-submenu-title .anticon+span{opacity:1;-webkit-transition:opacity .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1);transition:opacity .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-right:0}.ant-menu>.ant-menu-item-divider{height:1px;margin:1px 0;padding:0;overflow:hidden;line-height:0;background-color:#f0f0f0}.ant-menu-submenu-popup{position:absolute;z-index:1050;border-radius:2px;-webkit-box-shadow:none;box-shadow:none}.ant-menu-submenu-popup:before{position:absolute;top:-7px;right:0;bottom:0;left:0;width:100%;height:100%;opacity:.0001;content:" "}.ant-menu-submenu-placement-rightTop:before{top:0;left:-7px}.ant-menu-submenu>.ant-menu{background-color:#fff;border-radius:2px}.ant-menu-submenu>.ant-menu-submenu-title:after{-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-popup>.ant-menu{background-color:#fff}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow{position:absolute;top:50%;right:16px;width:10px;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{position:absolute;width:6px;height:1.5px;background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.65)),to(rgba(0,0,0,.65)));background-image:linear-gradient(90deg,rgba(0,0,0,.65),rgba(0,0,0,.65));border-radius:2px;-webkit-transition:background .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);content:""}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(45deg) translateY(-2px);transform:rotate(45deg) translateY(-2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(-45deg) translateY(2px);transform:rotate(-45deg) translateY(2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-inline>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before{background:-webkit-gradient(linear,left top,right top,from(#1890ff),to(#1890ff));background:linear-gradient(90deg,#1890ff,#1890ff)}.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(45deg) translateY(-2px);transform:rotate(45deg) translateY(-2px)}.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(-45deg) translateY(2px);transform:rotate(-45deg) translateY(2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(-45deg) translateX(2px);transform:rotate(-45deg) translateX(2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(45deg) translateX(-2px);transform:rotate(45deg) translateX(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow{-webkit-transform:translateY(-2px);transform:translateY(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(-45deg) translateX(-2px);transform:rotate(-45deg) translateX(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(45deg) translateX(2px);transform:rotate(45deg) translateX(2px)}.ant-menu-vertical-left .ant-menu-submenu-selected,.ant-menu-vertical-left .ant-menu-submenu-selected a,.ant-menu-vertical-right .ant-menu-submenu-selected,.ant-menu-vertical-right .ant-menu-submenu-selected a,.ant-menu-vertical .ant-menu-submenu-selected,.ant-menu-vertical .ant-menu-submenu-selected a{color:#1890ff}.ant-menu-horizontal{line-height:46px;white-space:nowrap;border:0;border-bottom:1px solid #f0f0f0;-webkit-box-shadow:none;box-shadow:none}.ant-menu-horizontal>.ant-menu-item,.ant-menu-horizontal>.ant-menu-submenu{position:relative;top:1px;display:inline-block;vertical-align:bottom;border-bottom:2px solid transparent}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover{color:#1890ff;border-bottom:2px solid #1890ff}.ant-menu-horizontal>.ant-menu-item a{color:rgba(0,0,0,.65)}.ant-menu-horizontal>.ant-menu-item a:hover{color:#1890ff}.ant-menu-horizontal>.ant-menu-item a:before{bottom:-2px}.ant-menu-horizontal>.ant-menu-item-selected a{color:#1890ff}.ant-menu-horizontal:after{display:block;clear:both;height:0;content:"\20"}.ant-menu-inline .ant-menu-item,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical .ant-menu-item{position:relative}.ant-menu-inline .ant-menu-item:after,.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-vertical .ant-menu-item:after{position:absolute;top:0;right:0;bottom:0;border-right:3px solid #1890ff;-webkit-transform:scaleY(.0001);transform:scaleY(.0001);opacity:0;-webkit-transition:opacity .15s cubic-bezier(.215,.61,.355,1),-webkit-transform .15s cubic-bezier(.215,.61,.355,1);transition:opacity .15s cubic-bezier(.215,.61,.355,1),-webkit-transform .15s cubic-bezier(.215,.61,.355,1);transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1);transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1),-webkit-transform .15s cubic-bezier(.215,.61,.355,1);content:""}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical-right .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical .ant-menu-submenu-title{height:40px;margin-top:4px;margin-bottom:4px;padding:0 16px;overflow:hidden;line-height:40px;text-overflow:ellipsis}.ant-menu-inline .ant-menu-submenu,.ant-menu-vertical-left .ant-menu-submenu,.ant-menu-vertical-right .ant-menu-submenu,.ant-menu-vertical .ant-menu-submenu{padding-bottom:.02px}.ant-menu-inline .ant-menu-item:not(:last-child),.ant-menu-vertical-left .ant-menu-item:not(:last-child),.ant-menu-vertical-right .ant-menu-item:not(:last-child),.ant-menu-vertical .ant-menu-item:not(:last-child){margin-bottom:8px}.ant-menu-inline>.ant-menu-item,.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-left>.ant-menu-item,.ant-menu-vertical-left>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-right>.ant-menu-item,.ant-menu-vertical-right>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical>.ant-menu-item,.ant-menu-vertical>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px}.ant-menu-vertical .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline{width:100%}.ant-menu-inline .ant-menu-item-selected:after,.ant-menu-inline .ant-menu-selected:after{-webkit-transform:scaleY(1);transform:scaleY(1);opacity:1;-webkit-transition:opacity .15s cubic-bezier(.645,.045,.355,1),-webkit-transform .15s cubic-bezier(.645,.045,.355,1);transition:opacity .15s cubic-bezier(.645,.045,.355,1),-webkit-transform .15s cubic-bezier(.645,.045,.355,1);transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1);transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1),-webkit-transform .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title{width:calc(100% + 1px)}.ant-menu-inline .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline-collapsed{width:80px}.ant-menu-inline-collapsed>.ant-menu-item,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title{left:0;padding:0 32px;text-overflow:clip}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{display:none}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon,.ant-menu-inline-collapsed>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon{margin:0;font-size:16px;line-height:40px}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon+span,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span,.ant-menu-inline-collapsed>.ant-menu-item .anticon+span,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span{display:inline-block;max-width:0;opacity:0}.ant-menu-inline-collapsed .anticon{display:inline-block}.ant-menu-inline-collapsed-tooltip{pointer-events:none}.ant-menu-inline-collapsed-tooltip .anticon{display:none}.ant-menu-inline-collapsed-tooltip a{color:hsla(0,0%,100%,.85)}.ant-menu-inline-collapsed .ant-menu-item-group-title{padding-right:4px;padding-left:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-menu-item-group-list{margin:0;padding:0}.ant-menu-item-group-list .ant-menu-item,.ant-menu-item-group-list .ant-menu-submenu-title{padding:0 16px 0 28px}.ant-menu-root.ant-menu-inline,.ant-menu-root.ant-menu-vertical,.ant-menu-root.ant-menu-vertical-left,.ant-menu-root.ant-menu-vertical-right,.ant-menu-sub.ant-menu-inline{-webkit-box-shadow:none;box-shadow:none}.ant-menu-sub.ant-menu-inline{padding:0;border-radius:0}.ant-menu-sub.ant-menu-inline>.ant-menu-item,.ant-menu-sub.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px;list-style-position:inside;list-style-type:disc}.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:32px}.ant-menu-item-disabled,.ant-menu-submenu-disabled{color:rgba(0,0,0,.25)!important;background:none;border-color:transparent!important;cursor:not-allowed}.ant-menu-item-disabled a,.ant-menu-submenu-disabled a{color:rgba(0,0,0,.25)!important;pointer-events:none}.ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-submenu-disabled>.ant-menu-submenu-title{color:rgba(0,0,0,.25)!important;cursor:not-allowed}.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:rgba(0,0,0,.25)!important}.ant-layout-header .ant-menu{line-height:inherit}.ant-menu-dark .ant-menu-sub,.ant-menu.ant-menu-dark{color:hsla(0,0%,100%,.65);background:#001529}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:.45;-webkit-transition:all .3s;transition:all .3s}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark.ant-menu-submenu-popup{background:transparent}.ant-menu-dark .ant-menu-inline.ant-menu-sub{background:#000c17}.ant-menu-dark.ant-menu-horizontal{border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item,.ant-menu-dark.ant-menu-horizontal>.ant-menu-submenu{top:0;margin-top:0;border-color:#001529;border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item>a:before{bottom:0}.ant-menu-dark .ant-menu-item,.ant-menu-dark .ant-menu-item-group-title,.ant-menu-dark .ant-menu-item>a,.ant-menu-dark .ant-menu-item>span>a{color:hsla(0,0%,100%,.65)}.ant-menu-dark.ant-menu-inline,.ant-menu-dark.ant-menu-vertical,.ant-menu-dark.ant-menu-vertical-left,.ant-menu-dark.ant-menu-vertical-right{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item,.ant-menu-dark.ant-menu-vertical .ant-menu-item{left:0;margin-left:0;border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical .ant-menu-item:after{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-inline .ant-menu-submenu-title{width:100%}.ant-menu-dark .ant-menu-item-active,.ant-menu-dark .ant-menu-item:hover,.ant-menu-dark .ant-menu-submenu-active,.ant-menu-dark .ant-menu-submenu-open,.ant-menu-dark .ant-menu-submenu-selected,.ant-menu-dark .ant-menu-submenu-title:hover{color:#fff;background-color:transparent}.ant-menu-dark .ant-menu-item-active>a,.ant-menu-dark .ant-menu-item-active>span>a,.ant-menu-dark .ant-menu-item:hover>a,.ant-menu-dark .ant-menu-item:hover>span>a,.ant-menu-dark .ant-menu-submenu-active>a,.ant-menu-dark .ant-menu-submenu-active>span>a,.ant-menu-dark .ant-menu-submenu-open>a,.ant-menu-dark .ant-menu-submenu-open>span>a,.ant-menu-dark .ant-menu-submenu-selected>a,.ant-menu-dark .ant-menu-submenu-selected>span>a,.ant-menu-dark .ant-menu-submenu-title:hover>a,.ant-menu-dark .ant-menu-submenu-title:hover>span>a{color:#fff}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow{opacity:1}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark .ant-menu-item:hover{background-color:transparent}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#1890ff}.ant-menu-dark .ant-menu-item-selected{color:#fff;border-right:0}.ant-menu-dark .ant-menu-item-selected:after{border-right:0}.ant-menu-dark .ant-menu-item-selected .anticon,.ant-menu-dark .ant-menu-item-selected .anticon+span,.ant-menu-dark .ant-menu-item-selected>a,.ant-menu-dark .ant-menu-item-selected>a:hover,.ant-menu-dark .ant-menu-item-selected>span>a,.ant-menu-dark .ant-menu-item-selected>span>a:hover{color:#fff}.ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,.ant-menu.ant-menu-dark .ant-menu-item-selected{background-color:#1890ff}.ant-menu-dark .ant-menu-item-disabled,.ant-menu-dark .ant-menu-item-disabled>a,.ant-menu-dark .ant-menu-item-disabled>span>a,.ant-menu-dark .ant-menu-submenu-disabled,.ant-menu-dark .ant-menu-submenu-disabled>a,.ant-menu-dark .ant-menu-submenu-disabled>span>a{color:hsla(0,0%,100%,.35)!important;opacity:.8}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title{color:hsla(0,0%,100%,.35)!important}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:hsla(0,0%,100%,.35)!important}.ant-menu-rtl{direction:rtl}.ant-menu-rtl,.ant-menu-rtl .ant-menu-item-group-title{text-align:right}.ant-menu-rtl.ant-menu-inline,.ant-menu-rtl.ant-menu-vertical{border-right:none;border-left:1px solid #f0f0f0}.ant-menu-rtl.ant-menu-dark.ant-menu-inline,.ant-menu-rtl.ant-menu-dark.ant-menu-vertical{border-left:none}.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub,.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{-webkit-transform-origin:top right;transform-origin:top right}.ant-menu-rtl .ant-menu-item .anticon,.ant-menu-rtl .ant-menu-submenu-title .anticon{margin-right:auto;margin-left:10px}.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-left:0}.ant-menu-rtl .ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow{right:auto;left:16px}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(-45deg) translateY(-2px);transform:rotate(-45deg) translateY(-2px)}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(45deg) translateY(2px);transform:rotate(45deg) translateY(2px)}.ant-menu-rtl.ant-menu-inline .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical .ant-menu-item:after{right:auto;left:0}.ant-menu-rtl.ant-menu-inline .ant-menu-item,.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical .ant-menu-item,.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title{text-align:right}.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title{padding-right:0;padding-left:34px}.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title{padding-right:16px;padding-left:34px}.ant-menu-rtl.ant-menu-inline-collapsed.ant-menu-vertical .ant-menu-submenu-title{padding:0 32px}.ant-menu-rtl .ant-menu-item-group-list .ant-menu-item,.ant-menu-rtl .ant-menu-item-group-list .ant-menu-submenu-title{padding:0 28px 0 16px}.ant-menu-sub.ant-menu-inline{border:0}.ant-menu-rtl.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-right:32px;padding-left:0}.ant-tooltip{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:absolute;z-index:1060;display:block;max-width:250px;visibility:visible}.ant-tooltip-hidden{display:none}.ant-tooltip-placement-top,.ant-tooltip-placement-topLeft,.ant-tooltip-placement-topRight{padding-bottom:8px}.ant-tooltip-placement-right,.ant-tooltip-placement-rightBottom,.ant-tooltip-placement-rightTop{padding-left:8px}.ant-tooltip-placement-bottom,.ant-tooltip-placement-bottomLeft,.ant-tooltip-placement-bottomRight{padding-top:8px}.ant-tooltip-placement-left,.ant-tooltip-placement-leftBottom,.ant-tooltip-placement-leftTop{padding-right:8px}.ant-tooltip-inner{min-width:30px;min-height:32px;padding:6px 8px;color:#fff;text-align:left;text-decoration:none;word-wrap:break-word;background-color:rgba(0,0,0,.75);border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-tooltip-arrow{position:absolute;display:block;width:13.07106781px;height:13.07106781px;overflow:hidden;background:transparent;pointer-events:none}.ant-tooltip-arrow:before{position:absolute;top:0;right:0;bottom:0;left:0;display:block;width:5px;height:5px;margin:auto;background-color:rgba(0,0,0,.75);content:"";pointer-events:auto}.ant-tooltip-placement-top .ant-tooltip-arrow,.ant-tooltip-placement-topLeft .ant-tooltip-arrow,.ant-tooltip-placement-topRight .ant-tooltip-arrow{bottom:-5.07106781px}.ant-tooltip-placement-top .ant-tooltip-arrow:before,.ant-tooltip-placement-topLeft .ant-tooltip-arrow:before,.ant-tooltip-placement-topRight .ant-tooltip-arrow:before{-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);-webkit-transform:translateY(-6.53553391px) rotate(45deg);transform:translateY(-6.53553391px) rotate(45deg)}.ant-tooltip-placement-top .ant-tooltip-arrow{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.ant-tooltip-placement-topLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-topRight .ant-tooltip-arrow{right:13px}.ant-tooltip-placement-right .ant-tooltip-arrow,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,.ant-tooltip-placement-rightTop .ant-tooltip-arrow{left:-5.07106781px}.ant-tooltip-placement-right .ant-tooltip-arrow:before,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow:before,.ant-tooltip-placement-rightTop .ant-tooltip-arrow:before{-webkit-box-shadow:-3px 3px 7px rgba(0,0,0,.07);box-shadow:-3px 3px 7px rgba(0,0,0,.07);-webkit-transform:translateX(6.53553391px) rotate(45deg);transform:translateX(6.53553391px) rotate(45deg)}.ant-tooltip-placement-right .ant-tooltip-arrow{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ant-tooltip-placement-rightTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-rightBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-left .ant-tooltip-arrow,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,.ant-tooltip-placement-leftTop .ant-tooltip-arrow{right:-5.07106781px}.ant-tooltip-placement-left .ant-tooltip-arrow:before,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow:before,.ant-tooltip-placement-leftTop .ant-tooltip-arrow:before{-webkit-box-shadow:3px -3px 7px rgba(0,0,0,.07);box-shadow:3px -3px 7px rgba(0,0,0,.07);-webkit-transform:translateX(-6.53553391px) rotate(45deg);transform:translateX(-6.53553391px) rotate(45deg)}.ant-tooltip-placement-left .ant-tooltip-arrow{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ant-tooltip-placement-leftTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-leftBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-bottom .ant-tooltip-arrow,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{top:-5.07106781px}.ant-tooltip-placement-bottom .ant-tooltip-arrow:before,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow:before,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow:before{-webkit-box-shadow:-3px -3px 7px rgba(0,0,0,.07);box-shadow:-3px -3px 7px rgba(0,0,0,.07);-webkit-transform:translateY(6.53553391px) rotate(45deg);transform:translateY(6.53553391px) rotate(45deg)}.ant-tooltip-placement-bottom .ant-tooltip-arrow{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{right:13px}.ant-tooltip-rtl{direction:rtl}.ant-tooltip-rtl .ant-tooltip-inner{text-align:right}.ant-dropdown{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:absolute;top:-9999px;left:-9999px;z-index:1050;display:block}.ant-dropdown:before{position:absolute;top:-7px;right:0;bottom:-7px;left:-7px;z-index:-9999;opacity:.0001;content:" "}.ant-dropdown-wrap{position:relative}.ant-dropdown-wrap .ant-btn>.anticon-down{display:inline-block;font-size:10px}.ant-dropdown-wrap .anticon-down:before{-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s}.ant-dropdown-wrap-open .anticon-down:before{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.ant-dropdown-hidden,.ant-dropdown-menu-hidden{display:none}.ant-dropdown-menu{position:relative;margin:0;padding:4px 0;text-align:left;list-style-type:none;background-color:#fff;background-clip:padding-box;border-radius:2px;outline:none;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);-webkit-transform:translateZ(0)}.ant-dropdown-menu-item-group-title{padding:5px 12px;color:rgba(0,0,0,.45);-webkit-transition:all .3s;transition:all .3s}.ant-dropdown-menu-submenu-popup{position:absolute;z-index:1050;background:transparent;-webkit-box-shadow:none;box-shadow:none}.ant-dropdown-menu-submenu-popup>.ant-dropdown-menu{-webkit-transform-origin:0 0;transform-origin:0 0}.ant-dropdown-menu-submenu-popup li,.ant-dropdown-menu-submenu-popup ul{list-style:none}.ant-dropdown-menu-submenu-popup ul{margin-right:.3em;margin-left:.3em}.ant-dropdown-menu-item,.ant-dropdown-menu-submenu-title{clear:both;margin:0;padding:5px 12px;color:rgba(0,0,0,.65);font-weight:400;font-size:14px;line-height:22px;white-space:nowrap;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-menu-submenu-title>span>.anticon:first-child{min-width:12px;margin-right:8px;font-size:12px}.ant-dropdown-menu-item>a,.ant-dropdown-menu-submenu-title>a{display:block;margin:-5px -12px;padding:5px 12px;color:rgba(0,0,0,.65);-webkit-transition:all .3s;transition:all .3s}.ant-dropdown-menu-item>a:hover,.ant-dropdown-menu-submenu-title>a:hover{color:rgba(0,0,0,.65)}.ant-dropdown-menu-item-selected,.ant-dropdown-menu-item-selected>a,.ant-dropdown-menu-submenu-title-selected,.ant-dropdown-menu-submenu-title-selected>a{color:#1890ff;background-color:#e6f7ff}.ant-dropdown-menu-item:hover,.ant-dropdown-menu-submenu-title:hover{background-color:#f5f5f5}.ant-dropdown-menu-item-disabled,.ant-dropdown-menu-submenu-title-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-item-disabled:hover,.ant-dropdown-menu-submenu-title-disabled:hover{color:rgba(0,0,0,.25);background-color:#fff;cursor:not-allowed}.ant-dropdown-menu-item-divider,.ant-dropdown-menu-submenu-title-divider{height:1px;margin:4px 0;overflow:hidden;line-height:0;background-color:#f0f0f0}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow{position:absolute;right:8px}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{margin-right:0!important;color:rgba(0,0,0,.45);font-style:normal;display:inline-block;font-size:10px}.ant-dropdown-menu-item-group-list{margin:0 8px;padding:0;list-style:none}.ant-dropdown-menu-submenu-title{padding-right:24px}.ant-dropdown-menu-submenu-vertical{position:relative}.ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{position:absolute;top:0;left:100%;min-width:100%;margin-left:4px;-webkit-transform-origin:0 0;transform-origin:0 0}.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{color:rgba(0,0,0,.25);background-color:#fff;cursor:not-allowed}.ant-dropdown-menu-submenu-selected .ant-dropdown-menu-submenu-title{color:#1890ff}.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomCenter,.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomRight,.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomCenter,.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topCenter,.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topLeft,.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topRight,.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topCenter,.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topLeft,.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topRight{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomCenter,.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topCenter,.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topLeft,.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topRight{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-dropdown-button>.anticon.anticon-down,.ant-dropdown-link>.anticon.anticon-down,.ant-dropdown-trigger>.anticon.anticon-down{vertical-align:baseline;display:inline-block;font-size:10px}.ant-dropdown-button{white-space:nowrap}.ant-dropdown-button.ant-btn-group>.ant-btn:last-child:not(:first-child):not(.ant-btn-icon-only){padding-right:8px;padding-left:8px}.ant-dropdown-menu-dark,.ant-dropdown-menu-dark .ant-dropdown-menu{background:#001529}.ant-dropdown-menu-dark .ant-dropdown-menu-item,.ant-dropdown-menu-dark .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after{color:hsla(0,0%,100%,.65)}.ant-dropdown-menu-dark .ant-dropdown-menu-item:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title:hover{color:#fff;background:transparent}.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected>a{color:#fff;background:#1890ff}.ant-dropdown-rtl{direction:rtl}.ant-dropdown-rtl.ant-dropdown:before{right:-7px;left:0}.ant-dropdown-rtl .ant-dropdown-menu-item-group-title{direction:rtl;text-align:right}.ant-dropdown-rtl .ant-dropdown-menu-item,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup li,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup ul,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{text-align:right}.ant-dropdown-rtl .ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>span>.anticon:first-child{margin-right:0;margin-left:8px}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow{right:auto;left:8px}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{margin-left:0!important;-webkit-transform:scaleX(-1);transform:scaleX(-1)}.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{padding-right:12px;padding-left:24px}.ant-dropdown-rtl .ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{right:100%;left:0;margin-right:4px;margin-left:0}.ant-btn{line-height:1.5715;position:relative;display:inline-block;font-weight:400;white-space:nowrap;text-align:center;background-image:none;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:manipulation;touch-action:manipulation;height:32px;padding:4px 15px;font-size:14px;border-radius:2px;color:rgba(0,0,0,.65);background-color:#fff;border:1px solid #d9d9d9}.ant-btn>.anticon{line-height:1}.ant-btn,.ant-btn:active,.ant-btn:focus{outline:0}.ant-btn:not([disabled]):hover{text-decoration:none}.ant-btn:not([disabled]):active{outline:0;-webkit-box-shadow:none;box-shadow:none}.ant-btn.disabled,.ant-btn[disabled]{cursor:not-allowed}.ant-btn.disabled>*,.ant-btn[disabled]>*{pointer-events:none}.ant-btn-lg{height:40px;padding:6.4px 15px;font-size:16px;border-radius:2px}.ant-btn-sm{height:24px;padding:0 7px;font-size:14px;border-radius:2px}.ant-btn>a:only-child{color:currentColor}.ant-btn>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn:focus,.ant-btn:hover{color:#40a9ff;background-color:#fff;border-color:#40a9ff}.ant-btn:focus>a:only-child,.ant-btn:hover>a:only-child{color:currentColor}.ant-btn:focus>a:only-child:after,.ant-btn:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn.active,.ant-btn:active{color:#096dd9;background-color:#fff;border-color:#096dd9}.ant-btn.active>a:only-child,.ant-btn:active>a:only-child{color:currentColor}.ant-btn.active>a:only-child:after,.ant-btn:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-disabled,.ant-btn-disabled.active,.ant-btn-disabled:active,.ant-btn-disabled:focus,.ant-btn-disabled:hover,.ant-btn.disabled,.ant-btn.disabled.active,.ant-btn.disabled:active,.ant-btn.disabled:focus,.ant-btn.disabled:hover,.ant-btn[disabled],.ant-btn[disabled].active,.ant-btn[disabled]:active,.ant-btn[disabled]:focus,.ant-btn[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-disabled.active>a:only-child,.ant-btn-disabled:active>a:only-child,.ant-btn-disabled:focus>a:only-child,.ant-btn-disabled:hover>a:only-child,.ant-btn-disabled>a:only-child,.ant-btn.disabled.active>a:only-child,.ant-btn.disabled:active>a:only-child,.ant-btn.disabled:focus>a:only-child,.ant-btn.disabled:hover>a:only-child,.ant-btn.disabled>a:only-child,.ant-btn[disabled].active>a:only-child,.ant-btn[disabled]:active>a:only-child,.ant-btn[disabled]:focus>a:only-child,.ant-btn[disabled]:hover>a:only-child,.ant-btn[disabled]>a:only-child{color:currentColor}.ant-btn-disabled.active>a:only-child:after,.ant-btn-disabled:active>a:only-child:after,.ant-btn-disabled:focus>a:only-child:after,.ant-btn-disabled:hover>a:only-child:after,.ant-btn-disabled>a:only-child:after,.ant-btn.disabled.active>a:only-child:after,.ant-btn.disabled:active>a:only-child:after,.ant-btn.disabled:focus>a:only-child:after,.ant-btn.disabled:hover>a:only-child:after,.ant-btn.disabled>a:only-child:after,.ant-btn[disabled].active>a:only-child:after,.ant-btn[disabled]:active>a:only-child:after,.ant-btn[disabled]:focus>a:only-child:after,.ant-btn[disabled]:hover>a:only-child:after,.ant-btn[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn.active,.ant-btn:active,.ant-btn:focus,.ant-btn:hover{text-decoration:none;background:#fff}.ant-btn>span{display:inline-block}.ant-btn-primary{color:#fff;background-color:#1890ff;border-color:#1890ff;text-shadow:0 -1px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 2px 0 rgba(0,0,0,.045);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-primary>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-primary:focus,.ant-btn-primary:hover{color:#fff;background-color:#40a9ff;border-color:#40a9ff}.ant-btn-primary:focus>a:only-child,.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-primary:focus>a:only-child:after,.ant-btn-primary:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-primary.active,.ant-btn-primary:active{color:#fff;background-color:#096dd9;border-color:#096dd9}.ant-btn-primary.active>a:only-child,.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-primary.active>a:only-child:after,.ant-btn-primary:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-primary-disabled,.ant-btn-primary-disabled.active,.ant-btn-primary-disabled:active,.ant-btn-primary-disabled:focus,.ant-btn-primary-disabled:hover,.ant-btn-primary.disabled,.ant-btn-primary.disabled.active,.ant-btn-primary.disabled:active,.ant-btn-primary.disabled:focus,.ant-btn-primary.disabled:hover,.ant-btn-primary[disabled],.ant-btn-primary[disabled].active,.ant-btn-primary[disabled]:active,.ant-btn-primary[disabled]:focus,.ant-btn-primary[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-primary-disabled.active>a:only-child,.ant-btn-primary-disabled:active>a:only-child,.ant-btn-primary-disabled:focus>a:only-child,.ant-btn-primary-disabled:hover>a:only-child,.ant-btn-primary-disabled>a:only-child,.ant-btn-primary.disabled.active>a:only-child,.ant-btn-primary.disabled:active>a:only-child,.ant-btn-primary.disabled:focus>a:only-child,.ant-btn-primary.disabled:hover>a:only-child,.ant-btn-primary.disabled>a:only-child,.ant-btn-primary[disabled].active>a:only-child,.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-primary-disabled.active>a:only-child:after,.ant-btn-primary-disabled:active>a:only-child:after,.ant-btn-primary-disabled:focus>a:only-child:after,.ant-btn-primary-disabled:hover>a:only-child:after,.ant-btn-primary-disabled>a:only-child:after,.ant-btn-primary.disabled.active>a:only-child:after,.ant-btn-primary.disabled:active>a:only-child:after,.ant-btn-primary.disabled:focus>a:only-child:after,.ant-btn-primary.disabled:hover>a:only-child:after,.ant-btn-primary.disabled>a:only-child:after,.ant-btn-primary[disabled].active>a:only-child:after,.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-primary[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child){border-right-color:#40a9ff;border-left-color:#40a9ff}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child):disabled{border-color:#d9d9d9}.ant-btn-group .ant-btn-primary:first-child:not(:last-child){border-right-color:#40a9ff}.ant-btn-group .ant-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#d9d9d9}.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#40a9ff}.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#d9d9d9}.ant-btn-ghost{color:rgba(0,0,0,.65);background-color:transparent;border-color:#d9d9d9}.ant-btn-ghost>a:only-child{color:currentColor}.ant-btn-ghost>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-ghost:focus,.ant-btn-ghost:hover{color:#40a9ff;background-color:transparent;border-color:#40a9ff}.ant-btn-ghost:focus>a:only-child,.ant-btn-ghost:hover>a:only-child{color:currentColor}.ant-btn-ghost:focus>a:only-child:after,.ant-btn-ghost:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-ghost.active,.ant-btn-ghost:active{color:#096dd9;background-color:transparent;border-color:#096dd9}.ant-btn-ghost.active>a:only-child,.ant-btn-ghost:active>a:only-child{color:currentColor}.ant-btn-ghost.active>a:only-child:after,.ant-btn-ghost:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-ghost-disabled,.ant-btn-ghost-disabled.active,.ant-btn-ghost-disabled:active,.ant-btn-ghost-disabled:focus,.ant-btn-ghost-disabled:hover,.ant-btn-ghost.disabled,.ant-btn-ghost.disabled.active,.ant-btn-ghost.disabled:active,.ant-btn-ghost.disabled:focus,.ant-btn-ghost.disabled:hover,.ant-btn-ghost[disabled],.ant-btn-ghost[disabled].active,.ant-btn-ghost[disabled]:active,.ant-btn-ghost[disabled]:focus,.ant-btn-ghost[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-ghost-disabled.active>a:only-child,.ant-btn-ghost-disabled:active>a:only-child,.ant-btn-ghost-disabled:focus>a:only-child,.ant-btn-ghost-disabled:hover>a:only-child,.ant-btn-ghost-disabled>a:only-child,.ant-btn-ghost.disabled.active>a:only-child,.ant-btn-ghost.disabled:active>a:only-child,.ant-btn-ghost.disabled:focus>a:only-child,.ant-btn-ghost.disabled:hover>a:only-child,.ant-btn-ghost.disabled>a:only-child,.ant-btn-ghost[disabled].active>a:only-child,.ant-btn-ghost[disabled]:active>a:only-child,.ant-btn-ghost[disabled]:focus>a:only-child,.ant-btn-ghost[disabled]:hover>a:only-child,.ant-btn-ghost[disabled]>a:only-child{color:currentColor}.ant-btn-ghost-disabled.active>a:only-child:after,.ant-btn-ghost-disabled:active>a:only-child:after,.ant-btn-ghost-disabled:focus>a:only-child:after,.ant-btn-ghost-disabled:hover>a:only-child:after,.ant-btn-ghost-disabled>a:only-child:after,.ant-btn-ghost.disabled.active>a:only-child:after,.ant-btn-ghost.disabled:active>a:only-child:after,.ant-btn-ghost.disabled:focus>a:only-child:after,.ant-btn-ghost.disabled:hover>a:only-child:after,.ant-btn-ghost.disabled>a:only-child:after,.ant-btn-ghost[disabled].active>a:only-child:after,.ant-btn-ghost[disabled]:active>a:only-child:after,.ant-btn-ghost[disabled]:focus>a:only-child:after,.ant-btn-ghost[disabled]:hover>a:only-child:after,.ant-btn-ghost[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed{color:rgba(0,0,0,.65);background-color:#fff;border-color:#d9d9d9;border-style:dashed}.ant-btn-dashed>a:only-child{color:currentColor}.ant-btn-dashed>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed:focus,.ant-btn-dashed:hover{color:#40a9ff;background-color:#fff;border-color:#40a9ff}.ant-btn-dashed:focus>a:only-child,.ant-btn-dashed:hover>a:only-child{color:currentColor}.ant-btn-dashed:focus>a:only-child:after,.ant-btn-dashed:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed.active,.ant-btn-dashed:active{color:#096dd9;background-color:#fff;border-color:#096dd9}.ant-btn-dashed.active>a:only-child,.ant-btn-dashed:active>a:only-child{color:currentColor}.ant-btn-dashed.active>a:only-child:after,.ant-btn-dashed:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed-disabled,.ant-btn-dashed-disabled.active,.ant-btn-dashed-disabled:active,.ant-btn-dashed-disabled:focus,.ant-btn-dashed-disabled:hover,.ant-btn-dashed.disabled,.ant-btn-dashed.disabled.active,.ant-btn-dashed.disabled:active,.ant-btn-dashed.disabled:focus,.ant-btn-dashed.disabled:hover,.ant-btn-dashed[disabled],.ant-btn-dashed[disabled].active,.ant-btn-dashed[disabled]:active,.ant-btn-dashed[disabled]:focus,.ant-btn-dashed[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-dashed-disabled.active>a:only-child,.ant-btn-dashed-disabled:active>a:only-child,.ant-btn-dashed-disabled:focus>a:only-child,.ant-btn-dashed-disabled:hover>a:only-child,.ant-btn-dashed-disabled>a:only-child,.ant-btn-dashed.disabled.active>a:only-child,.ant-btn-dashed.disabled:active>a:only-child,.ant-btn-dashed.disabled:focus>a:only-child,.ant-btn-dashed.disabled:hover>a:only-child,.ant-btn-dashed.disabled>a:only-child,.ant-btn-dashed[disabled].active>a:only-child,.ant-btn-dashed[disabled]:active>a:only-child,.ant-btn-dashed[disabled]:focus>a:only-child,.ant-btn-dashed[disabled]:hover>a:only-child,.ant-btn-dashed[disabled]>a:only-child{color:currentColor}.ant-btn-dashed-disabled.active>a:only-child:after,.ant-btn-dashed-disabled:active>a:only-child:after,.ant-btn-dashed-disabled:focus>a:only-child:after,.ant-btn-dashed-disabled:hover>a:only-child:after,.ant-btn-dashed-disabled>a:only-child:after,.ant-btn-dashed.disabled.active>a:only-child:after,.ant-btn-dashed.disabled:active>a:only-child:after,.ant-btn-dashed.disabled:focus>a:only-child:after,.ant-btn-dashed.disabled:hover>a:only-child:after,.ant-btn-dashed.disabled>a:only-child:after,.ant-btn-dashed[disabled].active>a:only-child:after,.ant-btn-dashed[disabled]:active>a:only-child:after,.ant-btn-dashed[disabled]:focus>a:only-child:after,.ant-btn-dashed[disabled]:hover>a:only-child:after,.ant-btn-dashed[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger{color:#fff;background-color:#ff4d4f;border-color:#ff4d4f;text-shadow:0 -1px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 2px 0 rgba(0,0,0,.045);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-danger>a:only-child{color:currentColor}.ant-btn-danger>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger:focus,.ant-btn-danger:hover{color:#fff;background-color:#ff7875;border-color:#ff7875}.ant-btn-danger:focus>a:only-child,.ant-btn-danger:hover>a:only-child{color:currentColor}.ant-btn-danger:focus>a:only-child:after,.ant-btn-danger:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger.active,.ant-btn-danger:active{color:#fff;background-color:#d9363e;border-color:#d9363e}.ant-btn-danger.active>a:only-child,.ant-btn-danger:active>a:only-child{color:currentColor}.ant-btn-danger.active>a:only-child:after,.ant-btn-danger:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger-disabled,.ant-btn-danger-disabled.active,.ant-btn-danger-disabled:active,.ant-btn-danger-disabled:focus,.ant-btn-danger-disabled:hover,.ant-btn-danger.disabled,.ant-btn-danger.disabled.active,.ant-btn-danger.disabled:active,.ant-btn-danger.disabled:focus,.ant-btn-danger.disabled:hover,.ant-btn-danger[disabled],.ant-btn-danger[disabled].active,.ant-btn-danger[disabled]:active,.ant-btn-danger[disabled]:focus,.ant-btn-danger[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-danger-disabled.active>a:only-child,.ant-btn-danger-disabled:active>a:only-child,.ant-btn-danger-disabled:focus>a:only-child,.ant-btn-danger-disabled:hover>a:only-child,.ant-btn-danger-disabled>a:only-child,.ant-btn-danger.disabled.active>a:only-child,.ant-btn-danger.disabled:active>a:only-child,.ant-btn-danger.disabled:focus>a:only-child,.ant-btn-danger.disabled:hover>a:only-child,.ant-btn-danger.disabled>a:only-child,.ant-btn-danger[disabled].active>a:only-child,.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-danger[disabled]>a:only-child{color:currentColor}.ant-btn-danger-disabled.active>a:only-child:after,.ant-btn-danger-disabled:active>a:only-child:after,.ant-btn-danger-disabled:focus>a:only-child:after,.ant-btn-danger-disabled:hover>a:only-child:after,.ant-btn-danger-disabled>a:only-child:after,.ant-btn-danger.disabled.active>a:only-child:after,.ant-btn-danger.disabled:active>a:only-child:after,.ant-btn-danger.disabled:focus>a:only-child:after,.ant-btn-danger.disabled:hover>a:only-child:after,.ant-btn-danger.disabled>a:only-child:after,.ant-btn-danger[disabled].active>a:only-child:after,.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-danger[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link{color:#1890ff;background-color:transparent;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.ant-btn-link>a:only-child{color:currentColor}.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link:focus,.ant-btn-link:hover{color:#40a9ff;background-color:transparent;border-color:#40a9ff}.ant-btn-link:focus>a:only-child,.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-link:focus>a:only-child:after,.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link.active,.ant-btn-link:active{color:#096dd9;background-color:transparent;border-color:#096dd9}.ant-btn-link.active>a:only-child,.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-link.active>a:only-child:after,.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link-disabled,.ant-btn-link-disabled.active,.ant-btn-link-disabled:active,.ant-btn-link-disabled:focus,.ant-btn-link-disabled:hover,.ant-btn-link.disabled,.ant-btn-link.disabled.active,.ant-btn-link.disabled:active,.ant-btn-link.disabled:focus,.ant-btn-link.disabled:hover,.ant-btn-link[disabled],.ant-btn-link[disabled].active,.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{background-color:#f5f5f5;border-color:#d9d9d9}.ant-btn-link:active,.ant-btn-link:focus,.ant-btn-link:hover{border-color:transparent}.ant-btn-link-disabled,.ant-btn-link-disabled.active,.ant-btn-link-disabled:active,.ant-btn-link-disabled:focus,.ant-btn-link-disabled:hover,.ant-btn-link.disabled,.ant-btn-link.disabled.active,.ant-btn-link.disabled:active,.ant-btn-link.disabled:focus,.ant-btn-link.disabled:hover,.ant-btn-link[disabled],.ant-btn-link[disabled].active,.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{color:rgba(0,0,0,.25);background-color:transparent;border-color:transparent;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-link-disabled.active>a:only-child,.ant-btn-link-disabled:active>a:only-child,.ant-btn-link-disabled:focus>a:only-child,.ant-btn-link-disabled:hover>a:only-child,.ant-btn-link-disabled>a:only-child,.ant-btn-link.disabled.active>a:only-child,.ant-btn-link.disabled:active>a:only-child,.ant-btn-link.disabled:focus>a:only-child,.ant-btn-link.disabled:hover>a:only-child,.ant-btn-link.disabled>a:only-child,.ant-btn-link[disabled].active>a:only-child,.ant-btn-link[disabled]:active>a:only-child,.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-link-disabled.active>a:only-child:after,.ant-btn-link-disabled:active>a:only-child:after,.ant-btn-link-disabled:focus>a:only-child:after,.ant-btn-link-disabled:hover>a:only-child:after,.ant-btn-link-disabled>a:only-child:after,.ant-btn-link.disabled.active>a:only-child:after,.ant-btn-link.disabled:active>a:only-child:after,.ant-btn-link.disabled:focus>a:only-child:after,.ant-btn-link.disabled:hover>a:only-child:after,.ant-btn-link.disabled>a:only-child:after,.ant-btn-link[disabled].active>a:only-child:after,.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous{color:#ff4d4f;background-color:#fff;border-color:#ff4d4f}.ant-btn-dangerous>a:only-child{color:currentColor}.ant-btn-dangerous>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous:focus,.ant-btn-dangerous:hover{color:#ff7875;background-color:#fff;border-color:#ff7875}.ant-btn-dangerous:focus>a:only-child,.ant-btn-dangerous:hover>a:only-child{color:currentColor}.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-dangerous:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.active,.ant-btn-dangerous:active{color:#d9363e;background-color:#fff;border-color:#d9363e}.ant-btn-dangerous.active>a:only-child,.ant-btn-dangerous:active>a:only-child{color:currentColor}.ant-btn-dangerous.active>a:only-child:after,.ant-btn-dangerous:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous-disabled,.ant-btn-dangerous-disabled.active,.ant-btn-dangerous-disabled:active,.ant-btn-dangerous-disabled:focus,.ant-btn-dangerous-disabled:hover,.ant-btn-dangerous.disabled,.ant-btn-dangerous.disabled.active,.ant-btn-dangerous.disabled:active,.ant-btn-dangerous.disabled:focus,.ant-btn-dangerous.disabled:hover,.ant-btn-dangerous[disabled],.ant-btn-dangerous[disabled].active,.ant-btn-dangerous[disabled]:active,.ant-btn-dangerous[disabled]:focus,.ant-btn-dangerous[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-dangerous-disabled.active>a:only-child,.ant-btn-dangerous-disabled:active>a:only-child,.ant-btn-dangerous-disabled:focus>a:only-child,.ant-btn-dangerous-disabled:hover>a:only-child,.ant-btn-dangerous-disabled>a:only-child,.ant-btn-dangerous.disabled.active>a:only-child,.ant-btn-dangerous.disabled:active>a:only-child,.ant-btn-dangerous.disabled:focus>a:only-child,.ant-btn-dangerous.disabled:hover>a:only-child,.ant-btn-dangerous.disabled>a:only-child,.ant-btn-dangerous[disabled].active>a:only-child,.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-dangerous[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous-disabled.active>a:only-child:after,.ant-btn-dangerous-disabled:active>a:only-child:after,.ant-btn-dangerous-disabled:focus>a:only-child:after,.ant-btn-dangerous-disabled:hover>a:only-child:after,.ant-btn-dangerous-disabled>a:only-child:after,.ant-btn-dangerous.disabled.active>a:only-child:after,.ant-btn-dangerous.disabled:active>a:only-child:after,.ant-btn-dangerous.disabled:focus>a:only-child:after,.ant-btn-dangerous.disabled:hover>a:only-child:after,.ant-btn-dangerous.disabled>a:only-child:after,.ant-btn-dangerous[disabled].active>a:only-child:after,.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-dangerous[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary{color:#fff;background-color:#ff4d4f;border-color:#ff4d4f;text-shadow:0 -1px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 2px 0 rgba(0,0,0,.045);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-dangerous.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary:focus,.ant-btn-dangerous.ant-btn-primary:hover{color:#fff;background-color:#ff7875;border-color:#ff7875}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary.active,.ant-btn-dangerous.ant-btn-primary:active{color:#fff;background-color:#d9363e;border-color:#d9363e}.ant-btn-dangerous.ant-btn-primary.active>a:only-child,.ant-btn-dangerous.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary.active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary-disabled,.ant-btn-dangerous.ant-btn-primary-disabled.active,.ant-btn-dangerous.ant-btn-primary-disabled:active,.ant-btn-dangerous.ant-btn-primary-disabled:focus,.ant-btn-dangerous.ant-btn-primary-disabled:hover,.ant-btn-dangerous.ant-btn-primary.disabled,.ant-btn-dangerous.ant-btn-primary.disabled.active,.ant-btn-dangerous.ant-btn-primary.disabled:active,.ant-btn-dangerous.ant-btn-primary.disabled:focus,.ant-btn-dangerous.ant-btn-primary.disabled:hover,.ant-btn-dangerous.ant-btn-primary[disabled],.ant-btn-dangerous.ant-btn-primary[disabled].active,.ant-btn-dangerous.ant-btn-primary[disabled]:active,.ant-btn-dangerous.ant-btn-primary[disabled]:focus,.ant-btn-dangerous.ant-btn-primary[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-dangerous.ant-btn-primary-disabled.active>a:only-child,.ant-btn-dangerous.ant-btn-primary-disabled:active>a:only-child,.ant-btn-dangerous.ant-btn-primary-disabled:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary-disabled:hover>a:only-child,.ant-btn-dangerous.ant-btn-primary-disabled>a:only-child,.ant-btn-dangerous.ant-btn-primary.disabled.active>a:only-child,.ant-btn-dangerous.ant-btn-primary.disabled:active>a:only-child,.ant-btn-dangerous.ant-btn-primary.disabled:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary.disabled:hover>a:only-child,.ant-btn-dangerous.ant-btn-primary.disabled>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled].active>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary-disabled.active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary-disabled:active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary-disabled:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary-disabled:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-primary-disabled>a:only-child:after,.ant-btn-dangerous.ant-btn-primary.disabled.active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary.disabled:active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary.disabled:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary.disabled:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-primary.disabled>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled].active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link{color:#ff4d4f;background-color:transparent;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{color:#40a9ff;border-color:#40a9ff}.ant-btn-dangerous.ant-btn-link.active,.ant-btn-dangerous.ant-btn-link:active{color:#096dd9;background-color:transparent;border-color:#096dd9}.ant-btn-dangerous.ant-btn-link.active>a:only-child,.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link.active>a:only-child:after,.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link-disabled,.ant-btn-dangerous.ant-btn-link-disabled.active,.ant-btn-dangerous.ant-btn-link-disabled:active,.ant-btn-dangerous.ant-btn-link-disabled:focus,.ant-btn-dangerous.ant-btn-link-disabled:hover,.ant-btn-dangerous.ant-btn-link.disabled,.ant-btn-dangerous.ant-btn-link.disabled.active,.ant-btn-dangerous.ant-btn-link.disabled:active,.ant-btn-dangerous.ant-btn-link.disabled:focus,.ant-btn-dangerous.ant-btn-link.disabled:hover,.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled].active,.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{background-color:#f5f5f5;border-color:#d9d9d9}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{color:#ff7875;background-color:transparent;border-color:transparent}.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link:active{color:#d9363e;background-color:transparent;border-color:transparent}.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link-disabled,.ant-btn-dangerous.ant-btn-link-disabled.active,.ant-btn-dangerous.ant-btn-link-disabled:active,.ant-btn-dangerous.ant-btn-link-disabled:focus,.ant-btn-dangerous.ant-btn-link-disabled:hover,.ant-btn-dangerous.ant-btn-link.disabled,.ant-btn-dangerous.ant-btn-link.disabled.active,.ant-btn-dangerous.ant-btn-link.disabled:active,.ant-btn-dangerous.ant-btn-link.disabled:focus,.ant-btn-dangerous.ant-btn-link.disabled:hover,.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled].active,.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{color:rgba(0,0,0,.25);background-color:transparent;border-color:transparent;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-dangerous.ant-btn-link-disabled.active>a:only-child,.ant-btn-dangerous.ant-btn-link-disabled:active>a:only-child,.ant-btn-dangerous.ant-btn-link-disabled:focus>a:only-child,.ant-btn-dangerous.ant-btn-link-disabled:hover>a:only-child,.ant-btn-dangerous.ant-btn-link-disabled>a:only-child,.ant-btn-dangerous.ant-btn-link.disabled.active>a:only-child,.ant-btn-dangerous.ant-btn-link.disabled:active>a:only-child,.ant-btn-dangerous.ant-btn-link.disabled:focus>a:only-child,.ant-btn-dangerous.ant-btn-link.disabled:hover>a:only-child,.ant-btn-dangerous.ant-btn-link.disabled>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled].active>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link-disabled.active>a:only-child:after,.ant-btn-dangerous.ant-btn-link-disabled:active>a:only-child:after,.ant-btn-dangerous.ant-btn-link-disabled:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link-disabled:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-link-disabled>a:only-child:after,.ant-btn-dangerous.ant-btn-link.disabled.active>a:only-child:after,.ant-btn-dangerous.ant-btn-link.disabled:active>a:only-child:after,.ant-btn-dangerous.ant-btn-link.disabled:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link.disabled:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-link.disabled>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled].active>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-icon-only{width:32px;height:32px;padding:2.4px 0;font-size:16px;border-radius:2px;vertical-align:-.5px}.ant-btn-icon-only>*{font-size:16px}.ant-btn-icon-only.ant-btn-lg{width:40px;height:40px;padding:4.9px 0;font-size:18px;border-radius:2px}.ant-btn-icon-only.ant-btn-lg>*{font-size:18px}.ant-btn-icon-only.ant-btn-sm{width:24px;height:24px;padding:0;font-size:14px;border-radius:2px}.ant-btn-icon-only.ant-btn-sm>*{font-size:14px}.ant-btn-round{height:32px;padding:4px 16px;font-size:14px;border-radius:32px}.ant-btn-round.ant-btn-lg{height:40px;padding:6.4px 20px;font-size:16px;border-radius:40px}.ant-btn-round.ant-btn-sm{height:24px;padding:0 12px;font-size:14px;border-radius:24px}.ant-btn-round.ant-btn-icon-only{width:auto}.ant-btn-circle,.ant-btn-circle-outline{min-width:32px;padding-right:0;padding-left:0;text-align:center;border-radius:50%}.ant-btn-circle-outline.ant-btn-lg,.ant-btn-circle.ant-btn-lg{min-width:40px;border-radius:50%}.ant-btn-circle-outline.ant-btn-sm,.ant-btn-circle.ant-btn-sm{min-width:24px;border-radius:50%}.ant-btn:before{position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;z-index:1;display:none;background:#fff;border-radius:inherit;opacity:.35;-webkit-transition:opacity .2s;transition:opacity .2s;content:"";pointer-events:none}.ant-btn .anticon{-webkit-transition:margin-left .3s cubic-bezier(.645,.045,.355,1);transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.ant-btn .anticon.anticon-minus>svg,.ant-btn .anticon.anticon-plus>svg{shape-rendering:optimizeSpeed}.ant-btn.ant-btn-loading{position:relative}.ant-btn.ant-btn-loading:not([disabled]){pointer-events:none}.ant-btn.ant-btn-loading:before{display:block}.ant-btn>.ant-btn-loading-icon{-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-btn>.ant-btn-loading-icon .anticon{padding-right:8px}.ant-btn-group{display:-ms-inline-flexbox;display:inline-flex}.ant-btn-group,.ant-btn-group>.ant-btn,.ant-btn-group>span>.ant-btn{position:relative}.ant-btn-group>.ant-btn.active,.ant-btn-group>.ant-btn:active,.ant-btn-group>.ant-btn:focus,.ant-btn-group>.ant-btn:hover,.ant-btn-group>span>.ant-btn.active,.ant-btn-group>span>.ant-btn:active,.ant-btn-group>span>.ant-btn:focus,.ant-btn-group>span>.ant-btn:hover{z-index:2}.ant-btn-group>.ant-btn:disabled,.ant-btn-group>span>.ant-btn:disabled{z-index:0}.ant-btn-group .ant-btn-icon-only{font-size:14px}.ant-btn-group-lg>.ant-btn,.ant-btn-group-lg>span>.ant-btn{height:40px;padding:6.4px 15px;font-size:16px;border-radius:0}.ant-btn-group-lg .ant-btn.ant-btn-icon-only{width:40px;height:40px;padding-right:0;padding-left:0}.ant-btn-group-sm>.ant-btn,.ant-btn-group-sm>span>.ant-btn{height:24px;padding:0 7px;font-size:14px;border-radius:0}.ant-btn-group-sm>.ant-btn>.anticon,.ant-btn-group-sm>span>.ant-btn>.anticon{font-size:14px}.ant-btn-group-sm .ant-btn.ant-btn-icon-only{width:24px;height:24px;padding-right:0;padding-left:0}.ant-btn+.ant-btn-group,.ant-btn-group+.ant-btn,.ant-btn-group+.ant-btn-group,.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group .ant-btn+span,.ant-btn-group>span+span,.ant-btn-group span+.ant-btn{margin-left:-1px}.ant-btn-group .ant-btn-primary+.ant-btn:not(.ant-btn-primary):not([disabled]){border-left-color:transparent}.ant-btn-group .ant-btn{border-radius:0}.ant-btn-group>.ant-btn:first-child,.ant-btn-group>span:first-child>.ant-btn{margin-left:0}.ant-btn-group>.ant-btn:only-child,.ant-btn-group>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-btn-group-sm>.ant-btn:only-child,.ant-btn-group-sm>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-btn-group>.ant-btn-group{float:left}.ant-btn-group>.ant-btn-group:not(:first-child):not(:last-child)>.ant-btn{border-radius:0}.ant-btn-group>.ant-btn-group:first-child:not(:last-child)>.ant-btn:last-child{padding-right:8px;border-top-right-radius:0;border-bottom-right-radius:0}.ant-btn-group>.ant-btn-group:last-child:not(:first-child)>.ant-btn:first-child{padding-left:8px;border-top-left-radius:0;border-bottom-left-radius:0}.ant-btn-group-rtl.ant-btn+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group+.ant-btn,.ant-btn-group-rtl.ant-btn-group+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group-rtl.ant-btn-group .ant-btn+span,.ant-btn-group-rtl.ant-btn-group>span+span,.ant-btn-group-rtl.ant-btn-group span+.ant-btn,.ant-btn-rtl.ant-btn+.ant-btn-group,.ant-btn-rtl.ant-btn-group+.ant-btn,.ant-btn-rtl.ant-btn-group+.ant-btn-group,.ant-btn-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-rtl.ant-btn-group .ant-btn+span,.ant-btn-rtl.ant-btn-group>span+span,.ant-btn-rtl.ant-btn-group span+.ant-btn{margin-right:-1px;margin-left:auto}.ant-btn-group.ant-btn-group-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-btn-group-rtl.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-btn:active>span,.ant-btn:focus>span{position:relative}.ant-btn>.anticon+span,.ant-btn>span+.anticon{margin-left:8px}.ant-btn-background-ghost{color:#fff;background:transparent!important;border-color:#fff}.ant-btn-background-ghost.ant-btn-primary{color:#1890ff;background-color:transparent;border-color:#1890ff;text-shadow:none}.ant-btn-background-ghost.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-primary:focus,.ant-btn-background-ghost.ant-btn-primary:hover{color:#40a9ff;background-color:transparent;border-color:#40a9ff}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-primary.active,.ant-btn-background-ghost.ant-btn-primary:active{color:#096dd9;background-color:transparent;border-color:#096dd9}.ant-btn-background-ghost.ant-btn-primary.active>a:only-child,.ant-btn-background-ghost.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-primary-disabled,.ant-btn-background-ghost.ant-btn-primary-disabled.active,.ant-btn-background-ghost.ant-btn-primary-disabled:active,.ant-btn-background-ghost.ant-btn-primary-disabled:focus,.ant-btn-background-ghost.ant-btn-primary-disabled:hover,.ant-btn-background-ghost.ant-btn-primary.disabled,.ant-btn-background-ghost.ant-btn-primary.disabled.active,.ant-btn-background-ghost.ant-btn-primary.disabled:active,.ant-btn-background-ghost.ant-btn-primary.disabled:focus,.ant-btn-background-ghost.ant-btn-primary.disabled:hover,.ant-btn-background-ghost.ant-btn-primary[disabled],.ant-btn-background-ghost.ant-btn-primary[disabled].active,.ant-btn-background-ghost.ant-btn-primary[disabled]:active,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-primary-disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-primary-disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary-disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary-disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary-disabled>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary-disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary-disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary-disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary-disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary-disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger{color:#ff4d4f;background-color:transparent;border-color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-danger>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger:focus,.ant-btn-background-ghost.ant-btn-danger:hover{color:#ff7875;background-color:transparent;border-color:#ff7875}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger.active,.ant-btn-background-ghost.ant-btn-danger:active{color:#d9363e;background-color:transparent;border-color:#d9363e}.ant-btn-background-ghost.ant-btn-danger.active>a:only-child,.ant-btn-background-ghost.ant-btn-danger:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger-disabled,.ant-btn-background-ghost.ant-btn-danger-disabled.active,.ant-btn-background-ghost.ant-btn-danger-disabled:active,.ant-btn-background-ghost.ant-btn-danger-disabled:focus,.ant-btn-background-ghost.ant-btn-danger-disabled:hover,.ant-btn-background-ghost.ant-btn-danger.disabled,.ant-btn-background-ghost.ant-btn-danger.disabled.active,.ant-btn-background-ghost.ant-btn-danger.disabled:active,.ant-btn-background-ghost.ant-btn-danger.disabled:focus,.ant-btn-background-ghost.ant-btn-danger.disabled:hover,.ant-btn-background-ghost.ant-btn-danger[disabled],.ant-btn-background-ghost.ant-btn-danger[disabled].active,.ant-btn-background-ghost.ant-btn-danger[disabled]:active,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-danger-disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-danger-disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger-disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger-disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger-disabled>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger-disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger-disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger-disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger-disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger-disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous{color:#ff4d4f;background-color:transparent;border-color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous:focus,.ant-btn-background-ghost.ant-btn-dangerous:hover{color:#ff7875;background-color:transparent;border-color:#ff7875}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.active,.ant-btn-background-ghost.ant-btn-dangerous:active{color:#d9363e;background-color:transparent;border-color:#d9363e}.ant-btn-background-ghost.ant-btn-dangerous.active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous-disabled,.ant-btn-background-ghost.ant-btn-dangerous-disabled.active,.ant-btn-background-ghost.ant-btn-dangerous-disabled:active,.ant-btn-background-ghost.ant-btn-dangerous-disabled:focus,.ant-btn-background-ghost.ant-btn-dangerous-disabled:hover,.ant-btn-background-ghost.ant-btn-dangerous.disabled,.ant-btn-background-ghost.ant-btn-dangerous.disabled.active,.ant-btn-background-ghost.ant-btn-dangerous.disabled:active,.ant-btn-background-ghost.ant-btn-dangerous.disabled:focus,.ant-btn-background-ghost.ant-btn-dangerous.disabled:hover,.ant-btn-background-ghost.ant-btn-dangerous[disabled],.ant-btn-background-ghost.ant-btn-dangerous[disabled].active,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous-disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous-disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous-disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous-disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous-disabled>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous-disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous-disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous-disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous-disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous-disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link{color:#ff4d4f;background-color:transparent;border-color:transparent;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover{color:#ff7875;background-color:transparent;border-color:transparent}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active{color:#d9363e;background-color:transparent;border-color:transparent}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled.active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:hover,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled.active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:hover,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled].active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link-disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-link{color:#1890ff;background-color:transparent;border-color:transparent;text-shadow:none;color:#fff}.ant-btn-background-ghost.ant-btn-link>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-link:focus,.ant-btn-background-ghost.ant-btn-link:hover{color:#40a9ff;background-color:transparent;border-color:transparent}.ant-btn-background-ghost.ant-btn-link:focus>a:only-child,.ant-btn-background-ghost.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-link:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-link.active,.ant-btn-background-ghost.ant-btn-link:active{color:#096dd9;background-color:transparent;border-color:transparent}.ant-btn-background-ghost.ant-btn-link.active>a:only-child,.ant-btn-background-ghost.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-link.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-link-disabled,.ant-btn-background-ghost.ant-btn-link-disabled.active,.ant-btn-background-ghost.ant-btn-link-disabled:active,.ant-btn-background-ghost.ant-btn-link-disabled:focus,.ant-btn-background-ghost.ant-btn-link-disabled:hover,.ant-btn-background-ghost.ant-btn-link.disabled,.ant-btn-background-ghost.ant-btn-link.disabled.active,.ant-btn-background-ghost.ant-btn-link.disabled:active,.ant-btn-background-ghost.ant-btn-link.disabled:focus,.ant-btn-background-ghost.ant-btn-link.disabled:hover,.ant-btn-background-ghost.ant-btn-link[disabled],.ant-btn-background-ghost.ant-btn-link[disabled].active,.ant-btn-background-ghost.ant-btn-link[disabled]:active,.ant-btn-background-ghost.ant-btn-link[disabled]:focus,.ant-btn-background-ghost.ant-btn-link[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-link-disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-link-disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-link-disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-link-disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-link-disabled>a:only-child,.ant-btn-background-ghost.ant-btn-link.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-link.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-link.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-link.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-link.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-link[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-link[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-link-disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link-disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link-disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-link-disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-link-disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-link.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-link.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-link.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-link[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-two-chinese-chars:first-letter{letter-spacing:.34em}.ant-btn-two-chinese-chars>:not(.anticon){margin-right:-.34em;letter-spacing:.34em}.ant-btn-block{width:100%}.ant-btn:empty{display:inline-block;width:0;visibility:hidden;content:"\a0"}a.ant-btn{padding-top:.1px;line-height:30px}a.ant-btn-lg{line-height:38px}a.ant-btn-sm{line-height:22px}.ant-btn-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-right-color:#40a9ff;border-left-color:#d9d9d9}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-right-color:#d9d9d9;border-left-color:#40a9ff}.ant-btn-rtl.ant-btn>.ant-btn-loading-icon .anticon{padding-right:0;padding-left:8px}.ant-btn>.ant-btn-loading-icon:only-child .anticon{padding-right:0;padding-left:0}.ant-btn-rtl.ant-btn>.anticon+span,.ant-btn-rtl.ant-btn>span+.anticon{margin-right:8px;margin-left:0}.ant-picker-calendar{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";background:#fff}.ant-picker-calendar-header{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;padding:12px 0}.ant-picker-calendar-header .ant-picker-calendar-year-select{min-width:80px}.ant-picker-calendar-header .ant-picker-calendar-month-select{min-width:70px;margin-left:8px}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{margin-left:8px}.ant-picker-calendar .ant-picker-panel{background:#fff;border:0;border-top:1px solid #f0f0f0;border-radius:0}.ant-picker-calendar .ant-picker-panel .ant-picker-date-panel,.ant-picker-calendar .ant-picker-panel .ant-picker-month-panel{width:auto}.ant-picker-calendar .ant-picker-panel .ant-picker-body{padding:8px 0}.ant-picker-calendar .ant-picker-panel .ant-picker-content{width:100%}.ant-picker-calendar-mini{border-radius:2px}.ant-picker-calendar-mini .ant-picker-calendar-header{padding-right:8px;padding-left:8px}.ant-picker-calendar-mini .ant-picker-panel{border-radius:0 0 2px 2px}.ant-picker-calendar-mini .ant-picker-content{height:256px}.ant-picker-calendar-mini .ant-picker-content th{height:auto;padding:0;line-height:18px}.ant-picker-calendar-full .ant-picker-panel{display:block;width:100%;text-align:right;background:#fff;border:0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body td,.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{height:auto;padding:0 12px 5px 0;line-height:18px}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:hover .ant-picker-calendar-date{background:#f5f5f5}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell .ant-picker-calendar-date-today:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today{background:#e6f7ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date .ant-picker-calendar-date-value{color:#1890ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{display:block;width:auto;height:auto;margin:0 4px;padding:4px 8px 0;border:0;border-top:2px solid #f0f0f0;border-radius:0;-webkit-transition:background .3s;transition:background .3s}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-value{line-height:24px;-webkit-transition:color .3s;transition:color .3s}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{position:static;width:auto;height:86px;overflow-y:auto;color:rgba(0,0,0,.65);line-height:1.5715;text-align:left}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today{border-color:#1890ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today .ant-picker-calendar-date-value{color:rgba(0,0,0,.65)}@media only screen and (max-width:480px){.ant-picker-calendar-header{display:block}.ant-picker-calendar-header .ant-picker-calendar-year-select{width:50%}.ant-picker-calendar-header .ant-picker-calendar-month-select{width:calc(50% - 8px)}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{width:100%;margin-top:8px;margin-left:0}.ant-picker-calendar-header .ant-picker-calendar-mode-switch>label{width:50%;text-align:center}}.ant-picker-calendar-rtl{direction:rtl}.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-mode-switch,.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-month-select{margin-right:8px;margin-left:0}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel{text-align:left}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0 0 5px 12px}.ant-radio-group{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset}.ant-radio-group .ant-badge-count{z-index:1}.ant-radio-group>.ant-badge:not(:first-child)>.ant-radio-button-wrapper{border-left:none}.ant-radio-wrapper{margin:0 8px 0 0}.ant-radio,.ant-radio-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;white-space:nowrap;cursor:pointer}.ant-radio{margin:0;top:0;line-height:1;vertical-align:sub;outline:none}.ant-radio-input:focus+.ant-radio-inner,.ant-radio-wrapper:hover .ant-radio,.ant-radio:hover .ant-radio-inner{border-color:#1890ff}.ant-radio-input:focus+.ant-radio-inner{-webkit-box-shadow:0 0 0 3px rgba(24,144,255,.08);box-shadow:0 0 0 3px rgba(24,144,255,.08)}.ant-radio-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #1890ff;border-radius:50%;visibility:hidden;-webkit-animation:antRadioEffect .36s ease-in-out;animation:antRadioEffect .36s ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both;content:""}.ant-radio-wrapper:hover .ant-radio:after,.ant-radio:hover:after{visibility:visible}.ant-radio-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;background-color:#fff;border:1px solid #d9d9d9;border-radius:100px;-webkit-transition:all .3s;transition:all .3s}.ant-radio-inner:after{position:absolute;top:3px;left:3px;display:table;width:8px;height:8px;background-color:#1890ff;border-top:0;border-left:0;border-radius:8px;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:all .3s cubic-bezier(.78,.14,.15,.86);transition:all .3s cubic-bezier(.78,.14,.15,.86);content:" "}.ant-radio-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;cursor:pointer;opacity:0}.ant-radio-checked .ant-radio-inner{border-color:#1890ff}.ant-radio-checked .ant-radio-inner:after{-webkit-transform:scale(1);transform:scale(1);opacity:1;-webkit-transition:all .3s cubic-bezier(.78,.14,.15,.86);transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-radio-disabled .ant-radio-inner{background-color:#f5f5f5;border-color:#d9d9d9!important;cursor:not-allowed}.ant-radio-disabled .ant-radio-inner:after{background-color:rgba(0,0,0,.2)}.ant-radio-disabled .ant-radio-input{cursor:not-allowed}.ant-radio-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}span.ant-radio+*{padding-right:8px;padding-left:8px}.ant-radio-button-wrapper{position:relative;display:inline-block;height:32px;margin:0;padding:0 15px;color:rgba(0,0,0,.65);line-height:30px;background:#fff;border-color:#d9d9d9;border-style:solid;border-width:1.02px 1px 1px 0;cursor:pointer;-webkit-transition:color .3s,background .3s,border-color .3s,-webkit-box-shadow .3s;transition:color .3s,background .3s,border-color .3s,-webkit-box-shadow .3s;transition:color .3s,background .3s,border-color .3s,box-shadow .3s;transition:color .3s,background .3s,border-color .3s,box-shadow .3s,-webkit-box-shadow .3s}.ant-radio-button-wrapper a{color:rgba(0,0,0,.65)}.ant-radio-button-wrapper>.ant-radio-button{display:block;width:0;height:0;margin-left:0}.ant-radio-group-large .ant-radio-button-wrapper{height:40px;font-size:16px;line-height:38px}.ant-radio-group-small .ant-radio-button-wrapper{height:24px;padding:0 7px;line-height:22px}.ant-radio-button-wrapper:not(:first-child):before{position:absolute;top:-1px;left:-1px;display:block;-webkit-box-sizing:content-box;box-sizing:content-box;width:1px;height:100%;padding:1px 0;background-color:#d9d9d9;-webkit-transition:background-color .3s;transition:background-color .3s;content:""}.ant-radio-button-wrapper:first-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px}.ant-radio-button-wrapper:last-child{border-radius:0 2px 2px 0}.ant-radio-button-wrapper:first-child:last-child{border-radius:2px}.ant-radio-button-wrapper:hover{position:relative;color:#1890ff}.ant-radio-button-wrapper:focus-within{-webkit-box-shadow:0 0 0 3px rgba(24,144,255,.08);box-shadow:0 0 0 3px rgba(24,144,255,.08)}.ant-radio-button-wrapper .ant-radio-inner,.ant-radio-button-wrapper input[type=checkbox],.ant-radio-button-wrapper input[type=radio]{width:0;height:0;opacity:0;pointer-events:none}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){z-index:1;color:#1890ff;background:#fff;border-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):before{background-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child{border-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{color:#40a9ff;border-color:#40a9ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover:before{background-color:#40a9ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{color:#096dd9;border-color:#096dd9}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active:before{background-color:#096dd9}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{-webkit-box-shadow:0 0 0 3px rgba(24,144,255,.08);box-shadow:0 0 0 3px rgba(24,144,255,.08)}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){color:#fff;background:#1890ff;border-color:#1890ff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{color:#fff;background:#40a9ff;border-color:#40a9ff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{color:#fff;background:#096dd9;border-color:#096dd9}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{-webkit-box-shadow:0 0 0 3px rgba(24,144,255,.08);box-shadow:0 0 0 3px rgba(24,144,255,.08)}.ant-radio-button-wrapper-disabled{cursor:not-allowed}.ant-radio-button-wrapper-disabled,.ant-radio-button-wrapper-disabled:first-child,.ant-radio-button-wrapper-disabled:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9}.ant-radio-button-wrapper-disabled:first-child{border-left-color:#d9d9d9}.ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked{color:#fff;background-color:#e6e6e6;border-color:#d9d9d9;-webkit-box-shadow:none;box-shadow:none}@-webkit-keyframes antRadioEffect{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.5}to{-webkit-transform:scale(1.6);transform:scale(1.6);opacity:0}}@keyframes antRadioEffect{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.5}to{-webkit-transform:scale(1.6);transform:scale(1.6);opacity:0}}@supports (-moz-appearance:meterbar) and (background-blend-mode:difference,normal){.ant-radio{vertical-align:text-bottom}}.ant-radio-group.ant-radio-group-rtl{direction:rtl}.ant-radio-wrapper.ant-radio-wrapper-rtl{margin-right:0;margin-left:8px;direction:rtl}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl{border-right-width:0;border-left-width:1px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:not(:first-child):before{right:-1px;left:0}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:first-child{border-right:1px solid #d9d9d9;border-radius:0 2px 2px 0}.ant-radio-button-wrapper-checked:not([class*=" ant-radio-button-wrapper-disabled"]).ant-radio-button-wrapper:first-child{border-right-color:#40a9ff}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:last-child{border-radius:2px 0 0 2px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper-disabled:first-child{border-right-color:#d9d9d9}.ant-picker-panel{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;text-align:center;background:#fff;border:1px solid #f0f0f0;border-radius:2px;outline:none}.ant-picker-panel-focused{border-color:#1890ff}.ant-picker-date-panel,.ant-picker-decade-panel,.ant-picker-month-panel,.ant-picker-quarter-panel,.ant-picker-time-panel,.ant-picker-week-panel,.ant-picker-year-panel{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:280px}.ant-picker-header{display:-ms-flexbox;display:flex;padding:0 8px;color:rgba(0,0,0,.85);border-bottom:1px solid #f0f0f0}.ant-picker-header>*{-ms-flex:none;flex:none}.ant-picker-header button{padding:0;color:rgba(0,0,0,.25);line-height:40px;background:transparent;border:0;cursor:pointer;-webkit-transition:color .3s;transition:color .3s}.ant-picker-header>button{min-width:1.6em;font-size:14px}.ant-picker-header>button:hover{color:rgba(0,0,0,.65)}.ant-picker-header-view{-ms-flex:auto;flex:auto;font-weight:500;line-height:40px}.ant-picker-header-view button{color:inherit;font-weight:inherit}.ant-picker-header-view button:not(:first-child){margin-left:8px}.ant-picker-header-view button:hover{color:#1890ff}.ant-picker-next-icon,.ant-picker-prev-icon,.ant-picker-super-next-icon,.ant-picker-super-prev-icon{position:relative;display:inline-block;width:7px;height:7px}.ant-picker-next-icon:before,.ant-picker-prev-icon:before,.ant-picker-super-next-icon:before,.ant-picker-super-prev-icon:before{position:absolute;top:0;left:0;display:inline-block;width:7px;height:7px;border:0 solid;border-width:1.5px 0 0 1.5px;content:""}.ant-picker-super-next-icon:after,.ant-picker-super-prev-icon:after{position:absolute;top:4px;left:4px;display:inline-block;width:7px;height:7px;border:0 solid;border-width:1.5px 0 0 1.5px;content:""}.ant-picker-prev-icon,.ant-picker-super-prev-icon{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.ant-picker-next-icon,.ant-picker-super-next-icon{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ant-picker-content{width:100%;table-layout:fixed;border-collapse:collapse}.ant-picker-content td,.ant-picker-content th{position:relative;min-width:24px;font-weight:400}.ant-picker-content th{height:30px;color:rgba(0,0,0,.65);line-height:30px}.ant-picker-cell{padding:3px 0;color:rgba(0,0,0,.25);cursor:pointer}.ant-picker-cell-in-view{color:rgba(0,0,0,.65)}.ant-picker-cell-disabled{cursor:not-allowed}.ant-picker-cell:before{position:absolute;top:50%;right:0;left:0;z-index:1;height:24px;-webkit-transform:translateY(-50%);transform:translateY(-50%);content:""}.ant-picker-cell:hover:not(.ant-picker-cell-in-view) .ant-picker-cell-inner,.ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end) .ant-picker-cell-inner{background:#f5f5f5}.ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner:before{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;border:1px solid #1890ff;border-radius:2px;content:""}.ant-picker-cell-in-view.ant-picker-cell-in-range{position:relative}.ant-picker-cell-in-view.ant-picker-cell-in-range:before{background:#e6f7ff}.ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner{color:#fff;background:#1890ff}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):before{background:#e6f7ff}.ant-picker-cell-in-view.ant-picker-cell-range-start:before{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-end:before{right:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-end-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-in-range):after{position:absolute;top:50%;z-index:0;height:24px;border-top:1px dashed #7ec1ff;border-bottom:1px dashed #7ec1ff;-webkit-transform:translateY(-50%);transform:translateY(-50%);content:""}.ant-picker-cell-range-hover-end:after,.ant-picker-cell-range-hover-start:after,.ant-picker-cell-range-hover:after{right:0;left:2px}.ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single).ant-picker-cell-range-hover-end:before,.ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single).ant-picker-cell-range-hover-start:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start:before{background:#cbe6ff}.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after,.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{position:absolute;top:0;bottom:0;z-index:-1;background:#cbe6ff;content:""}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{right:-7px;left:0}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{right:0;left:-7px}.ant-picker-cell-range-hover.ant-picker-cell-range-start:after{right:50%}.ant-picker-cell-range-hover.ant-picker-cell-range-end:after{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:first-child:after{left:6px;border-left:1px dashed #7ec1ff;border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:last-child:after{right:6px;border-right:1px dashed #7ec1ff;border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-picker-cell-disabled{pointer-events:none}.ant-picker-cell-disabled .ant-picker-cell-inner{color:rgba(0,0,0,.25);background:transparent}.ant-picker-cell-disabled:before{background:#f5f5f5}.ant-picker-cell-disabled.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:rgba(0,0,0,.25)}.ant-picker-decade-panel .ant-picker-content,.ant-picker-month-panel .ant-picker-content,.ant-picker-quarter-panel .ant-picker-content,.ant-picker-year-panel .ant-picker-content{height:264px}.ant-picker-decade-panel .ant-picker-cell-inner,.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{padding:0 8px}.ant-picker-decade-panel .ant-picker-cell-disabled .ant-picker-cell-inner,.ant-picker-month-panel .ant-picker-cell-disabled .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-disabled .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-disabled .ant-picker-cell-inner{background:#f5f5f5}.ant-picker-quarter-panel .ant-picker-content{height:56px}.ant-picker-footer{width:-webkit-min-content;width:-moz-min-content;width:min-content;min-width:100%;line-height:38px;text-align:center;border-bottom:1px solid transparent}.ant-picker-panel .ant-picker-footer{border-top:1px solid #f0f0f0}.ant-picker-footer-extra{padding:0 12px;line-height:38px;text-align:left}.ant-picker-footer-extra:not(:last-child){border-bottom:1px solid #f0f0f0}.ant-picker-now{text-align:left}.ant-picker-today-btn{color:#1890ff}.ant-picker-today-btn:hover{color:#40a9ff}.ant-picker-today-btn:active{color:#096dd9}.ant-picker-today-btn.ant-picker-today-btn-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-picker-decade-panel .ant-picker-cell-inner{padding:0 4px}.ant-picker-decade-panel .ant-picker-cell:before{display:none}.ant-picker-month-panel .ant-picker-body,.ant-picker-quarter-panel .ant-picker-body,.ant-picker-year-panel .ant-picker-body{padding:0 8px}.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{width:60px}.ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-year-panel .ant-picker-cell-range-hover-start:after{left:14px;border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px}.ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-year-panel .ant-picker-cell-range-hover-end:after{right:14px;border-right:1px dashed #7ec1ff;border-radius:0 2px 2px 0}.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-end:after{left:14px;border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px}.ant-picker-week-panel .ant-picker-body{padding:8px 12px}.ant-picker-week-panel .ant-picker-cell-selected .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell:hover .ant-picker-cell-inner{background:transparent!important}.ant-picker-week-panel-row td{-webkit-transition:background .3s;transition:background .3s}.ant-picker-week-panel-row:hover td{background:#f5f5f5}.ant-picker-week-panel-row-selected:hover td,.ant-picker-week-panel-row-selected td{background:#1890ff}.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-week,.ant-picker-week-panel-row-selected td.ant-picker-cell-week{color:hsla(0,0%,100%,.5)}.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-today .ant-picker-cell-inner:before,.ant-picker-week-panel-row-selected td.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:#fff}.ant-picker-week-panel-row-selected:hover td .ant-picker-cell-inner,.ant-picker-week-panel-row-selected td .ant-picker-cell-inner{color:#fff}.ant-picker-date-panel .ant-picker-body{padding:8px 12px}.ant-picker-date-panel .ant-picker-content{width:252px}.ant-picker-date-panel .ant-picker-content th{width:36px}.ant-picker-datetime-panel{display:-ms-flexbox;display:flex}.ant-picker-datetime-panel .ant-picker-time-panel{border-left:1px solid #f0f0f0}.ant-picker-datetime-panel .ant-picker-date-panel,.ant-picker-datetime-panel .ant-picker-time-panel{-webkit-transition:opacity .3s;transition:opacity .3s}.ant-picker-datetime-panel-active .ant-picker-date-panel,.ant-picker-datetime-panel-active .ant-picker-time-panel{opacity:.3}.ant-picker-datetime-panel-active .ant-picker-date-panel-active,.ant-picker-datetime-panel-active .ant-picker-time-panel-active{opacity:1}.ant-picker-time-panel{width:auto;min-width:auto}.ant-picker-time-panel .ant-picker-content{display:-ms-flexbox;display:flex;-ms-flex:auto;flex:auto;height:224px}.ant-picker-time-panel-column{-ms-flex:1 0 auto;flex:1 0 auto;width:56px;margin:0;padding:0 0 194px;overflow-y:hidden;text-align:left;list-style:none;-webkit-transition:background .3s;transition:background .3s}.ant-picker-time-panel-column:not(:first-child){border-left:1px solid #f0f0f0}.ant-picker-time-panel-column-active{background:rgba(230,247,255,.2)}.ant-picker-time-panel-column:hover{overflow-y:auto}.ant-picker-time-panel-column>li{margin:0;padding:0}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner{display:block;width:100%;height:28px;margin:0;padding:0;color:rgba(0,0,0,.65);line-height:28px;text-align:center;border-radius:0;cursor:pointer;-webkit-transition:background .3s;transition:background .3s}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner:hover{background:#f5f5f5}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner{background:#e6f7ff}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-disabled .ant-picker-time-panel-cell-inner{color:rgba(0,0,0,.25);background:transparent;cursor:not-allowed}:root .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,:root .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell{padding:21px 0}.ant-picker{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";padding:4px 11px;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:border .3s,-webkit-box-shadow .3s;transition:border .3s,-webkit-box-shadow .3s;transition:border .3s,box-shadow .3s;transition:border .3s,box-shadow .3s,-webkit-box-shadow .3s}.ant-picker-focused,.ant-picker:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-picker-focused{outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-picker.ant-picker-disabled{background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-picker.ant-picker-disabled .ant-picker-suffix{color:rgba(0,0,0,.25)}.ant-picker.ant-picker-borderless{background-color:transparent!important;border-color:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}.ant-picker-input{position:relative;display:-ms-inline-flexbox;display:inline-flex;width:100%}.ant-picker-input>input{position:relative;display:inline-block;width:100%;min-width:0;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715;background-color:#fff;background-image:none;border-radius:2px;-webkit-transition:all .3s;transition:all .3s;-ms-flex:auto;flex:auto;min-width:1px;height:auto;padding:0;background:transparent;border:0}.ant-picker-input>input::-moz-placeholder{opacity:1}.ant-picker-input>input::-webkit-input-placeholder{color:#bfbfbf}.ant-picker-input>input:-ms-input-placeholder{color:#bfbfbf}.ant-picker-input>input::-ms-input-placeholder{color:#bfbfbf}.ant-picker-input>input::placeholder{color:#bfbfbf}.ant-picker-input>input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:-ms-input-placeholder{text-overflow:ellipsis}.ant-picker-input>input:placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-picker-input>input-focused,.ant-picker-input>input:focus{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-picker-input>input-disabled{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-picker-input>input-disabled:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-picker-input>input[disabled]{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-picker-input>input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px!important}textarea.ant-picker-input>input{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;-webkit-transition:all .3s,height 0s;transition:all .3s,height 0s}.ant-picker-input>input-lg{padding:6.5px 11px;font-size:16px}.ant-picker-input>input-sm{padding:0 7px}.ant-picker-input>input:focus{-webkit-box-shadow:none;box-shadow:none}.ant-picker-input>input[disabled]{background:transparent}.ant-picker-input:hover .ant-picker-clear{opacity:1}.ant-picker-large{padding:6.5px 11px}.ant-picker-large .ant-picker-input>input{font-size:16px}.ant-picker-small{padding:0 7px}.ant-picker-suffix{-ms-flex-item-align:center;align-self:center;margin-left:4px;color:rgba(0,0,0,.25);pointer-events:none}.ant-picker-clear{position:absolute;top:50%;right:0;color:rgba(0,0,0,.25);background:#fff;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;opacity:0;-webkit-transition:opacity .3s,color .3s;transition:opacity .3s,color .3s}.ant-picker-clear:hover{color:rgba(0,0,0,.45)}.ant-picker-separator{position:relative;display:inline-block;width:1em;height:16px;color:rgba(0,0,0,.25);font-size:16px;vertical-align:top;cursor:default}.ant-picker-focused .ant-picker-separator{color:rgba(0,0,0,.45)}.ant-picker-disabled .ant-picker-range-separator .ant-picker-separator{cursor:not-allowed}.ant-picker-range{position:relative;display:-ms-inline-flexbox;display:inline-flex}.ant-picker-range .ant-picker-clear{right:11px}.ant-picker-range:hover .ant-picker-clear{opacity:1}.ant-picker-range .ant-picker-active-bar{bottom:-1px;height:2px;margin-left:11px;background:#1890ff;opacity:0;-webkit-transition:all .3s ease-out;transition:all .3s ease-out;pointer-events:none}.ant-picker-range.ant-picker-focused .ant-picker-active-bar{opacity:1}.ant-picker-range-separator{-ms-flex-align:center;align-items:center;padding:0 8px;line-height:1}.ant-picker-dropdown{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:absolute;z-index:1050}.ant-picker-dropdown-hidden{display:none}.ant-picker-dropdown-placement-bottomLeft .ant-picker-range-arrow{top:1.66666667px;display:block;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.ant-picker-dropdown-placement-topLeft .ant-picker-range-arrow{bottom:1.66666667px;display:block;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ant-picker-dropdown-range{padding:6.66666667px 0}.ant-picker-dropdown-range-hidden{display:none}.ant-picker-dropdown .ant-picker-panel>.ant-picker-time-panel{padding-top:4px}.ant-picker-ranges{margin-bottom:0;padding:4px 12px;overflow:hidden;line-height:34px;text-align:left;list-style:none}.ant-picker-ranges>li{display:inline-block}.ant-picker-ranges .ant-picker-preset>.ant-tag-blue{color:#1890ff;background:#e6f7ff;border-color:#91d5ff;cursor:pointer}.ant-picker-ranges .ant-picker-ok{float:right;margin-left:8px}.ant-picker-range-wrapper{display:-ms-flexbox;display:flex}.ant-picker-range-arrow{position:absolute;z-index:1;display:none;width:10px;height:10px;margin-left:16.5px;-webkit-box-shadow:2px -2px 6px rgba(0,0,0,.06);box-shadow:2px -2px 6px rgba(0,0,0,.06);-webkit-transition:left .3s ease-out;transition:left .3s ease-out}.ant-picker-range-arrow:after{position:absolute;top:1px;right:1px;width:10px;height:10px;border-color:#fff #fff transparent transparent;border-style:solid;border-width:5px;content:""}.ant-picker-panel-container{overflow:hidden;vertical-align:top;background:#fff;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);-webkit-transition:margin .3s;transition:margin .3s}.ant-picker-panel-container .ant-picker-panels{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;direction:ltr}.ant-picker-panel-container .ant-picker-panel{vertical-align:top;background:transparent;border-width:0 0 1px;border-radius:0}.ant-picker-panel-container .ant-picker-panel-focused{border-color:#f0f0f0}.ant-picker-rtl{direction:rtl}.ant-picker-rtl .ant-picker-suffix{margin-right:4px;margin-left:0}.ant-picker-rtl .ant-picker-clear{right:auto;left:0}.ant-picker-rtl .ant-picker-separator{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.ant-picker-panel-rtl .ant-picker-header-view button:not(:first-child){margin-right:8px;margin-left:0}.ant-picker-rtl.ant-picker-range .ant-picker-clear{right:auto;left:11px}.ant-picker-rtl.ant-picker-range .ant-picker-active-bar{margin-right:11px;margin-left:0}.ant-picker-dropdown-rtl .ant-picker-ranges{text-align:right}.ant-picker-dropdown-rtl .ant-picker-ranges .ant-picker-ok{float:left;margin-right:8px;margin-left:0}.ant-picker-panel-rtl{direction:rtl}.ant-picker-panel-rtl .ant-picker-prev-icon,.ant-picker-panel-rtl .ant-picker-super-prev-icon{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ant-picker-panel-rtl .ant-picker-next-icon,.ant-picker-panel-rtl .ant-picker-super-next-icon{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.ant-picker-cell .ant-picker-cell-inner{position:relative;z-index:2;display:inline-block;min-width:24px;height:24px;line-height:24px;border-radius:2px;-webkit-transition:background .3s,border .3s;transition:background .3s,border .3s}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:before{right:50%;left:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:before{right:0;left:50%}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{right:0;left:-7px}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{right:-7px;left:0}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-start:after{right:0;left:50%}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-end:after{right:50%;left:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:first-child:after{right:6px;left:0;border-right:1px dashed #7ec1ff;border-left:none;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:last-child:after{right:0;left:6px;border-right:none;border-left:1px dashed #7ec1ff;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after{right:6px;border-right:1px dashed #7ec1ff;border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after{left:6px;border-left:1px dashed #7ec1ff;border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-picker-panel-rtl .ant-picker-time-panel{direction:ltr}.ant-tag{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block;height:auto;margin:0 8px 0 0;padding:0 7px;font-size:12px;line-height:20px;white-space:nowrap;background:#fafafa;border:1px solid #d9d9d9;border-radius:2px;cursor:default;opacity:1;-webkit-transition:all .3s cubic-bezier(.78,.14,.15,.86);transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-tag:hover{opacity:.85}.ant-tag,.ant-tag a,.ant-tag a:hover{color:rgba(0,0,0,.65)}.ant-tag>a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ant-tag .anticon-close{display:inline-block;font-size:10px;margin-left:3px;color:rgba(0,0,0,.45);font-weight:700;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.78,.14,.15,.86);transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-tag .anticon-close:hover{color:rgba(0,0,0,.85)}.ant-tag-has-color{border-color:transparent}.ant-tag-has-color,.ant-tag-has-color .anticon-close,.ant-tag-has-color .anticon-close:hover,.ant-tag-has-color a,.ant-tag-has-color a:hover{color:#fff}.ant-tag-checkable{background-color:transparent;border-color:transparent;cursor:pointer}.ant-tag-checkable:not(.ant-tag-checkable-checked):hover{color:#1890ff}.ant-tag-checkable-checked,.ant-tag-checkable:active{color:#fff}.ant-tag-checkable-checked{background-color:#1890ff}.ant-tag-checkable:active{background-color:#096dd9}.ant-tag-hidden{display:none}.ant-tag-pink{color:#eb2f96;background:#fff0f6;border-color:#ffadd2}.ant-tag-pink-inverse{color:#fff;background:#eb2f96;border-color:#eb2f96}.ant-tag-magenta{color:#eb2f96;background:#fff0f6;border-color:#ffadd2}.ant-tag-magenta-inverse{color:#fff;background:#eb2f96;border-color:#eb2f96}.ant-tag-red{color:#f5222d;background:#fff1f0;border-color:#ffa39e}.ant-tag-red-inverse{color:#fff;background:#f5222d;border-color:#f5222d}.ant-tag-volcano{color:#fa541c;background:#fff2e8;border-color:#ffbb96}.ant-tag-volcano-inverse{color:#fff;background:#fa541c;border-color:#fa541c}.ant-tag-orange{color:#fa8c16;background:#fff7e6;border-color:#ffd591}.ant-tag-orange-inverse{color:#fff;background:#fa8c16;border-color:#fa8c16}.ant-tag-yellow{color:#fadb14;background:#feffe6;border-color:#fffb8f}.ant-tag-yellow-inverse{color:#fff;background:#fadb14;border-color:#fadb14}.ant-tag-gold{color:#faad14;background:#fffbe6;border-color:#ffe58f}.ant-tag-gold-inverse{color:#fff;background:#faad14;border-color:#faad14}.ant-tag-cyan{color:#13c2c2;background:#e6fffb;border-color:#87e8de}.ant-tag-cyan-inverse{color:#fff;background:#13c2c2;border-color:#13c2c2}.ant-tag-lime{color:#a0d911;background:#fcffe6;border-color:#eaff8f}.ant-tag-lime-inverse{color:#fff;background:#a0d911;border-color:#a0d911}.ant-tag-green{color:#52c41a;background:#f6ffed;border-color:#b7eb8f}.ant-tag-green-inverse{color:#fff;background:#52c41a;border-color:#52c41a}.ant-tag-blue{color:#1890ff;background:#e6f7ff;border-color:#91d5ff}.ant-tag-blue-inverse{color:#fff;background:#1890ff;border-color:#1890ff}.ant-tag-geekblue{color:#2f54eb;background:#f0f5ff;border-color:#adc6ff}.ant-tag-geekblue-inverse{color:#fff;background:#2f54eb;border-color:#2f54eb}.ant-tag-purple{color:#722ed1;background:#f9f0ff;border-color:#d3adf7}.ant-tag-purple-inverse{color:#fff;background:#722ed1;border-color:#722ed1}.ant-tag-success{color:#52c41a;background:#f6ffed;border-color:#b7eb8f}.ant-tag-processing{color:#1890ff;background:#e6f7ff;border-color:#91d5ff}.ant-tag-error{color:#f5222d;background:#fff1f0;border-color:#ffa39e}.ant-tag-warning{color:#fa8c16;background:#fff7e6;border-color:#ffd591}.ant-tag>.anticon+span,.ant-tag>span+.anticon{margin-left:7px}.ant-tag-rtl{margin-right:0;margin-left:8px;direction:rtl;text-align:right}.ant-tag-rtl.ant-tag .anticon-close{margin-right:3px;margin-left:0}.ant-tag-rtl.ant-tag>.anticon+span,.ant-tag-rtl.ant-tag>span+.anticon{margin-right:7px;margin-left:0}.ant-card{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;background:#fff;border-radius:2px}.ant-card-rtl{direction:rtl}.ant-card-hoverable{cursor:pointer;-webkit-transition:border-color .3s,-webkit-box-shadow .3s;transition:border-color .3s,-webkit-box-shadow .3s;transition:box-shadow .3s,border-color .3s;transition:box-shadow .3s,border-color .3s,-webkit-box-shadow .3s}.ant-card-hoverable:hover{border-color:transparent;-webkit-box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09);box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09)}.ant-card-bordered{border:1px solid #f0f0f0}.ant-card-head{min-height:48px;margin-bottom:-1px;padding:0 24px;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;background:transparent;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0}.ant-card-head:after,.ant-card-head:before{display:table;content:""}.ant-card-head:after{clear:both}.ant-card-head-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ant-card-head-title{display:inline-block;-ms-flex:1;flex:1 1;padding:16px 0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-card-head .ant-tabs{clear:both;margin-bottom:-17px;color:rgba(0,0,0,.65);font-weight:400;font-size:14px}.ant-card-head .ant-tabs-bar{border-bottom:1px solid #f0f0f0}.ant-card-extra{float:right;margin-left:auto;padding:16px 0;color:rgba(0,0,0,.65);font-weight:400;font-size:14px}.ant-card-rtl .ant-card-extra{margin-right:auto;margin-left:0}.ant-card-body{padding:24px}.ant-card-body:after,.ant-card-body:before{display:table;content:""}.ant-card-body:after{clear:both}.ant-card-contain-grid:not(.ant-card-loading) .ant-card-body{margin:-1px 0 0 -1px;padding:0}.ant-card-grid{float:left;width:33.33%;padding:24px;border:0;border-radius:0;-webkit-box-shadow:1px 0 0 0 #f0f0f0,0 1px 0 0 #f0f0f0,1px 1px 0 0 #f0f0f0,1px 0 0 0 #f0f0f0 inset,0 1px 0 0 #f0f0f0 inset;box-shadow:1px 0 0 0 #f0f0f0,0 1px 0 0 #f0f0f0,1px 1px 0 0 #f0f0f0,inset 1px 0 0 0 #f0f0f0,inset 0 1px 0 0 #f0f0f0;-webkit-transition:all .3s;transition:all .3s}.ant-card-rtl .ant-card-grid{float:right}.ant-card-grid-hoverable:hover{position:relative;z-index:1;-webkit-box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09);box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09)}.ant-card-contain-tabs>.ant-card-head .ant-card-head-title{min-height:32px;padding-bottom:0}.ant-card-contain-tabs>.ant-card-head .ant-card-extra{padding-bottom:0}.ant-card-cover{margin-right:-1px;margin-left:-1px}.ant-card-cover>*{display:block;width:100%}.ant-card-cover img{border-radius:2px 2px 0 0}.ant-card-actions{margin:0;padding:0;list-style:none;background:#fafafa;border-top:1px solid #f0f0f0}.ant-card-actions:after,.ant-card-actions:before{display:table;content:""}.ant-card-actions:after{clear:both}.ant-card-actions>li{float:left;margin:12px 0;color:rgba(0,0,0,.45);text-align:center}.ant-card-rtl .ant-card-actions>li{float:right}.ant-card-actions>li>span{position:relative;display:block;min-width:32px;font-size:14px;line-height:1.5715;cursor:pointer}.ant-card-actions>li>span:hover{color:#1890ff;-webkit-transition:color .3s;transition:color .3s}.ant-card-actions>li>span>.anticon,.ant-card-actions>li>span a:not(.ant-btn){display:inline-block;width:100%;color:rgba(0,0,0,.45);line-height:22px;-webkit-transition:color .3s;transition:color .3s}.ant-card-actions>li>span>.anticon:hover,.ant-card-actions>li>span a:not(.ant-btn):hover{color:#1890ff}.ant-card-actions>li>span>.anticon{font-size:16px;line-height:22px}.ant-card-actions>li:not(:last-child){border-right:1px solid #f0f0f0}.ant-card-type-inner .ant-card-head{padding:0 24px;background:#fafafa}.ant-card-type-inner .ant-card-head-title{padding:12px 0;font-size:14px}.ant-card-type-inner .ant-card-body{padding:16px 24px}.ant-card-type-inner .ant-card-extra{padding:13.5px 0}.ant-card-meta{margin:-4px 0}.ant-card-meta:after,.ant-card-meta:before{display:table;content:""}.ant-card-meta:after{clear:both}.ant-card-meta-avatar{float:left;padding-right:16px}.ant-card-rtl .ant-card-meta-avatar{float:right;padding-right:0;padding-left:16px}.ant-card-meta-detail{overflow:hidden}.ant-card-meta-detail>div:not(:last-child){margin-bottom:8px}.ant-card-meta-title{overflow:hidden;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;white-space:nowrap;text-overflow:ellipsis}.ant-card-meta-description{color:rgba(0,0,0,.45)}.ant-card-loading{overflow:hidden}.ant-card-loading .ant-card-body{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-card-loading-content p{margin:0}.ant-card-loading-block{height:14px;margin:4px 0;background:-webkit-gradient(linear,left top,right top,from(rgba(207,216,220,.2)),color-stop(rgba(207,216,220,.4)),to(rgba(207,216,220,.2)));background:linear-gradient(90deg,rgba(207,216,220,.2),rgba(207,216,220,.4),rgba(207,216,220,.2));background-size:600% 600%;border-radius:2px;-webkit-animation:card-loading 1.4s ease infinite;animation:card-loading 1.4s ease infinite}@-webkit-keyframes card-loading{0%,to{background-position:0 50%}50%{background-position:100% 50%}}@keyframes card-loading{0%,to{background-position:0 50%}50%{background-position:100% 50%}}.ant-card-small>.ant-card-head{min-height:36px;padding:0 12px;font-size:14px}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-head-title{padding:8px 0}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-extra{padding:8px 0;font-size:14px}.ant-card-small>.ant-card-body{padding:12px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-ink-bar{visibility:hidden}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{margin:0 2px 0 0;padding:8px 16px;line-height:22px;background:#fafafa;border:1px solid #f0f0f0;border-radius:2px 2px 0 0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{color:#1890ff;background:#fff;border-color:#f0f0f0;border-bottom:1px solid #fff}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active:before{border-top:2px solid transparent}.ant-tabs.ant-tabs-small .ant-tabs-card-bar .ant-tabs-tab{padding:6px 16px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-disabled{color:rgba(0,0,0,.25)}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-inactive{padding:0}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-wrap{margin-bottom:0}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x{width:16px;height:14px;margin-right:-5px;margin-left:3px;overflow:hidden;color:rgba(0,0,0,.45);font-size:12px;vertical-align:middle;-webkit-transition:all .3s;transition:all .3s}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x:hover{color:rgba(0,0,0,.85)}.ant-tabs.ant-tabs-card .ant-tabs-card-content>.ant-tabs-tabpane,.ant-tabs.ant-tabs-editable-card .ant-tabs-card-content>.ant-tabs-tabpane{-webkit-transition:none!important;transition:none!important}.ant-tabs.ant-tabs-card .ant-tabs-card-content>.ant-tabs-tabpane-inactive,.ant-tabs.ant-tabs-editable-card .ant-tabs-card-content>.ant-tabs-tabpane-inactive{overflow:hidden}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab:hover .anticon-close{opacity:1}.ant-tabs-extra-content{line-height:46.001px}.ant-tabs-extra-content .ant-tabs-new-tab{position:relative;width:20px;height:20px;color:rgba(0,0,0,.65);font-size:12px;line-height:20px;text-align:center;border:1px solid #f0f0f0;border-radius:2px;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-tabs-extra-content .ant-tabs-new-tab:hover{color:#1890ff;border-color:#1890ff}.ant-tabs-extra-content .ant-tabs-new-tab svg{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto}.ant-tabs.ant-tabs-large .ant-tabs-extra-content{line-height:57.144px}.ant-tabs.ant-tabs-small .ant-tabs-extra-content{line-height:38.001px}.ant-tabs.ant-tabs-card .ant-tabs-extra-content{line-height:40px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-nav-container{height:100%}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab{margin-bottom:12px;border-bottom:1px solid #f0f0f0}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab-active,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab-active{padding-bottom:4px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab:last-child,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab:last-child{margin-bottom:12px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-new-tab,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-new-tab{width:90%}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-nav-wrap{margin-right:0}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab{margin-right:1px;border-right:0;border-radius:2px 0 0 2px}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab-active{margin-right:-1px;padding-right:18px}.ant-tabs-vertical.ant-tabs-card.ant-tabs-right .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-nav-wrap{margin-left:0}.ant-tabs-vertical.ant-tabs-card.ant-tabs-right .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab{margin-left:1px;border-left:0;border-radius:0 2px 2px 0}.ant-tabs-vertical.ant-tabs-card.ant-tabs-right .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab-active{margin-left:-1px;padding-left:18px}.ant-tabs .ant-tabs-card-bar.ant-tabs-bottom-bar .ant-tabs-tab{height:auto;border-top-color:#f0f0f0;border-bottom:1px solid #f0f0f0;border-radius:0 0 2px 2px}.ant-tabs .ant-tabs-card-bar.ant-tabs-bottom-bar .ant-tabs-tab-active{color:#1890ff;border-top-color:#fff}.ant-tabs{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;overflow:hidden}.ant-tabs:after,.ant-tabs:before{display:table;content:""}.ant-tabs:after{clear:both}.ant-tabs-ink-bar{position:absolute;bottom:1px;left:0;z-index:1;-webkit-box-sizing:border-box;box-sizing:border-box;width:0;height:2px;background-color:#1890ff;-webkit-transform-origin:0 0;transform-origin:0 0}.ant-tabs-bar{margin:0 0 16px;border-bottom:1px solid #f0f0f0;outline:none}.ant-tabs-bar,.ant-tabs-nav-container{-webkit-transition:padding .3s cubic-bezier(.645,.045,.355,1);transition:padding .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-nav-container{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:-1px;overflow:hidden;font-size:14px;line-height:1.5715;white-space:nowrap}.ant-tabs-nav-container:before{display:table;content:""}.ant-tabs-nav-container:after{display:table;clear:both;content:""}.ant-tabs-nav-container-scrolling{padding-right:32px;padding-left:32px}.ant-tabs-bottom .ant-tabs-bottom-bar{margin-top:16px;margin-bottom:0;border-top:1px solid #f0f0f0;border-bottom:none}.ant-tabs-bottom .ant-tabs-bottom-bar .ant-tabs-ink-bar{top:1px;bottom:auto}.ant-tabs-bottom .ant-tabs-bottom-bar .ant-tabs-nav-container{margin-top:-1px;margin-bottom:0}.ant-tabs-tab-next,.ant-tabs-tab-prev{position:absolute;z-index:2;width:0;height:100%;color:rgba(0,0,0,.45);text-align:center;background-color:transparent;border:0;cursor:pointer;opacity:0;-webkit-transition:width .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);transition:width .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.ant-tabs-tab-next.ant-tabs-tab-arrow-show,.ant-tabs-tab-prev.ant-tabs-tab-arrow-show{width:32px;height:100%;opacity:1;pointer-events:auto}.ant-tabs-tab-next:hover,.ant-tabs-tab-prev:hover{color:rgba(0,0,0,.65)}.ant-tabs-tab-next-icon,.ant-tabs-tab-prev-icon{position:absolute;top:50%;left:50%;font-weight:700;font-style:normal;-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;line-height:inherit;text-align:center;text-transform:none;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-tabs-tab-next-icon-target,.ant-tabs-tab-prev-icon-target{display:block;display:inline-block;font-size:10px}.ant-tabs-tab-btn-disabled{cursor:not-allowed}.ant-tabs-tab-btn-disabled,.ant-tabs-tab-btn-disabled:hover{color:rgba(0,0,0,.25)}.ant-tabs-tab-next{right:2px}.ant-tabs-tab-prev{left:0}:root .ant-tabs-tab-prev{-webkit-filter:none;filter:none}.ant-tabs-nav-wrap{margin-bottom:-1px;overflow:hidden}.ant-tabs-nav-scroll{overflow:hidden;white-space:nowrap}.ant-tabs-nav{position:relative;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding-left:0;list-style:none;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-nav:after,.ant-tabs-nav:before{display:table;content:" "}.ant-tabs-nav:after{clear:both}.ant-tabs-nav .ant-tabs-tab{position:relative;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;margin:0 32px 0 0;padding:12px 0;text-decoration:none;cursor:pointer;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-nav .ant-tabs-tab:before{position:absolute;top:-1px;left:0;width:100%;border-top:2px solid transparent;border-radius:2px 2px 0 0;-webkit-transition:all .3s;transition:all .3s;content:"";pointer-events:none}.ant-tabs-nav .ant-tabs-tab:last-child{margin-right:0}.ant-tabs-nav .ant-tabs-tab:hover{color:#40a9ff}.ant-tabs-nav .ant-tabs-tab:active{color:#096dd9}.ant-tabs-nav .ant-tabs-tab .anticon{margin-right:12px}.ant-tabs-nav .ant-tabs-tab-active{color:#1890ff;font-weight:500;outline:none}.ant-tabs-nav .ant-tabs-tab-disabled,.ant-tabs-nav .ant-tabs-tab-disabled:hover{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tabs .ant-tabs-large-bar .ant-tabs-nav-container{font-size:16px}.ant-tabs .ant-tabs-large-bar .ant-tabs-tab{padding:16px 0}.ant-tabs .ant-tabs-small-bar .ant-tabs-nav-container{font-size:14px}.ant-tabs .ant-tabs-small-bar .ant-tabs-tab{padding:8px 0}.ant-tabs-content:before{display:block;overflow:hidden;content:""}.ant-tabs .ant-tabs-tabpane{outline:none}.ant-tabs .ant-tabs-bottom-content,.ant-tabs .ant-tabs-top-content{width:100%}.ant-tabs .ant-tabs-bottom-content>.ant-tabs-tabpane,.ant-tabs .ant-tabs-top-content>.ant-tabs-tabpane{-ms-flex-negative:0;flex-shrink:0;width:100%;-webkit-backface-visibility:hidden;opacity:1;-webkit-transition:opacity .45s;transition:opacity .45s}.ant-tabs .ant-tabs-bottom-content>.ant-tabs-tabpane-inactive,.ant-tabs .ant-tabs-top-content>.ant-tabs-tabpane-inactive{height:0;padding:0!important;overflow:hidden;opacity:0;pointer-events:none}.ant-tabs .ant-tabs-bottom-content>.ant-tabs-tabpane-inactive input,.ant-tabs .ant-tabs-top-content>.ant-tabs-tabpane-inactive input{visibility:hidden}.ant-tabs .ant-tabs-bottom-content.ant-tabs-content-animated,.ant-tabs .ant-tabs-top-content.ant-tabs-content-animated{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-webkit-transition:margin-left .3s cubic-bezier(.645,.045,.355,1);transition:margin-left .3s cubic-bezier(.645,.045,.355,1);will-change:margin-left}.ant-tabs .ant-tabs-left-bar,.ant-tabs .ant-tabs-right-bar{height:100%;border-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab-arrow-show,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab-arrow-show{width:100%;height:32px}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab{display:block;float:none;margin:0 0 16px;padding:8px 24px;text-align:center}.ant-tabs .ant-tabs-left-bar .ant-tabs-extra-content,.ant-tabs .ant-tabs-right-bar .ant-tabs-extra-content{text-align:center}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-scroll,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-scroll{width:auto}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-wrap,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-wrap{height:100%}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container{margin-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container.ant-tabs-nav-container-scrolling,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container.ant-tabs-nav-container-scrolling{padding:32px 0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-wrap,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-wrap{margin-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav{width:100%}.ant-tabs .ant-tabs-left-bar .ant-tabs-ink-bar,.ant-tabs .ant-tabs-right-bar .ant-tabs-ink-bar{top:0;bottom:auto;left:auto;width:2px;height:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab-next,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab-next{right:0;bottom:0;width:100%;height:32px}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab-prev,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab-prev{top:0;width:100%;height:32px}.ant-tabs .ant-tabs-left-content,.ant-tabs .ant-tabs-right-content{width:auto;margin-top:0!important;overflow:hidden}.ant-tabs .ant-tabs-left-bar{float:left;margin-right:-1px;margin-bottom:0;border-right:1px solid #f0f0f0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-wrap{margin-right:-1px}.ant-tabs .ant-tabs-left-bar .ant-tabs-ink-bar{right:1px}.ant-tabs .ant-tabs-left-content{padding-left:24px;border-left:1px solid #f0f0f0}.ant-tabs .ant-tabs-right-bar{float:right;margin-bottom:0;margin-left:-1px;border-left:1px solid #f0f0f0}.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-wrap{margin-left:-1px}.ant-tabs .ant-tabs-right-bar .ant-tabs-ink-bar{left:1px}.ant-tabs .ant-tabs-right-content{padding-right:24px;border-right:1px solid #f0f0f0}.ant-tabs-bottom .ant-tabs-ink-bar-animated,.ant-tabs-top .ant-tabs-ink-bar-animated{-webkit-transition:width .2s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:width .2s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),width .2s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),width .2s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-left .ant-tabs-ink-bar-animated,.ant-tabs-right .ant-tabs-ink-bar-animated{-webkit-transition:height .2s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:height .2s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),height .2s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),height .2s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-no-animation>.ant-tabs-content>.ant-tabs-content-animated,.no-flex>.ant-tabs-content>.ant-tabs-content-animated{margin-left:0!important;-webkit-transform:none!important;transform:none!important}.ant-tabs-no-animation>.ant-tabs-content>.ant-tabs-tabpane-inactive,.no-flex>.ant-tabs-content>.ant-tabs-tabpane-inactive{height:0;padding:0!important;overflow:hidden;opacity:0;pointer-events:none}.ant-tabs-no-animation>.ant-tabs-content>.ant-tabs-tabpane-inactive input,.no-flex>.ant-tabs-content>.ant-tabs-tabpane-inactive input{visibility:hidden}.ant-tabs-left-content>.ant-tabs-content-animated,.ant-tabs-right-content>.ant-tabs-content-animated{margin-left:0!important;-webkit-transform:none!important;transform:none!important}.ant-tabs-left-content>.ant-tabs-tabpane-inactive,.ant-tabs-right-content>.ant-tabs-tabpane-inactive{height:0;padding:0!important;overflow:hidden;opacity:0;pointer-events:none}.ant-tabs-left-content>.ant-tabs-tabpane-inactive input,.ant-tabs-right-content>.ant-tabs-tabpane-inactive input{visibility:hidden}.ant-tabs-rtl{direction:rtl}.ant-tabs-rtl .ant-tabs-ink-bar{right:0;left:auto}.ant-tabs-rtl .ant-tabs-tab-next{right:auto;left:2px}.ant-tabs-rtl .ant-tabs-tab-prev{right:2px;left:auto}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab{margin:0 0 0 32px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .anticon{margin-right:0;margin-left:8px}.ant-tabs-rtl.ant-tabs .ant-tabs-left-bar .ant-tabs-tab,.ant-tabs-rtl.ant-tabs .ant-tabs-right-bar .ant-tabs-tab{margin:0 0 16px}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab:last-child,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab:last-child{margin-bottom:0}.ant-tabs-rtl.ant-tabs .ant-tabs-right-bar .ant-tabs-ink-bar{right:auto;left:1px}.ant-tabs-rtl.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x{margin-right:3px;margin-left:-5px}.ant-tabs-rtl .ant-tabs-extra-content{float:left!important}.ant-row{-ms-flex-flow:row wrap;flex-flow:row wrap}.ant-row,.ant-row:after,.ant-row:before{display:-ms-flexbox;display:flex}.ant-row-start{-ms-flex-pack:start;justify-content:flex-start}.ant-row-center{-ms-flex-pack:center;justify-content:center}.ant-row-end{-ms-flex-pack:end;justify-content:flex-end}.ant-row-space-between{-ms-flex-pack:justify;justify-content:space-between}.ant-row-space-around{-ms-flex-pack:distribute;justify-content:space-around}.ant-row-top{-ms-flex-align:start;align-items:flex-start}.ant-row-middle{-ms-flex-align:center;align-items:center}.ant-row-bottom{-ms-flex-align:end;align-items:flex-end}.ant-col{position:relative;max-width:100%;min-height:1px}.ant-col-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-push-24{left:100%}.ant-col-pull-24{right:100%}.ant-col-offset-24{margin-left:100%}.ant-col-order-24{-ms-flex-order:24;order:24}.ant-col-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-push-23{left:95.83333333%}.ant-col-pull-23{right:95.83333333%}.ant-col-offset-23{margin-left:95.83333333%}.ant-col-order-23{-ms-flex-order:23;order:23}.ant-col-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-push-22{left:91.66666667%}.ant-col-pull-22{right:91.66666667%}.ant-col-offset-22{margin-left:91.66666667%}.ant-col-order-22{-ms-flex-order:22;order:22}.ant-col-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-push-21{left:87.5%}.ant-col-pull-21{right:87.5%}.ant-col-offset-21{margin-left:87.5%}.ant-col-order-21{-ms-flex-order:21;order:21}.ant-col-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-push-20{left:83.33333333%}.ant-col-pull-20{right:83.33333333%}.ant-col-offset-20{margin-left:83.33333333%}.ant-col-order-20{-ms-flex-order:20;order:20}.ant-col-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-push-19{left:79.16666667%}.ant-col-pull-19{right:79.16666667%}.ant-col-offset-19{margin-left:79.16666667%}.ant-col-order-19{-ms-flex-order:19;order:19}.ant-col-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-push-18{left:75%}.ant-col-pull-18{right:75%}.ant-col-offset-18{margin-left:75%}.ant-col-order-18{-ms-flex-order:18;order:18}.ant-col-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-push-17{left:70.83333333%}.ant-col-pull-17{right:70.83333333%}.ant-col-offset-17{margin-left:70.83333333%}.ant-col-order-17{-ms-flex-order:17;order:17}.ant-col-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-push-16{left:66.66666667%}.ant-col-pull-16{right:66.66666667%}.ant-col-offset-16{margin-left:66.66666667%}.ant-col-order-16{-ms-flex-order:16;order:16}.ant-col-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-push-15{left:62.5%}.ant-col-pull-15{right:62.5%}.ant-col-offset-15{margin-left:62.5%}.ant-col-order-15{-ms-flex-order:15;order:15}.ant-col-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-push-14{left:58.33333333%}.ant-col-pull-14{right:58.33333333%}.ant-col-offset-14{margin-left:58.33333333%}.ant-col-order-14{-ms-flex-order:14;order:14}.ant-col-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-push-13{left:54.16666667%}.ant-col-pull-13{right:54.16666667%}.ant-col-offset-13{margin-left:54.16666667%}.ant-col-order-13{-ms-flex-order:13;order:13}.ant-col-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-push-12{left:50%}.ant-col-pull-12{right:50%}.ant-col-offset-12{margin-left:50%}.ant-col-order-12{-ms-flex-order:12;order:12}.ant-col-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-push-11{left:45.83333333%}.ant-col-pull-11{right:45.83333333%}.ant-col-offset-11{margin-left:45.83333333%}.ant-col-order-11{-ms-flex-order:11;order:11}.ant-col-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-push-10{left:41.66666667%}.ant-col-pull-10{right:41.66666667%}.ant-col-offset-10{margin-left:41.66666667%}.ant-col-order-10{-ms-flex-order:10;order:10}.ant-col-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-push-9{left:37.5%}.ant-col-pull-9{right:37.5%}.ant-col-offset-9{margin-left:37.5%}.ant-col-order-9{-ms-flex-order:9;order:9}.ant-col-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-push-8{left:33.33333333%}.ant-col-pull-8{right:33.33333333%}.ant-col-offset-8{margin-left:33.33333333%}.ant-col-order-8{-ms-flex-order:8;order:8}.ant-col-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-push-7{left:29.16666667%}.ant-col-pull-7{right:29.16666667%}.ant-col-offset-7{margin-left:29.16666667%}.ant-col-order-7{-ms-flex-order:7;order:7}.ant-col-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-push-6{left:25%}.ant-col-pull-6{right:25%}.ant-col-offset-6{margin-left:25%}.ant-col-order-6{-ms-flex-order:6;order:6}.ant-col-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-push-5{left:20.83333333%}.ant-col-pull-5{right:20.83333333%}.ant-col-offset-5{margin-left:20.83333333%}.ant-col-order-5{-ms-flex-order:5;order:5}.ant-col-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-push-4{left:16.66666667%}.ant-col-pull-4{right:16.66666667%}.ant-col-offset-4{margin-left:16.66666667%}.ant-col-order-4{-ms-flex-order:4;order:4}.ant-col-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-push-3{left:12.5%}.ant-col-pull-3{right:12.5%}.ant-col-offset-3{margin-left:12.5%}.ant-col-order-3{-ms-flex-order:3;order:3}.ant-col-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-push-2{left:8.33333333%}.ant-col-pull-2{right:8.33333333%}.ant-col-offset-2{margin-left:8.33333333%}.ant-col-order-2{-ms-flex-order:2;order:2}.ant-col-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-push-1{left:4.16666667%}.ant-col-pull-1{right:4.16666667%}.ant-col-offset-1{margin-left:4.16666667%}.ant-col-order-1{-ms-flex-order:1;order:1}.ant-col-0{display:none}.ant-col-offset-0{margin-left:0}.ant-col-order-0{-ms-flex-order:0;order:0}.ant-col-offset-0.ant-col-rtl{margin-right:0}.ant-col-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}.ant-col-xs-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-xs-push-24{left:100%}.ant-col-xs-pull-24{right:100%}.ant-col-xs-offset-24{margin-left:100%}.ant-col-xs-order-24{-ms-flex-order:24;order:24}.ant-col-xs-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xs-push-23{left:95.83333333%}.ant-col-xs-pull-23{right:95.83333333%}.ant-col-xs-offset-23{margin-left:95.83333333%}.ant-col-xs-order-23{-ms-flex-order:23;order:23}.ant-col-xs-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xs-push-22{left:91.66666667%}.ant-col-xs-pull-22{right:91.66666667%}.ant-col-xs-offset-22{margin-left:91.66666667%}.ant-col-xs-order-22{-ms-flex-order:22;order:22}.ant-col-xs-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-xs-push-21{left:87.5%}.ant-col-xs-pull-21{right:87.5%}.ant-col-xs-offset-21{margin-left:87.5%}.ant-col-xs-order-21{-ms-flex-order:21;order:21}.ant-col-xs-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xs-push-20{left:83.33333333%}.ant-col-xs-pull-20{right:83.33333333%}.ant-col-xs-offset-20{margin-left:83.33333333%}.ant-col-xs-order-20{-ms-flex-order:20;order:20}.ant-col-xs-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xs-push-19{left:79.16666667%}.ant-col-xs-pull-19{right:79.16666667%}.ant-col-xs-offset-19{margin-left:79.16666667%}.ant-col-xs-order-19{-ms-flex-order:19;order:19}.ant-col-xs-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-xs-push-18{left:75%}.ant-col-xs-pull-18{right:75%}.ant-col-xs-offset-18{margin-left:75%}.ant-col-xs-order-18{-ms-flex-order:18;order:18}.ant-col-xs-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xs-push-17{left:70.83333333%}.ant-col-xs-pull-17{right:70.83333333%}.ant-col-xs-offset-17{margin-left:70.83333333%}.ant-col-xs-order-17{-ms-flex-order:17;order:17}.ant-col-xs-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xs-push-16{left:66.66666667%}.ant-col-xs-pull-16{right:66.66666667%}.ant-col-xs-offset-16{margin-left:66.66666667%}.ant-col-xs-order-16{-ms-flex-order:16;order:16}.ant-col-xs-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-xs-push-15{left:62.5%}.ant-col-xs-pull-15{right:62.5%}.ant-col-xs-offset-15{margin-left:62.5%}.ant-col-xs-order-15{-ms-flex-order:15;order:15}.ant-col-xs-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xs-push-14{left:58.33333333%}.ant-col-xs-pull-14{right:58.33333333%}.ant-col-xs-offset-14{margin-left:58.33333333%}.ant-col-xs-order-14{-ms-flex-order:14;order:14}.ant-col-xs-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xs-push-13{left:54.16666667%}.ant-col-xs-pull-13{right:54.16666667%}.ant-col-xs-offset-13{margin-left:54.16666667%}.ant-col-xs-order-13{-ms-flex-order:13;order:13}.ant-col-xs-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-xs-push-12{left:50%}.ant-col-xs-pull-12{right:50%}.ant-col-xs-offset-12{margin-left:50%}.ant-col-xs-order-12{-ms-flex-order:12;order:12}.ant-col-xs-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xs-push-11{left:45.83333333%}.ant-col-xs-pull-11{right:45.83333333%}.ant-col-xs-offset-11{margin-left:45.83333333%}.ant-col-xs-order-11{-ms-flex-order:11;order:11}.ant-col-xs-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xs-push-10{left:41.66666667%}.ant-col-xs-pull-10{right:41.66666667%}.ant-col-xs-offset-10{margin-left:41.66666667%}.ant-col-xs-order-10{-ms-flex-order:10;order:10}.ant-col-xs-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-xs-push-9{left:37.5%}.ant-col-xs-pull-9{right:37.5%}.ant-col-xs-offset-9{margin-left:37.5%}.ant-col-xs-order-9{-ms-flex-order:9;order:9}.ant-col-xs-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xs-push-8{left:33.33333333%}.ant-col-xs-pull-8{right:33.33333333%}.ant-col-xs-offset-8{margin-left:33.33333333%}.ant-col-xs-order-8{-ms-flex-order:8;order:8}.ant-col-xs-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xs-push-7{left:29.16666667%}.ant-col-xs-pull-7{right:29.16666667%}.ant-col-xs-offset-7{margin-left:29.16666667%}.ant-col-xs-order-7{-ms-flex-order:7;order:7}.ant-col-xs-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-xs-push-6{left:25%}.ant-col-xs-pull-6{right:25%}.ant-col-xs-offset-6{margin-left:25%}.ant-col-xs-order-6{-ms-flex-order:6;order:6}.ant-col-xs-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xs-push-5{left:20.83333333%}.ant-col-xs-pull-5{right:20.83333333%}.ant-col-xs-offset-5{margin-left:20.83333333%}.ant-col-xs-order-5{-ms-flex-order:5;order:5}.ant-col-xs-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xs-push-4{left:16.66666667%}.ant-col-xs-pull-4{right:16.66666667%}.ant-col-xs-offset-4{margin-left:16.66666667%}.ant-col-xs-order-4{-ms-flex-order:4;order:4}.ant-col-xs-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-xs-push-3{left:12.5%}.ant-col-xs-pull-3{right:12.5%}.ant-col-xs-offset-3{margin-left:12.5%}.ant-col-xs-order-3{-ms-flex-order:3;order:3}.ant-col-xs-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xs-push-2{left:8.33333333%}.ant-col-xs-pull-2{right:8.33333333%}.ant-col-xs-offset-2{margin-left:8.33333333%}.ant-col-xs-order-2{-ms-flex-order:2;order:2}.ant-col-xs-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xs-push-1{left:4.16666667%}.ant-col-xs-pull-1{right:4.16666667%}.ant-col-xs-offset-1{margin-left:4.16666667%}.ant-col-xs-order-1{-ms-flex-order:1;order:1}.ant-col-xs-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xs-push-0{left:auto}.ant-col-xs-pull-0{right:auto}.ant-col-xs-offset-0{margin-left:0}.ant-col-xs-order-0{-ms-flex-order:0;order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xs-push-0.ant-col-rtl{right:auto}.ant-col-xs-pull-0.ant-col-rtl{left:auto}.ant-col-xs-offset-0.ant-col-rtl{margin-right:0}.ant-col-xs-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-xs-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-xs-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-xs-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-xs-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-xs-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-xs-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-xs-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-xs-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-xs-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-xs-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-xs-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-xs-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-xs-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-xs-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-xs-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-xs-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-xs-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-xs-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-xs-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-xs-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-xs-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-xs-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-xs-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-xs-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-xs-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-xs-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-xs-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-xs-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-xs-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-xs-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-xs-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-xs-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-xs-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-xs-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-xs-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-xs-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-xs-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-xs-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-xs-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-xs-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-xs-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-xs-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-xs-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-xs-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-xs-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-xs-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-xs-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-xs-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-xs-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-xs-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-xs-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-xs-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-xs-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-xs-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-xs-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-xs-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-xs-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-xs-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-xs-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-xs-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-xs-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-xs-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-xs-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-xs-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-xs-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-xs-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-xs-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-xs-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-xs-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-xs-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-xs-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}@media (min-width:576px){.ant-col-sm-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-sm-push-24{left:100%}.ant-col-sm-pull-24{right:100%}.ant-col-sm-offset-24{margin-left:100%}.ant-col-sm-order-24{-ms-flex-order:24;order:24}.ant-col-sm-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-sm-push-23{left:95.83333333%}.ant-col-sm-pull-23{right:95.83333333%}.ant-col-sm-offset-23{margin-left:95.83333333%}.ant-col-sm-order-23{-ms-flex-order:23;order:23}.ant-col-sm-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-sm-push-22{left:91.66666667%}.ant-col-sm-pull-22{right:91.66666667%}.ant-col-sm-offset-22{margin-left:91.66666667%}.ant-col-sm-order-22{-ms-flex-order:22;order:22}.ant-col-sm-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-sm-push-21{left:87.5%}.ant-col-sm-pull-21{right:87.5%}.ant-col-sm-offset-21{margin-left:87.5%}.ant-col-sm-order-21{-ms-flex-order:21;order:21}.ant-col-sm-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-sm-push-20{left:83.33333333%}.ant-col-sm-pull-20{right:83.33333333%}.ant-col-sm-offset-20{margin-left:83.33333333%}.ant-col-sm-order-20{-ms-flex-order:20;order:20}.ant-col-sm-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-sm-push-19{left:79.16666667%}.ant-col-sm-pull-19{right:79.16666667%}.ant-col-sm-offset-19{margin-left:79.16666667%}.ant-col-sm-order-19{-ms-flex-order:19;order:19}.ant-col-sm-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-sm-push-18{left:75%}.ant-col-sm-pull-18{right:75%}.ant-col-sm-offset-18{margin-left:75%}.ant-col-sm-order-18{-ms-flex-order:18;order:18}.ant-col-sm-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-sm-push-17{left:70.83333333%}.ant-col-sm-pull-17{right:70.83333333%}.ant-col-sm-offset-17{margin-left:70.83333333%}.ant-col-sm-order-17{-ms-flex-order:17;order:17}.ant-col-sm-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-sm-push-16{left:66.66666667%}.ant-col-sm-pull-16{right:66.66666667%}.ant-col-sm-offset-16{margin-left:66.66666667%}.ant-col-sm-order-16{-ms-flex-order:16;order:16}.ant-col-sm-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-sm-push-15{left:62.5%}.ant-col-sm-pull-15{right:62.5%}.ant-col-sm-offset-15{margin-left:62.5%}.ant-col-sm-order-15{-ms-flex-order:15;order:15}.ant-col-sm-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-sm-push-14{left:58.33333333%}.ant-col-sm-pull-14{right:58.33333333%}.ant-col-sm-offset-14{margin-left:58.33333333%}.ant-col-sm-order-14{-ms-flex-order:14;order:14}.ant-col-sm-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-sm-push-13{left:54.16666667%}.ant-col-sm-pull-13{right:54.16666667%}.ant-col-sm-offset-13{margin-left:54.16666667%}.ant-col-sm-order-13{-ms-flex-order:13;order:13}.ant-col-sm-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-sm-push-12{left:50%}.ant-col-sm-pull-12{right:50%}.ant-col-sm-offset-12{margin-left:50%}.ant-col-sm-order-12{-ms-flex-order:12;order:12}.ant-col-sm-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-sm-push-11{left:45.83333333%}.ant-col-sm-pull-11{right:45.83333333%}.ant-col-sm-offset-11{margin-left:45.83333333%}.ant-col-sm-order-11{-ms-flex-order:11;order:11}.ant-col-sm-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-sm-push-10{left:41.66666667%}.ant-col-sm-pull-10{right:41.66666667%}.ant-col-sm-offset-10{margin-left:41.66666667%}.ant-col-sm-order-10{-ms-flex-order:10;order:10}.ant-col-sm-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-sm-push-9{left:37.5%}.ant-col-sm-pull-9{right:37.5%}.ant-col-sm-offset-9{margin-left:37.5%}.ant-col-sm-order-9{-ms-flex-order:9;order:9}.ant-col-sm-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-sm-push-8{left:33.33333333%}.ant-col-sm-pull-8{right:33.33333333%}.ant-col-sm-offset-8{margin-left:33.33333333%}.ant-col-sm-order-8{-ms-flex-order:8;order:8}.ant-col-sm-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-sm-push-7{left:29.16666667%}.ant-col-sm-pull-7{right:29.16666667%}.ant-col-sm-offset-7{margin-left:29.16666667%}.ant-col-sm-order-7{-ms-flex-order:7;order:7}.ant-col-sm-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-sm-push-6{left:25%}.ant-col-sm-pull-6{right:25%}.ant-col-sm-offset-6{margin-left:25%}.ant-col-sm-order-6{-ms-flex-order:6;order:6}.ant-col-sm-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-sm-push-5{left:20.83333333%}.ant-col-sm-pull-5{right:20.83333333%}.ant-col-sm-offset-5{margin-left:20.83333333%}.ant-col-sm-order-5{-ms-flex-order:5;order:5}.ant-col-sm-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-sm-push-4{left:16.66666667%}.ant-col-sm-pull-4{right:16.66666667%}.ant-col-sm-offset-4{margin-left:16.66666667%}.ant-col-sm-order-4{-ms-flex-order:4;order:4}.ant-col-sm-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-sm-push-3{left:12.5%}.ant-col-sm-pull-3{right:12.5%}.ant-col-sm-offset-3{margin-left:12.5%}.ant-col-sm-order-3{-ms-flex-order:3;order:3}.ant-col-sm-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-sm-push-2{left:8.33333333%}.ant-col-sm-pull-2{right:8.33333333%}.ant-col-sm-offset-2{margin-left:8.33333333%}.ant-col-sm-order-2{-ms-flex-order:2;order:2}.ant-col-sm-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-sm-push-1{left:4.16666667%}.ant-col-sm-pull-1{right:4.16666667%}.ant-col-sm-offset-1{margin-left:4.16666667%}.ant-col-sm-order-1{-ms-flex-order:1;order:1}.ant-col-sm-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-sm-push-0{left:auto}.ant-col-sm-pull-0{right:auto}.ant-col-sm-offset-0{margin-left:0}.ant-col-sm-order-0{-ms-flex-order:0;order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-sm-push-0.ant-col-rtl{right:auto}.ant-col-sm-pull-0.ant-col-rtl{left:auto}.ant-col-sm-offset-0.ant-col-rtl{margin-right:0}.ant-col-sm-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-sm-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-sm-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-sm-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-sm-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-sm-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-sm-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-sm-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-sm-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-sm-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-sm-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-sm-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-sm-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-sm-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-sm-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-sm-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-sm-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-sm-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-sm-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-sm-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-sm-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-sm-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-sm-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-sm-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-sm-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-sm-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-sm-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-sm-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-sm-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-sm-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-sm-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-sm-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-sm-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-sm-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-sm-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-sm-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-sm-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-sm-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-sm-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-sm-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-sm-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-sm-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-sm-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-sm-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-sm-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-sm-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-sm-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-sm-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-sm-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-sm-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-sm-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-sm-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-sm-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-sm-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-sm-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-sm-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-sm-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-sm-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-sm-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-sm-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-sm-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-sm-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-sm-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-sm-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-sm-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-sm-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-sm-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-sm-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-sm-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-sm-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-sm-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-sm-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:768px){.ant-col-md-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-md-push-24{left:100%}.ant-col-md-pull-24{right:100%}.ant-col-md-offset-24{margin-left:100%}.ant-col-md-order-24{-ms-flex-order:24;order:24}.ant-col-md-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-md-push-23{left:95.83333333%}.ant-col-md-pull-23{right:95.83333333%}.ant-col-md-offset-23{margin-left:95.83333333%}.ant-col-md-order-23{-ms-flex-order:23;order:23}.ant-col-md-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-md-push-22{left:91.66666667%}.ant-col-md-pull-22{right:91.66666667%}.ant-col-md-offset-22{margin-left:91.66666667%}.ant-col-md-order-22{-ms-flex-order:22;order:22}.ant-col-md-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-md-push-21{left:87.5%}.ant-col-md-pull-21{right:87.5%}.ant-col-md-offset-21{margin-left:87.5%}.ant-col-md-order-21{-ms-flex-order:21;order:21}.ant-col-md-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-md-push-20{left:83.33333333%}.ant-col-md-pull-20{right:83.33333333%}.ant-col-md-offset-20{margin-left:83.33333333%}.ant-col-md-order-20{-ms-flex-order:20;order:20}.ant-col-md-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-md-push-19{left:79.16666667%}.ant-col-md-pull-19{right:79.16666667%}.ant-col-md-offset-19{margin-left:79.16666667%}.ant-col-md-order-19{-ms-flex-order:19;order:19}.ant-col-md-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-md-push-18{left:75%}.ant-col-md-pull-18{right:75%}.ant-col-md-offset-18{margin-left:75%}.ant-col-md-order-18{-ms-flex-order:18;order:18}.ant-col-md-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-md-push-17{left:70.83333333%}.ant-col-md-pull-17{right:70.83333333%}.ant-col-md-offset-17{margin-left:70.83333333%}.ant-col-md-order-17{-ms-flex-order:17;order:17}.ant-col-md-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-md-push-16{left:66.66666667%}.ant-col-md-pull-16{right:66.66666667%}.ant-col-md-offset-16{margin-left:66.66666667%}.ant-col-md-order-16{-ms-flex-order:16;order:16}.ant-col-md-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-md-push-15{left:62.5%}.ant-col-md-pull-15{right:62.5%}.ant-col-md-offset-15{margin-left:62.5%}.ant-col-md-order-15{-ms-flex-order:15;order:15}.ant-col-md-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-md-push-14{left:58.33333333%}.ant-col-md-pull-14{right:58.33333333%}.ant-col-md-offset-14{margin-left:58.33333333%}.ant-col-md-order-14{-ms-flex-order:14;order:14}.ant-col-md-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-md-push-13{left:54.16666667%}.ant-col-md-pull-13{right:54.16666667%}.ant-col-md-offset-13{margin-left:54.16666667%}.ant-col-md-order-13{-ms-flex-order:13;order:13}.ant-col-md-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-md-push-12{left:50%}.ant-col-md-pull-12{right:50%}.ant-col-md-offset-12{margin-left:50%}.ant-col-md-order-12{-ms-flex-order:12;order:12}.ant-col-md-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-md-push-11{left:45.83333333%}.ant-col-md-pull-11{right:45.83333333%}.ant-col-md-offset-11{margin-left:45.83333333%}.ant-col-md-order-11{-ms-flex-order:11;order:11}.ant-col-md-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-md-push-10{left:41.66666667%}.ant-col-md-pull-10{right:41.66666667%}.ant-col-md-offset-10{margin-left:41.66666667%}.ant-col-md-order-10{-ms-flex-order:10;order:10}.ant-col-md-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-md-push-9{left:37.5%}.ant-col-md-pull-9{right:37.5%}.ant-col-md-offset-9{margin-left:37.5%}.ant-col-md-order-9{-ms-flex-order:9;order:9}.ant-col-md-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-md-push-8{left:33.33333333%}.ant-col-md-pull-8{right:33.33333333%}.ant-col-md-offset-8{margin-left:33.33333333%}.ant-col-md-order-8{-ms-flex-order:8;order:8}.ant-col-md-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-md-push-7{left:29.16666667%}.ant-col-md-pull-7{right:29.16666667%}.ant-col-md-offset-7{margin-left:29.16666667%}.ant-col-md-order-7{-ms-flex-order:7;order:7}.ant-col-md-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-md-push-6{left:25%}.ant-col-md-pull-6{right:25%}.ant-col-md-offset-6{margin-left:25%}.ant-col-md-order-6{-ms-flex-order:6;order:6}.ant-col-md-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-md-push-5{left:20.83333333%}.ant-col-md-pull-5{right:20.83333333%}.ant-col-md-offset-5{margin-left:20.83333333%}.ant-col-md-order-5{-ms-flex-order:5;order:5}.ant-col-md-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-md-push-4{left:16.66666667%}.ant-col-md-pull-4{right:16.66666667%}.ant-col-md-offset-4{margin-left:16.66666667%}.ant-col-md-order-4{-ms-flex-order:4;order:4}.ant-col-md-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-md-push-3{left:12.5%}.ant-col-md-pull-3{right:12.5%}.ant-col-md-offset-3{margin-left:12.5%}.ant-col-md-order-3{-ms-flex-order:3;order:3}.ant-col-md-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-md-push-2{left:8.33333333%}.ant-col-md-pull-2{right:8.33333333%}.ant-col-md-offset-2{margin-left:8.33333333%}.ant-col-md-order-2{-ms-flex-order:2;order:2}.ant-col-md-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-md-push-1{left:4.16666667%}.ant-col-md-pull-1{right:4.16666667%}.ant-col-md-offset-1{margin-left:4.16666667%}.ant-col-md-order-1{-ms-flex-order:1;order:1}.ant-col-md-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-md-push-0{left:auto}.ant-col-md-pull-0{right:auto}.ant-col-md-offset-0{margin-left:0}.ant-col-md-order-0{-ms-flex-order:0;order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-md-push-0.ant-col-rtl{right:auto}.ant-col-md-pull-0.ant-col-rtl{left:auto}.ant-col-md-offset-0.ant-col-rtl{margin-right:0}.ant-col-md-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-md-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-md-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-md-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-md-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-md-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-md-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-md-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-md-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-md-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-md-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-md-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-md-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-md-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-md-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-md-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-md-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-md-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-md-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-md-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-md-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-md-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-md-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-md-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-md-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-md-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-md-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-md-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-md-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-md-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-md-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-md-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-md-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-md-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-md-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-md-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-md-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-md-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-md-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-md-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-md-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-md-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-md-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-md-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-md-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-md-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-md-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-md-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-md-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-md-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-md-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-md-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-md-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-md-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-md-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-md-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-md-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-md-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-md-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-md-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-md-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-md-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-md-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-md-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-md-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-md-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-md-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-md-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-md-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-md-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-md-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-md-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:992px){.ant-col-lg-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-lg-push-24{left:100%}.ant-col-lg-pull-24{right:100%}.ant-col-lg-offset-24{margin-left:100%}.ant-col-lg-order-24{-ms-flex-order:24;order:24}.ant-col-lg-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-lg-push-23{left:95.83333333%}.ant-col-lg-pull-23{right:95.83333333%}.ant-col-lg-offset-23{margin-left:95.83333333%}.ant-col-lg-order-23{-ms-flex-order:23;order:23}.ant-col-lg-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-lg-push-22{left:91.66666667%}.ant-col-lg-pull-22{right:91.66666667%}.ant-col-lg-offset-22{margin-left:91.66666667%}.ant-col-lg-order-22{-ms-flex-order:22;order:22}.ant-col-lg-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-lg-push-21{left:87.5%}.ant-col-lg-pull-21{right:87.5%}.ant-col-lg-offset-21{margin-left:87.5%}.ant-col-lg-order-21{-ms-flex-order:21;order:21}.ant-col-lg-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-lg-push-20{left:83.33333333%}.ant-col-lg-pull-20{right:83.33333333%}.ant-col-lg-offset-20{margin-left:83.33333333%}.ant-col-lg-order-20{-ms-flex-order:20;order:20}.ant-col-lg-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-lg-push-19{left:79.16666667%}.ant-col-lg-pull-19{right:79.16666667%}.ant-col-lg-offset-19{margin-left:79.16666667%}.ant-col-lg-order-19{-ms-flex-order:19;order:19}.ant-col-lg-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-lg-push-18{left:75%}.ant-col-lg-pull-18{right:75%}.ant-col-lg-offset-18{margin-left:75%}.ant-col-lg-order-18{-ms-flex-order:18;order:18}.ant-col-lg-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-lg-push-17{left:70.83333333%}.ant-col-lg-pull-17{right:70.83333333%}.ant-col-lg-offset-17{margin-left:70.83333333%}.ant-col-lg-order-17{-ms-flex-order:17;order:17}.ant-col-lg-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-lg-push-16{left:66.66666667%}.ant-col-lg-pull-16{right:66.66666667%}.ant-col-lg-offset-16{margin-left:66.66666667%}.ant-col-lg-order-16{-ms-flex-order:16;order:16}.ant-col-lg-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-lg-push-15{left:62.5%}.ant-col-lg-pull-15{right:62.5%}.ant-col-lg-offset-15{margin-left:62.5%}.ant-col-lg-order-15{-ms-flex-order:15;order:15}.ant-col-lg-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-lg-push-14{left:58.33333333%}.ant-col-lg-pull-14{right:58.33333333%}.ant-col-lg-offset-14{margin-left:58.33333333%}.ant-col-lg-order-14{-ms-flex-order:14;order:14}.ant-col-lg-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-lg-push-13{left:54.16666667%}.ant-col-lg-pull-13{right:54.16666667%}.ant-col-lg-offset-13{margin-left:54.16666667%}.ant-col-lg-order-13{-ms-flex-order:13;order:13}.ant-col-lg-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-lg-push-12{left:50%}.ant-col-lg-pull-12{right:50%}.ant-col-lg-offset-12{margin-left:50%}.ant-col-lg-order-12{-ms-flex-order:12;order:12}.ant-col-lg-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-lg-push-11{left:45.83333333%}.ant-col-lg-pull-11{right:45.83333333%}.ant-col-lg-offset-11{margin-left:45.83333333%}.ant-col-lg-order-11{-ms-flex-order:11;order:11}.ant-col-lg-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-lg-push-10{left:41.66666667%}.ant-col-lg-pull-10{right:41.66666667%}.ant-col-lg-offset-10{margin-left:41.66666667%}.ant-col-lg-order-10{-ms-flex-order:10;order:10}.ant-col-lg-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-lg-push-9{left:37.5%}.ant-col-lg-pull-9{right:37.5%}.ant-col-lg-offset-9{margin-left:37.5%}.ant-col-lg-order-9{-ms-flex-order:9;order:9}.ant-col-lg-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-lg-push-8{left:33.33333333%}.ant-col-lg-pull-8{right:33.33333333%}.ant-col-lg-offset-8{margin-left:33.33333333%}.ant-col-lg-order-8{-ms-flex-order:8;order:8}.ant-col-lg-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-lg-push-7{left:29.16666667%}.ant-col-lg-pull-7{right:29.16666667%}.ant-col-lg-offset-7{margin-left:29.16666667%}.ant-col-lg-order-7{-ms-flex-order:7;order:7}.ant-col-lg-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-lg-push-6{left:25%}.ant-col-lg-pull-6{right:25%}.ant-col-lg-offset-6{margin-left:25%}.ant-col-lg-order-6{-ms-flex-order:6;order:6}.ant-col-lg-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-lg-push-5{left:20.83333333%}.ant-col-lg-pull-5{right:20.83333333%}.ant-col-lg-offset-5{margin-left:20.83333333%}.ant-col-lg-order-5{-ms-flex-order:5;order:5}.ant-col-lg-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-lg-push-4{left:16.66666667%}.ant-col-lg-pull-4{right:16.66666667%}.ant-col-lg-offset-4{margin-left:16.66666667%}.ant-col-lg-order-4{-ms-flex-order:4;order:4}.ant-col-lg-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-lg-push-3{left:12.5%}.ant-col-lg-pull-3{right:12.5%}.ant-col-lg-offset-3{margin-left:12.5%}.ant-col-lg-order-3{-ms-flex-order:3;order:3}.ant-col-lg-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-lg-push-2{left:8.33333333%}.ant-col-lg-pull-2{right:8.33333333%}.ant-col-lg-offset-2{margin-left:8.33333333%}.ant-col-lg-order-2{-ms-flex-order:2;order:2}.ant-col-lg-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-lg-push-1{left:4.16666667%}.ant-col-lg-pull-1{right:4.16666667%}.ant-col-lg-offset-1{margin-left:4.16666667%}.ant-col-lg-order-1{-ms-flex-order:1;order:1}.ant-col-lg-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-lg-push-0{left:auto}.ant-col-lg-pull-0{right:auto}.ant-col-lg-offset-0{margin-left:0}.ant-col-lg-order-0{-ms-flex-order:0;order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-lg-push-0.ant-col-rtl{right:auto}.ant-col-lg-pull-0.ant-col-rtl{left:auto}.ant-col-lg-offset-0.ant-col-rtl{margin-right:0}.ant-col-lg-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-lg-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-lg-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-lg-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-lg-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-lg-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-lg-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-lg-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-lg-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-lg-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-lg-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-lg-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-lg-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-lg-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-lg-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-lg-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-lg-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-lg-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-lg-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-lg-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-lg-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-lg-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-lg-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-lg-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-lg-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-lg-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-lg-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-lg-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-lg-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-lg-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-lg-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-lg-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-lg-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-lg-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-lg-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-lg-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-lg-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-lg-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-lg-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-lg-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-lg-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-lg-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-lg-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-lg-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-lg-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-lg-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-lg-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-lg-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-lg-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-lg-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-lg-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-lg-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-lg-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-lg-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-lg-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-lg-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-lg-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-lg-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-lg-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-lg-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-lg-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-lg-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-lg-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-lg-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-lg-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-lg-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-lg-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-lg-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-lg-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-lg-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-lg-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-lg-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:1200px){.ant-col-xl-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-xl-push-24{left:100%}.ant-col-xl-pull-24{right:100%}.ant-col-xl-offset-24{margin-left:100%}.ant-col-xl-order-24{-ms-flex-order:24;order:24}.ant-col-xl-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xl-push-23{left:95.83333333%}.ant-col-xl-pull-23{right:95.83333333%}.ant-col-xl-offset-23{margin-left:95.83333333%}.ant-col-xl-order-23{-ms-flex-order:23;order:23}.ant-col-xl-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xl-push-22{left:91.66666667%}.ant-col-xl-pull-22{right:91.66666667%}.ant-col-xl-offset-22{margin-left:91.66666667%}.ant-col-xl-order-22{-ms-flex-order:22;order:22}.ant-col-xl-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-xl-push-21{left:87.5%}.ant-col-xl-pull-21{right:87.5%}.ant-col-xl-offset-21{margin-left:87.5%}.ant-col-xl-order-21{-ms-flex-order:21;order:21}.ant-col-xl-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xl-push-20{left:83.33333333%}.ant-col-xl-pull-20{right:83.33333333%}.ant-col-xl-offset-20{margin-left:83.33333333%}.ant-col-xl-order-20{-ms-flex-order:20;order:20}.ant-col-xl-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xl-push-19{left:79.16666667%}.ant-col-xl-pull-19{right:79.16666667%}.ant-col-xl-offset-19{margin-left:79.16666667%}.ant-col-xl-order-19{-ms-flex-order:19;order:19}.ant-col-xl-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-xl-push-18{left:75%}.ant-col-xl-pull-18{right:75%}.ant-col-xl-offset-18{margin-left:75%}.ant-col-xl-order-18{-ms-flex-order:18;order:18}.ant-col-xl-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xl-push-17{left:70.83333333%}.ant-col-xl-pull-17{right:70.83333333%}.ant-col-xl-offset-17{margin-left:70.83333333%}.ant-col-xl-order-17{-ms-flex-order:17;order:17}.ant-col-xl-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xl-push-16{left:66.66666667%}.ant-col-xl-pull-16{right:66.66666667%}.ant-col-xl-offset-16{margin-left:66.66666667%}.ant-col-xl-order-16{-ms-flex-order:16;order:16}.ant-col-xl-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-xl-push-15{left:62.5%}.ant-col-xl-pull-15{right:62.5%}.ant-col-xl-offset-15{margin-left:62.5%}.ant-col-xl-order-15{-ms-flex-order:15;order:15}.ant-col-xl-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xl-push-14{left:58.33333333%}.ant-col-xl-pull-14{right:58.33333333%}.ant-col-xl-offset-14{margin-left:58.33333333%}.ant-col-xl-order-14{-ms-flex-order:14;order:14}.ant-col-xl-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xl-push-13{left:54.16666667%}.ant-col-xl-pull-13{right:54.16666667%}.ant-col-xl-offset-13{margin-left:54.16666667%}.ant-col-xl-order-13{-ms-flex-order:13;order:13}.ant-col-xl-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-xl-push-12{left:50%}.ant-col-xl-pull-12{right:50%}.ant-col-xl-offset-12{margin-left:50%}.ant-col-xl-order-12{-ms-flex-order:12;order:12}.ant-col-xl-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xl-push-11{left:45.83333333%}.ant-col-xl-pull-11{right:45.83333333%}.ant-col-xl-offset-11{margin-left:45.83333333%}.ant-col-xl-order-11{-ms-flex-order:11;order:11}.ant-col-xl-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xl-push-10{left:41.66666667%}.ant-col-xl-pull-10{right:41.66666667%}.ant-col-xl-offset-10{margin-left:41.66666667%}.ant-col-xl-order-10{-ms-flex-order:10;order:10}.ant-col-xl-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-xl-push-9{left:37.5%}.ant-col-xl-pull-9{right:37.5%}.ant-col-xl-offset-9{margin-left:37.5%}.ant-col-xl-order-9{-ms-flex-order:9;order:9}.ant-col-xl-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xl-push-8{left:33.33333333%}.ant-col-xl-pull-8{right:33.33333333%}.ant-col-xl-offset-8{margin-left:33.33333333%}.ant-col-xl-order-8{-ms-flex-order:8;order:8}.ant-col-xl-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xl-push-7{left:29.16666667%}.ant-col-xl-pull-7{right:29.16666667%}.ant-col-xl-offset-7{margin-left:29.16666667%}.ant-col-xl-order-7{-ms-flex-order:7;order:7}.ant-col-xl-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-xl-push-6{left:25%}.ant-col-xl-pull-6{right:25%}.ant-col-xl-offset-6{margin-left:25%}.ant-col-xl-order-6{-ms-flex-order:6;order:6}.ant-col-xl-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xl-push-5{left:20.83333333%}.ant-col-xl-pull-5{right:20.83333333%}.ant-col-xl-offset-5{margin-left:20.83333333%}.ant-col-xl-order-5{-ms-flex-order:5;order:5}.ant-col-xl-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xl-push-4{left:16.66666667%}.ant-col-xl-pull-4{right:16.66666667%}.ant-col-xl-offset-4{margin-left:16.66666667%}.ant-col-xl-order-4{-ms-flex-order:4;order:4}.ant-col-xl-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-xl-push-3{left:12.5%}.ant-col-xl-pull-3{right:12.5%}.ant-col-xl-offset-3{margin-left:12.5%}.ant-col-xl-order-3{-ms-flex-order:3;order:3}.ant-col-xl-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xl-push-2{left:8.33333333%}.ant-col-xl-pull-2{right:8.33333333%}.ant-col-xl-offset-2{margin-left:8.33333333%}.ant-col-xl-order-2{-ms-flex-order:2;order:2}.ant-col-xl-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xl-push-1{left:4.16666667%}.ant-col-xl-pull-1{right:4.16666667%}.ant-col-xl-offset-1{margin-left:4.16666667%}.ant-col-xl-order-1{-ms-flex-order:1;order:1}.ant-col-xl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xl-push-0{left:auto}.ant-col-xl-pull-0{right:auto}.ant-col-xl-offset-0{margin-left:0}.ant-col-xl-order-0{-ms-flex-order:0;order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xl-push-0.ant-col-rtl{right:auto}.ant-col-xl-pull-0.ant-col-rtl{left:auto}.ant-col-xl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xl-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-xl-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-xl-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-xl-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-xl-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-xl-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-xl-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-xl-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-xl-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-xl-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-xl-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-xl-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-xl-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-xl-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-xl-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-xl-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-xl-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-xl-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-xl-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-xl-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-xl-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-xl-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-xl-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-xl-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-xl-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-xl-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-xl-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-xl-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-xl-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-xl-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-xl-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-xl-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-xl-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-xl-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-xl-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-xl-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-xl-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-xl-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-xl-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-xl-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-xl-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-xl-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-xl-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-xl-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-xl-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-xl-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-xl-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-xl-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-xl-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-xl-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-xl-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-xl-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-xl-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-xl-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-xl-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-xl-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-xl-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-xl-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-xl-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-xl-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-xl-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-xl-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-xl-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-xl-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-xl-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-xl-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-xl-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-xl-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-xl-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-xl-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-xl-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-xl-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:1600px){.ant-col-xxl-24{display:block;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-xxl-push-24{left:100%}.ant-col-xxl-pull-24{right:100%}.ant-col-xxl-offset-24{margin-left:100%}.ant-col-xxl-order-24{-ms-flex-order:24;order:24}.ant-col-xxl-23{display:block;-ms-flex:0 0 95.83333333%;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xxl-push-23{left:95.83333333%}.ant-col-xxl-pull-23{right:95.83333333%}.ant-col-xxl-offset-23{margin-left:95.83333333%}.ant-col-xxl-order-23{-ms-flex-order:23;order:23}.ant-col-xxl-22{display:block;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xxl-push-22{left:91.66666667%}.ant-col-xxl-pull-22{right:91.66666667%}.ant-col-xxl-offset-22{margin-left:91.66666667%}.ant-col-xxl-order-22{-ms-flex-order:22;order:22}.ant-col-xxl-21{display:block;-ms-flex:0 0 87.5%;flex:0 0 87.5%;max-width:87.5%}.ant-col-xxl-push-21{left:87.5%}.ant-col-xxl-pull-21{right:87.5%}.ant-col-xxl-offset-21{margin-left:87.5%}.ant-col-xxl-order-21{-ms-flex-order:21;order:21}.ant-col-xxl-20{display:block;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xxl-push-20{left:83.33333333%}.ant-col-xxl-pull-20{right:83.33333333%}.ant-col-xxl-offset-20{margin-left:83.33333333%}.ant-col-xxl-order-20{-ms-flex-order:20;order:20}.ant-col-xxl-19{display:block;-ms-flex:0 0 79.16666667%;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xxl-push-19{left:79.16666667%}.ant-col-xxl-pull-19{right:79.16666667%}.ant-col-xxl-offset-19{margin-left:79.16666667%}.ant-col-xxl-order-19{-ms-flex-order:19;order:19}.ant-col-xxl-18{display:block;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.ant-col-xxl-push-18{left:75%}.ant-col-xxl-pull-18{right:75%}.ant-col-xxl-offset-18{margin-left:75%}.ant-col-xxl-order-18{-ms-flex-order:18;order:18}.ant-col-xxl-17{display:block;-ms-flex:0 0 70.83333333%;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xxl-push-17{left:70.83333333%}.ant-col-xxl-pull-17{right:70.83333333%}.ant-col-xxl-offset-17{margin-left:70.83333333%}.ant-col-xxl-order-17{-ms-flex-order:17;order:17}.ant-col-xxl-16{display:block;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xxl-push-16{left:66.66666667%}.ant-col-xxl-pull-16{right:66.66666667%}.ant-col-xxl-offset-16{margin-left:66.66666667%}.ant-col-xxl-order-16{-ms-flex-order:16;order:16}.ant-col-xxl-15{display:block;-ms-flex:0 0 62.5%;flex:0 0 62.5%;max-width:62.5%}.ant-col-xxl-push-15{left:62.5%}.ant-col-xxl-pull-15{right:62.5%}.ant-col-xxl-offset-15{margin-left:62.5%}.ant-col-xxl-order-15{-ms-flex-order:15;order:15}.ant-col-xxl-14{display:block;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xxl-push-14{left:58.33333333%}.ant-col-xxl-pull-14{right:58.33333333%}.ant-col-xxl-offset-14{margin-left:58.33333333%}.ant-col-xxl-order-14{-ms-flex-order:14;order:14}.ant-col-xxl-13{display:block;-ms-flex:0 0 54.16666667%;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xxl-push-13{left:54.16666667%}.ant-col-xxl-pull-13{right:54.16666667%}.ant-col-xxl-offset-13{margin-left:54.16666667%}.ant-col-xxl-order-13{-ms-flex-order:13;order:13}.ant-col-xxl-12{display:block;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ant-col-xxl-push-12{left:50%}.ant-col-xxl-pull-12{right:50%}.ant-col-xxl-offset-12{margin-left:50%}.ant-col-xxl-order-12{-ms-flex-order:12;order:12}.ant-col-xxl-11{display:block;-ms-flex:0 0 45.83333333%;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xxl-push-11{left:45.83333333%}.ant-col-xxl-pull-11{right:45.83333333%}.ant-col-xxl-offset-11{margin-left:45.83333333%}.ant-col-xxl-order-11{-ms-flex-order:11;order:11}.ant-col-xxl-10{display:block;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xxl-push-10{left:41.66666667%}.ant-col-xxl-pull-10{right:41.66666667%}.ant-col-xxl-offset-10{margin-left:41.66666667%}.ant-col-xxl-order-10{-ms-flex-order:10;order:10}.ant-col-xxl-9{display:block;-ms-flex:0 0 37.5%;flex:0 0 37.5%;max-width:37.5%}.ant-col-xxl-push-9{left:37.5%}.ant-col-xxl-pull-9{right:37.5%}.ant-col-xxl-offset-9{margin-left:37.5%}.ant-col-xxl-order-9{-ms-flex-order:9;order:9}.ant-col-xxl-8{display:block;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xxl-push-8{left:33.33333333%}.ant-col-xxl-pull-8{right:33.33333333%}.ant-col-xxl-offset-8{margin-left:33.33333333%}.ant-col-xxl-order-8{-ms-flex-order:8;order:8}.ant-col-xxl-7{display:block;-ms-flex:0 0 29.16666667%;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xxl-push-7{left:29.16666667%}.ant-col-xxl-pull-7{right:29.16666667%}.ant-col-xxl-offset-7{margin-left:29.16666667%}.ant-col-xxl-order-7{-ms-flex-order:7;order:7}.ant-col-xxl-6{display:block;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.ant-col-xxl-push-6{left:25%}.ant-col-xxl-pull-6{right:25%}.ant-col-xxl-offset-6{margin-left:25%}.ant-col-xxl-order-6{-ms-flex-order:6;order:6}.ant-col-xxl-5{display:block;-ms-flex:0 0 20.83333333%;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xxl-push-5{left:20.83333333%}.ant-col-xxl-pull-5{right:20.83333333%}.ant-col-xxl-offset-5{margin-left:20.83333333%}.ant-col-xxl-order-5{-ms-flex-order:5;order:5}.ant-col-xxl-4{display:block;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xxl-push-4{left:16.66666667%}.ant-col-xxl-pull-4{right:16.66666667%}.ant-col-xxl-offset-4{margin-left:16.66666667%}.ant-col-xxl-order-4{-ms-flex-order:4;order:4}.ant-col-xxl-3{display:block;-ms-flex:0 0 12.5%;flex:0 0 12.5%;max-width:12.5%}.ant-col-xxl-push-3{left:12.5%}.ant-col-xxl-pull-3{right:12.5%}.ant-col-xxl-offset-3{margin-left:12.5%}.ant-col-xxl-order-3{-ms-flex-order:3;order:3}.ant-col-xxl-2{display:block;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xxl-push-2{left:8.33333333%}.ant-col-xxl-pull-2{right:8.33333333%}.ant-col-xxl-offset-2{margin-left:8.33333333%}.ant-col-xxl-order-2{-ms-flex-order:2;order:2}.ant-col-xxl-1{display:block;-ms-flex:0 0 4.16666667%;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xxl-push-1{left:4.16666667%}.ant-col-xxl-pull-1{right:4.16666667%}.ant-col-xxl-offset-1{margin-left:4.16666667%}.ant-col-xxl-order-1{-ms-flex-order:1;order:1}.ant-col-xxl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xxl-push-0{left:auto}.ant-col-xxl-pull-0{right:auto}.ant-col-xxl-offset-0{margin-left:0}.ant-col-xxl-order-0{-ms-flex-order:0;order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-push-0.ant-col-rtl{right:auto}.ant-col-xxl-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xxl-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-xxl-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-xxl-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-xxl-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-xxl-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-xxl-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-xxl-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-xxl-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-xxl-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-xxl-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-xxl-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-xxl-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-xxl-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-xxl-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-xxl-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-xxl-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-xxl-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-xxl-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-xxl-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-xxl-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-xxl-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-xxl-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-xxl-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-xxl-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-xxl-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-xxl-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-xxl-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-xxl-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-xxl-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-xxl-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-xxl-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-xxl-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-xxl-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-xxl-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-xxl-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-xxl-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-xxl-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-xxl-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-xxl-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-xxl-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-xxl-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-xxl-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-xxl-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-xxl-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-xxl-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-xxl-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-xxl-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-xxl-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-xxl-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-xxl-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-xxl-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-xxl-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-xxl-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-xxl-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-xxl-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-xxl-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-xxl-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-xxl-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-xxl-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-xxl-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-xxl-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-xxl-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-xxl-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-xxl-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-xxl-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-xxl-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-xxl-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-xxl-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-xxl-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-xxl-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-xxl-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-xxl-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}.ant-row-rtl{direction:rtl}.ant-col.ant-col-rtl{float:right}.ant-carousel{margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}.ant-carousel,.ant-carousel .slick-slider{-webkit-box-sizing:border-box;box-sizing:border-box}.ant-carousel .slick-slider{position:relative;display:block;-webkit-touch-callout:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.ant-carousel .slick-list{position:relative;display:block;margin:0;padding:0;overflow:hidden}.ant-carousel .slick-list:focus{outline:none}.ant-carousel .slick-list.dragging{cursor:pointer}.ant-carousel .slick-list .slick-slide{pointer-events:none}.ant-carousel .slick-list .slick-slide input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide input.ant-radio-input{visibility:hidden}.ant-carousel .slick-list .slick-slide.slick-active{pointer-events:auto}.ant-carousel .slick-list .slick-slide.slick-active input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide.slick-active input.ant-radio-input{visibility:visible}.ant-carousel .slick-slider .slick-list,.ant-carousel .slick-slider .slick-track{-webkit-transform:translateZ(0);transform:translateZ(0)}.ant-carousel .slick-track{position:relative;top:0;left:0;display:block}.ant-carousel .slick-track:after,.ant-carousel .slick-track:before{display:table;content:""}.ant-carousel .slick-track:after{clear:both}.slick-loading .ant-carousel .slick-track{visibility:hidden}.ant-carousel .slick-slide{display:none;float:left;height:100%;min-height:1px}.ant-carousel .slick-slide img{display:block}.ant-carousel .slick-slide.slick-loading img{display:none}.ant-carousel .slick-slide.dragging img{pointer-events:none}.ant-carousel .slick-initialized .slick-slide{display:block}.ant-carousel .slick-loading .slick-slide{visibility:hidden}.ant-carousel .slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.ant-carousel .slick-arrow.slick-hidden{display:none}.ant-carousel .slick-next,.ant-carousel .slick-prev{position:absolute;top:50%;display:block;width:20px;height:20px;margin-top:-10px;padding:0;font-size:0;line-height:0;border:0;cursor:pointer}.ant-carousel .slick-next,.ant-carousel .slick-next:focus,.ant-carousel .slick-next:hover,.ant-carousel .slick-prev,.ant-carousel .slick-prev:focus,.ant-carousel .slick-prev:hover{color:transparent;background:transparent;outline:none}.ant-carousel .slick-next:focus:before,.ant-carousel .slick-next:hover:before,.ant-carousel .slick-prev:focus:before,.ant-carousel .slick-prev:hover:before{opacity:1}.ant-carousel .slick-next.slick-disabled:before,.ant-carousel .slick-prev.slick-disabled:before{opacity:.25}.ant-carousel .slick-prev{left:-25px}.ant-carousel .slick-prev:before{content:"←"}.ant-carousel .slick-next{right:-25px}.ant-carousel .slick-next:before{content:"→"}.ant-carousel .slick-dots{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox!important;display:flex!important;-ms-flex-pack:center;justify-content:center;margin-right:15%;margin-left:15%;padding-left:0;list-style:none}.ant-carousel .slick-dots-bottom{bottom:12px}.ant-carousel .slick-dots-top{top:12px}.ant-carousel .slick-dots li{position:relative;display:inline-block;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-box-sizing:content-box;box-sizing:content-box;width:16px;margin:0 3px;text-align:center;text-indent:-999px;vertical-align:top}.ant-carousel .slick-dots li,.ant-carousel .slick-dots li button{height:3px;padding:0;-webkit-transition:all .5s;transition:all .5s}.ant-carousel .slick-dots li button{display:block;width:100%;color:transparent;font-size:0;background:#fff;border:0;border-radius:1px;outline:none;cursor:pointer;opacity:.3}.ant-carousel .slick-dots li button:focus,.ant-carousel .slick-dots li button:hover{opacity:.75}.ant-carousel .slick-dots li.slick-active{width:24px}.ant-carousel .slick-dots li.slick-active button{background:#fff;opacity:1}.ant-carousel .slick-dots li.slick-active:focus,.ant-carousel .slick-dots li.slick-active:hover{opacity:1}.ant-carousel-vertical .slick-dots{top:50%;bottom:auto;-ms-flex-direction:column;flex-direction:column;width:3px;height:auto;margin:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ant-carousel-vertical .slick-dots-left{right:auto;left:12px}.ant-carousel-vertical .slick-dots-right{right:12px;left:auto}.ant-carousel-vertical .slick-dots li{width:3px;height:16px;margin:4px 2px;vertical-align:baseline}.ant-carousel-vertical .slick-dots li button{width:3px;height:16px}.ant-carousel-vertical .slick-dots li.slick-active,.ant-carousel-vertical .slick-dots li.slick-active button{width:3px;height:24px}.ant-carousel-rtl{direction:rtl}.ant-carousel-rtl .ant-carousel .slick-track{right:0;left:auto}.ant-carousel-rtl .ant-carousel .slick-prev{right:-25px;left:auto}.ant-carousel-rtl .ant-carousel .slick-prev:before{content:"→"}.ant-carousel-rtl .ant-carousel .slick-next{right:auto;left:-25px}.ant-carousel-rtl .ant-carousel .slick-next:before{content:"←"}.ant-carousel-rtl.ant-carousel .slick-dots{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ant-carousel-rtl.ant-carousel-vertical .slick-dots{-ms-flex-direction:column;flex-direction:column}.ant-cascader{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}.ant-cascader-input.ant-input{position:static;width:100%;padding-right:24px;background-color:transparent!important;cursor:pointer}.ant-cascader-picker-show-search .ant-cascader-input.ant-input{position:relative}.ant-cascader-picker{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;background-color:#fff;border-radius:2px;outline:0;cursor:pointer;-webkit-transition:color .3s;transition:color .3s}.ant-cascader-picker-with-value .ant-cascader-picker-label{color:transparent}.ant-cascader-picker-disabled{color:rgba(0,0,0,.25);background:#f5f5f5;cursor:not-allowed}.ant-cascader-picker-disabled .ant-cascader-input{cursor:not-allowed}.ant-cascader-picker:focus .ant-cascader-input{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-cascader-picker-borderless .ant-cascader-input{border-color:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}.ant-cascader-picker-show-search.ant-cascader-picker-focused{color:rgba(0,0,0,.25)}.ant-cascader-picker-label{position:absolute;top:50%;left:0;width:100%;height:20px;margin-top:-10px;padding:0 20px 0 12px;overflow:hidden;line-height:20px;white-space:nowrap;text-overflow:ellipsis}.ant-cascader-picker-clear{position:absolute;top:50%;right:12px;z-index:2;width:12px;height:12px;margin-top:-6px;color:rgba(0,0,0,.25);font-size:12px;line-height:12px;background:#fff;cursor:pointer;opacity:0;-webkit-transition:color .3s ease,opacity .15s ease;transition:color .3s ease,opacity .15s ease}.ant-cascader-picker-clear:hover{color:rgba(0,0,0,.45)}.ant-cascader-picker:hover .ant-cascader-picker-clear{opacity:1}.ant-cascader-picker-arrow{position:absolute;top:50%;right:12px;z-index:1;width:12px;height:12px;margin-top:-6px;color:rgba(0,0,0,.25);font-size:12px;line-height:12px;-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s}.ant-cascader-picker-arrow.ant-cascader-picker-arrow-expand{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.ant-cascader-picker-label:hover+.ant-cascader-input{border-color:#40a9ff;border-right-width:1px!important}.ant-cascader-picker-small .ant-cascader-picker-arrow,.ant-cascader-picker-small .ant-cascader-picker-clear{right:8px}.ant-cascader-menus{position:absolute;z-index:1050;font-size:14px;white-space:nowrap;background:#fff;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-cascader-menus ol,.ant-cascader-menus ul{margin:0;list-style:none}.ant-cascader-menus-empty,.ant-cascader-menus-hidden{display:none}.ant-cascader-menus.slide-up-appear.slide-up-appear-active.ant-cascader-menus-placement-bottomLeft,.ant-cascader-menus.slide-up-enter.slide-up-enter-active.ant-cascader-menus-placement-bottomLeft{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-cascader-menus.slide-up-appear.slide-up-appear-active.ant-cascader-menus-placement-topLeft,.ant-cascader-menus.slide-up-enter.slide-up-enter-active.ant-cascader-menus-placement-topLeft{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-cascader-menus.slide-up-leave.slide-up-leave-active.ant-cascader-menus-placement-bottomLeft{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-cascader-menus.slide-up-leave.slide-up-leave-active.ant-cascader-menus-placement-topLeft{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-cascader-menu{display:inline-block;min-width:111px;height:180px;margin:0;padding:4px 0;overflow:auto;vertical-align:top;list-style:none;border-right:1px solid #f0f0f0;-ms-overflow-style:-ms-autohiding-scrollbar}.ant-cascader-menu:first-child{border-radius:2px 0 0 2px}.ant-cascader-menu:last-child{margin-right:-1px;border-right-color:transparent;border-radius:0 2px 2px 0}.ant-cascader-menu:only-child{border-radius:2px}.ant-cascader-menu-item{padding:5px 12px;line-height:22px;white-space:nowrap;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-cascader-menu-item:hover{background:#f5f5f5}.ant-cascader-menu-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-cascader-menu-item-disabled:hover{background:transparent}.ant-cascader-menu-empty .ant-cascader-menu-item{color:rgba(0,0,0,.25);cursor:default;pointer-events:none}.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled),.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled):hover{font-weight:600;background-color:#e6f7ff}.ant-cascader-menu-item-expand{position:relative;padding-right:24px}.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-loading-icon{display:inline-block;font-size:10px;position:absolute;right:12px;color:rgba(0,0,0,.45)}.ant-cascader-menu-item .ant-cascader-menu-item-keyword{color:#ff4d4f}.ant-cascader-picker-rtl .ant-cascader-input.ant-input{padding-right:11px;padding-left:24px;text-align:right}.ant-cascader-picker-rtl{direction:rtl}.ant-cascader-picker-rtl .ant-cascader-picker-label{padding:0 12px 0 20px;text-align:right}.ant-cascader-picker-rtl .ant-cascader-picker-arrow,.ant-cascader-picker-rtl .ant-cascader-picker-clear{right:auto;left:12px}.ant-cascader-picker-rtl.ant-cascader-picker-small .ant-cascader-picker-arrow,.ant-cascader-picker-rtl.ant-cascader-picker-small .ant-cascader-picker-clear{right:auto;left:8px}.ant-cascader-menu-rtl{direction:rtl;border-right:none;border-left:1px solid #f0f0f0}.ant-cascader-menu-rtl:last-child{margin-right:0;margin-left:-1px;border-left-color:transparent;border-radius:0 0 4px 4px}.ant-cascader-menu-rtl .ant-cascader-menu-item-expand{padding-right:12px;padding-left:24px}.ant-cascader-menu-rtl .ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-rtl .ant-cascader-menu-item-loading-icon{right:auto;left:12px}.ant-input-affix-wrapper{position:relative;display:inline-block;width:100%;min-width:0;padding:4px 11px;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s;transition:all .3s;display:-ms-inline-flexbox;display:inline-flex}.ant-input-affix-wrapper::-moz-placeholder{opacity:1}.ant-input-affix-wrapper::-webkit-input-placeholder{color:#bfbfbf}.ant-input-affix-wrapper:-ms-input-placeholder{color:#bfbfbf}.ant-input-affix-wrapper::-ms-input-placeholder{color:#bfbfbf}.ant-input-affix-wrapper::placeholder{color:#bfbfbf}.ant-input-affix-wrapper:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-affix-wrapper:placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-input-rtl .ant-input-affix-wrapper:hover{border-right-width:0;border-left-width:1px!important}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-input-rtl .ant-input-affix-wrapper-focused,.ant-input-rtl .ant-input-affix-wrapper:focus{border-right-width:0;border-left-width:1px!important}.ant-input-affix-wrapper-disabled{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-input-affix-wrapper-disabled:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-input-affix-wrapper[disabled]{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-input-affix-wrapper[disabled]:hover{border-color:#d9d9d9;border-right-width:1px!important}textarea.ant-input-affix-wrapper{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;-webkit-transition:all .3s,height 0s;transition:all .3s,height 0s}.ant-input-affix-wrapper-lg{padding:6.5px 11px;font-size:16px}.ant-input-affix-wrapper-sm{padding:0 7px}.ant-input-affix-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper-disabled .ant-input[disabled]{background:transparent}.ant-input-affix-wrapper>input.ant-input{padding:0;border:none;outline:none}.ant-input-affix-wrapper>input.ant-input:focus{-webkit-box-shadow:none;box-shadow:none}.ant-input-affix-wrapper:before{width:0;visibility:hidden;content:"\a0"}.ant-input-prefix,.ant-input-suffix{display:-ms-flexbox;display:flex;-ms-flex:none;flex:none;-ms-flex-align:center;align-items:center}.ant-input-prefix{margin-right:4px}.ant-input-suffix{margin-left:4px}.ant-input-clear-icon{color:rgba(0,0,0,.25);font-size:12px;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;margin:0 4px;vertical-align:-1px}.ant-input-clear-icon:hover{color:rgba(0,0,0,.45)}.ant-input-clear-icon:active{color:rgba(0,0,0,.65)}.ant-input-clear-icon+i{margin-left:6px}.ant-input-clear-icon-hidden{visibility:hidden}.ant-input-clear-icon:last-child{margin-right:0}.ant-input-affix-wrapper-textarea-with-clear-btn{padding:0!important;border:0!important}.ant-input-textarea-clear-icon{color:rgba(0,0,0,.25);font-size:12px;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;position:absolute;top:0;right:0;z-index:1;margin:8px 8px 0 0}.ant-input-textarea-clear-icon:hover{color:rgba(0,0,0,.45)}.ant-input-textarea-clear-icon:active{color:rgba(0,0,0,.65)}.ant-input-textarea-clear-icon+i{margin-left:6px}.ant-input-textarea-clear-icon-hidden{visibility:hidden}.ant-input{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;width:100%;min-width:0;padding:4px 11px;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s;transition:all .3s}.ant-input::-moz-placeholder{opacity:1}.ant-input::-webkit-input-placeholder{color:#bfbfbf}.ant-input:-ms-input-placeholder{color:#bfbfbf}.ant-input::-ms-input-placeholder{color:#bfbfbf}.ant-input::placeholder{color:#bfbfbf}.ant-input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input:placeholder-shown{text-overflow:ellipsis}.ant-input:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-input-rtl .ant-input:hover{border-right-width:0;border-left-width:1px!important}.ant-input-focused,.ant-input:focus{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-input-rtl .ant-input-focused,.ant-input-rtl .ant-input:focus{border-right-width:0;border-left-width:1px!important}.ant-input-disabled{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-input-disabled:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-input[disabled]{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px!important}textarea.ant-input{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;-webkit-transition:all .3s,height 0s;transition:all .3s,height 0s}.ant-input-lg{padding:6.5px 11px;font-size:16px}.ant-input-sm{padding:0 7px}.ant-input-rtl{direction:rtl}.ant-input-group{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:table;width:100%;border-collapse:separate;border-spacing:0}.ant-input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.ant-input-group>[class*=col-]{padding-right:8px}.ant-input-group>[class*=col-]:last-child{padding-right:0}.ant-input-group-addon,.ant-input-group-wrap,.ant-input-group>.ant-input{display:table-cell}.ant-input-group-addon:not(:first-child):not(:last-child),.ant-input-group-wrap:not(:first-child):not(:last-child),.ant-input-group>.ant-input:not(:first-child):not(:last-child){border-radius:0}.ant-input-group-addon,.ant-input-group-wrap{width:1px;white-space:nowrap;vertical-align:middle}.ant-input-group-wrap>*{display:block!important}.ant-input-group .ant-input{float:left;width:100%;margin-bottom:0;text-align:inherit}.ant-input-group .ant-input:focus,.ant-input-group .ant-input:hover{z-index:1;border-right-width:1px}.ant-input-group-addon{position:relative;padding:0 11px;color:rgba(0,0,0,.65);font-weight:400;font-size:14px;text-align:center;background-color:#fafafa;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s;transition:all .3s}.ant-input-group-addon .ant-select{margin:-5px -11px}.ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{background-color:inherit;border:1px solid transparent;-webkit-box-shadow:none;box-shadow:none}.ant-input-group-addon .ant-select-focused .ant-select-selector,.ant-input-group-addon .ant-select-open .ant-select-selector{color:#1890ff}.ant-input-group-addon>i:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;content:""}.ant-input-group-addon:first-child,.ant-input-group-addon:first-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:first-child,.ant-input-group>.ant-input:first-child .ant-select .ant-select-selector{border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:first-child) .ant-input{border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:last-child) .ant-input{border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-group-addon:first-child{border-right:0}.ant-input-group-addon:last-child{border-left:0}.ant-input-group-addon:last-child,.ant-input-group-addon:last-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:last-child,.ant-input-group>.ant-input:last-child .ant-select .ant-select-selector{border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group-lg .ant-input,.ant-input-group-lg>.ant-input-group-addon{padding:6.5px 11px;font-size:16px}.ant-input-group-sm .ant-input,.ant-input-group-sm>.ant-input-group-addon{padding:0 7px}.ant-input-group-lg .ant-select-single .ant-select-selector{height:40px}.ant-input-group-sm .ant-select-single .ant-select-selector{height:24px}.ant-input-group .ant-input-affix-wrapper:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-group.ant-input-group-compact{display:block}.ant-input-group.ant-input-group-compact:before{display:table;content:""}.ant-input-group.ant-input-group-compact:after{display:table;clear:both;content:""}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child){border-right-width:1px}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):hover{z-index:1}.ant-input-group.ant-input-group-compact>*{display:inline-block;float:none;vertical-align:top;border-radius:0}.ant-input-group.ant-input-group-compact>.ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact>.ant-picker-range{display:-ms-inline-flexbox;display:inline-flex}.ant-input-group.ant-input-group-compact>:not(:last-child){margin-right:-1px;border-right-width:1px}.ant-input-group.ant-input-group-compact .ant-input{float:none}.ant-input-group.ant-input-group-compact>.ant-calendar-picker .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input,.ant-input-group.ant-input-group-compact>.ant-mention-wrapper .ant-mention-editor,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector,.ant-input-group.ant-input-group-compact>.ant-time-picker .ant-time-picker-input{border-right-width:1px;border-radius:0}.ant-input-group.ant-input-group-compact>.ant-calendar-picker .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-calendar-picker .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-mention-wrapper .ant-mention-editor:focus,.ant-input-group.ant-input-group-compact>.ant-mention-wrapper .ant-mention-editor:hover,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-focused,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-arrow,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:focus,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:hover,.ant-input-group.ant-input-group-compact>.ant-time-picker .ant-time-picker-input:focus,.ant-input-group.ant-input-group-compact>.ant-time-picker .ant-time-picker-input:hover{z-index:1}.ant-input-group.ant-input-group-compact>.ant-calendar-picker:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-mention-wrapper:first-child .ant-mention-editor,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>.ant-time-picker:first-child .ant-time-picker-input,.ant-input-group.ant-input-group-compact>:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-input-group.ant-input-group-compact>.ant-calendar-picker:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-mention-wrapper:last-child .ant-mention-editor,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>.ant-time-picker:last-child .ant-time-picker-input,.ant-input-group.ant-input-group-compact>:last-child{border-right-width:1px;border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input{vertical-align:top}.ant-input-group-rtl .ant-input-group-addon:first-child,.ant-input-group>.ant-input-rtl:first-child{border-radius:2px;border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group-rtl .ant-input-group-addon:first-child{border-right:1px solid #d9d9d9;border-left:0}.ant-input-group-rtl .ant-input-group-addon:last-child{border-right:0;border-left:1px solid #d9d9d9}.ant-input-group-rtl .ant-input-group-addon:last-child,.ant-input-group-rtl .ant-input-group>.ant-input:last-child{border-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:first-child){border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:not(:last-child){margin-right:0;margin-left:-1px;border-left-width:1px}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-calendar-picker:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-mention-wrapper:first-child .ant-mention-editor,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-time-picker:first-child .ant-time-picker-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:first-child{border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-calendar-picker:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-mention-wrapper:last-child .ant-mention-editor,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-time-picker:last-child .ant-time-picker-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:last-child{border-left-width:1px;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-input-group-wrapper{display:inline-block;width:100%;text-align:start;vertical-align:top}.ant-input-password-icon{color:rgba(0,0,0,.45);cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-input-password-icon:hover{color:rgba(0,0,0,.85)}.ant-input[type=color]{height:32px}.ant-input[type=color].ant-input-lg{height:40px}.ant-input[type=color].ant-input-sm{height:24px;padding-top:3px;padding-bottom:3px}.ant-input-search-icon{padding:0 9px}.ant-input-search-icon:before{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.ant-input-search-icon:after{width:32px}.ant-input-affix-wrapper-lg .ant-input-search-icon{padding:0 12px}.ant-input-affix-wrapper-lg .ant-input-search-icon:before{-webkit-transform:translateX(-13px);transform:translateX(-13px)}.ant-input-affix-wrapper-lg .ant-input-search-icon:after{width:40px}.ant-input-affix-wrapper-sm .ant-input-search-icon{padding:0 6px}.ant-input-affix-wrapper-sm .ant-input-search-icon:before{-webkit-transform:translateX(-7px);transform:translateX(-7px)}.ant-input-affix-wrapper-sm .ant-input-search-icon:after{width:24px}.ant-input-search-icon{margin-left:.5em;color:rgba(0,0,0,.45);cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-input-search-icon:hover{color:rgba(0,0,0,.85)}.ant-input-search-icon:before{position:absolute;top:0;bottom:0;display:block;border-left:1px solid #d9d9d9;-webkit-transition:all .3s;transition:all .3s;content:""}.ant-input-search-icon:after{position:absolute;top:0;right:0;bottom:0;content:""}.ant-input-search:not(.ant-input-search-enter-button){padding-right:0}.ant-input-search-enter-button input{border-right:0}.ant-input-search-enter-button input:focus,.ant-input-search-enter-button input:hover{border-color:#40a9ff}.ant-input-search-enter-button.ant-input-affix-wrapper{border-right:0}.ant-input-search-enter-button+.ant-input-group-addon,.ant-input-search-enter-button input+.ant-input-group-addon{padding:0;border:0}.ant-input-search-enter-button+.ant-input-group-addon .ant-input-search-button,.ant-input-search-enter-button input+.ant-input-group-addon .ant-input-search-button{border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group-rtl,.ant-input-group-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper.ant-input-affix-wrapper-rtl>input.ant-input{border:none;outline:none}.ant-input-affix-wrapper-rtl .ant-input-prefix{margin:0 0 0 4px}.ant-input-affix-wrapper-rtl .ant-input-suffix{margin:0 4px 0 0}.ant-input-affix-wrapper-rtl .ant-input-clear-icon:last-child{margin-right:4px;margin-left:0}.ant-input-affix-wrapper-rtl .ant-input-textarea-clear-icon{right:auto;left:0;margin:8px 0 0 8px}.ant-input-search-rtl{direction:rtl}.ant-input-search-rtl .ant-input-search-icon{margin-right:.5em;margin-left:0}.ant-input-search-rtl .ant-input-search-icon:before{border-left:none}.ant-input-search-rtl .ant-input-search-icon:after{right:auto;left:0;border-right:1px solid #d9d9d9;-webkit-transition:all .3s;transition:all .3s}.ant-input-search-rtl.ant-input-search:not(.ant-input-search-enter-button){padding-right:11px;padding-left:0}.ant-input-search-rtl.ant-input-search-enter-button input{border-right:1px solid #d9d9d9;border-left:0}.ant-input-search-rtl.ant-input-search-enter-button input:focus,.ant-input-search-rtl.ant-input-search-enter-button input:hover{border-color:#40a9ff}.ant-input-search-rtl.ant-input-search-enter-button.ant-input-affix-wrapper{border-right:1px solid #d9d9d9;border-left:0}.ant-input-search-rtl.ant-input-search-enter-button.ant-input-affix-wrapper:focus,.ant-input-search-rtl.ant-input-search-enter-button.ant-input-affix-wrapper:hover{border-color:#40a9ff}.ant-input-search-rtl.ant-input-search-enter-button+.ant-input-group-addon .ant-input-search-button,.ant-input-search-rtl.ant-input-search-enter-button input+.ant-input-group-addon .ant-input-search-button{width:100%;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-checkbox{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;top:-.09em;display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;outline:none;cursor:pointer}.ant-checkbox-input:focus+.ant-checkbox-inner,.ant-checkbox-wrapper:hover .ant-checkbox-inner,.ant-checkbox:hover .ant-checkbox-inner{border-color:#1890ff}.ant-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #1890ff;border-radius:2px;visibility:hidden;-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;content:""}.ant-checkbox-wrapper:hover .ant-checkbox:after,.ant-checkbox:hover:after{visibility:visible}.ant-checkbox-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;direction:ltr;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;border-collapse:separate;-webkit-transition:all .3s;transition:all .3s}.ant-checkbox-inner:after{position:absolute;top:50%;left:22%;display:table;width:5.71428571px;height:9.14285714px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(0) translate(-50%,-50%);transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;-webkit-transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:" "}.ant-checkbox-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0}.ant-checkbox-checked .ant-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1) translate(-50%,-50%);transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;-webkit-transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:" "}.ant-checkbox-checked .ant-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-checkbox-disabled{cursor:not-allowed}.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner:after{border-color:rgba(0,0,0,.25);-webkit-animation-name:none;animation-name:none}.ant-checkbox-disabled .ant-checkbox-input{cursor:not-allowed}.ant-checkbox-disabled .ant-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-checkbox-disabled .ant-checkbox-inner:after{border-color:#f5f5f5;border-collapse:separate;-webkit-animation-name:none;animation-name:none}.ant-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-checkbox-disabled:hover:after,.ant-checkbox-wrapper:hover .ant-checkbox-disabled:after{visibility:hidden}.ant-checkbox-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset;cursor:pointer}.ant-checkbox-wrapper.ant-checkbox-wrapper-disabled{cursor:not-allowed}.ant-checkbox-wrapper+.ant-checkbox-wrapper{margin-left:8px}.ant-checkbox+span{padding-right:8px;padding-left:8px}.ant-checkbox-group{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block}.ant-checkbox-group-item{display:inline-block;margin-right:8px}.ant-checkbox-group-item:last-child{margin-right:0}.ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:0}.ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-checkbox-indeterminate .ant-checkbox-inner:after{top:50%;left:50%;width:8px;height:8px;background-color:#1890ff;border:0;-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1);opacity:1;content:" "}.ant-checkbox-indeterminate.ant-checkbox-disabled .ant-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-checkbox-rtl{direction:rtl}.ant-checkbox-group-rtl .ant-checkbox-group-item{margin-right:0;margin-left:8px}.ant-checkbox-group-rtl .ant-checkbox-group-item:last-child{margin-left:0!important}.ant-checkbox-group-rtl .ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:8px}.ant-collapse{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";background-color:#fafafa;border:1px solid #d9d9d9;border-bottom:0;border-radius:2px}.ant-collapse>.ant-collapse-item{border-bottom:1px solid #d9d9d9}.ant-collapse>.ant-collapse-item:last-child,.ant-collapse>.ant-collapse-item:last-child>.ant-collapse-header{border-radius:0 0 2px 2px}.ant-collapse>.ant-collapse-item>.ant-collapse-header{position:relative;padding:12px 16px 12px 40px;color:rgba(0,0,0,.85);line-height:1.5715;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-collapse>.ant-collapse-item>.ant-collapse-header:before{display:table;content:""}.ant-collapse>.ant-collapse-item>.ant-collapse-header:after{display:table;clear:both;content:""}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:50%;left:16px;display:inline-block;font-size:12px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow>*{line-height:1}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{display:inline-block}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow:before{display:none}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow .ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow-icon{display:block}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{-webkit-transition:-webkit-transform .24s;transition:-webkit-transform .24s;transition:transform .24s;transition:transform .24s,-webkit-transform .24s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{float:right}.ant-collapse>.ant-collapse-item>.ant-collapse-header:focus{outline:none}.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:12px}.ant-collapse-icon-position-right>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px}.ant-collapse-icon-position-right>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{right:16px;left:auto}.ant-collapse-anim-active{-webkit-transition:height .2s cubic-bezier(.215,.61,.355,1);transition:height .2s cubic-bezier(.215,.61,.355,1)}.ant-collapse-content{overflow:hidden;color:rgba(0,0,0,.65);background-color:#fff;border-top:1px solid #d9d9d9}.ant-collapse-content>.ant-collapse-content-box{padding:16px}.ant-collapse-content-inactive{display:none}.ant-collapse-item:last-child>.ant-collapse-content{border-radius:0 0 2px 2px}.ant-collapse-borderless{background-color:#fafafa;border:0}.ant-collapse-borderless>.ant-collapse-item{border-bottom:1px solid #d9d9d9}.ant-collapse-borderless>.ant-collapse-item:last-child,.ant-collapse-borderless>.ant-collapse-item:last-child .ant-collapse-header{border-radius:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:4px}.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header,.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header>.arrow{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-collapse-rtl{direction:rtl}.ant-collapse-rtl .ant-collapse>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{float:left}.ant-collapse-rtl.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-right:12px;padding-left:0}.ant-comment{position:relative;background-color:inherit}.ant-comment-inner{display:-ms-flexbox;display:flex;padding:16px 0}.ant-comment-avatar{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-right:12px;cursor:pointer}.ant-comment-avatar img{width:32px;height:32px;border-radius:50%}.ant-comment-content{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;min-width:1px;font-size:14px;word-wrap:break-word}.ant-comment-content-author{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start;margin-bottom:4px;font-size:14px}.ant-comment-content-author>a,.ant-comment-content-author>span{padding-right:8px;font-size:12px;line-height:18px}.ant-comment-content-author-name{color:rgba(0,0,0,.45);font-size:14px;-webkit-transition:color .3s;transition:color .3s}.ant-comment-content-author-name>*,.ant-comment-content-author-name>:hover{color:rgba(0,0,0,.45)}.ant-comment-content-author-time{color:#ccc;white-space:nowrap;cursor:auto}.ant-comment-content-detail p{margin-bottom:inherit;white-space:pre-wrap}.ant-comment-actions{margin-top:12px;margin-bottom:inherit;padding-left:0}.ant-comment-actions>li{display:inline-block;color:rgba(0,0,0,.45)}.ant-comment-actions>li>span{padding-right:10px;color:rgba(0,0,0,.45);font-size:12px;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-comment-actions>li>span:hover{color:#595959}.ant-comment-nested{margin-left:44px}.ant-comment-rtl{direction:rtl}.ant-comment-rtl .ant-comment-avatar{margin-right:0;margin-left:12px}.ant-comment-rtl .ant-comment-content-author>a,.ant-comment-rtl .ant-comment-content-author>span{padding-right:0;padding-left:8px}.ant-comment-rtl .ant-comment-actions{padding-right:0}.ant-comment-rtl .ant-comment-actions>li>span{padding-right:0;padding-left:10px}.ant-comment-rtl .ant-comment-nested{margin-right:44px;margin-left:0}.ant-descriptions-title{margin-bottom:20px;color:rgba(0,0,0,.85);font-weight:700;font-size:16px;line-height:1.5715}.ant-descriptions-view{width:100%;overflow:hidden;border-radius:2px}.ant-descriptions-view table{width:100%;table-layout:fixed}.ant-descriptions-row>td,.ant-descriptions-row>th{padding-bottom:16px}.ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-item-label{color:rgba(0,0,0,.85);font-weight:400;font-size:14px;line-height:1.5715}.ant-descriptions-item-label:after{position:relative;top:-.5px;margin:0 8px 0 2px;content:" "}.ant-descriptions-item-colon:after{content:":"}.ant-descriptions-item-no-label:after{margin:0;content:""}.ant-descriptions-item-content{display:table-cell;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715}.ant-descriptions-item{padding-bottom:0}.ant-descriptions-item>span{display:inline-block}.ant-descriptions-middle .ant-descriptions-row>td,.ant-descriptions-middle .ant-descriptions-row>th{padding-bottom:12px}.ant-descriptions-small .ant-descriptions-row>td,.ant-descriptions-small .ant-descriptions-row>th{padding-bottom:8px}.ant-descriptions-bordered .ant-descriptions-view{border:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-view>table{table-layout:auto}.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-bordered .ant-descriptions-item-label{padding:16px 24px;border-right:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-right:none}.ant-descriptions-bordered .ant-descriptions-item-label{background-color:#fafafa}.ant-descriptions-bordered .ant-descriptions-item-label:after{display:none}.ant-descriptions-bordered .ant-descriptions-row{border-bottom:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-label{padding:12px 24px}.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-label{padding:8px 16px}.ant-descriptions-rtl{direction:rtl}.ant-descriptions-rtl .ant-descriptions-item-label:after{margin:0 2px 0 8px}.ant-divider{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";border-top:1px solid #f0f0f0}.ant-divider-vertical{position:relative;top:-.06em;display:inline-block;height:.9em;margin:0 8px;vertical-align:middle;border-top:0;border-left:1px solid #f0f0f0}.ant-divider-horizontal{display:-ms-flexbox;display:flex;clear:both;width:100%;min-width:100%;margin:24px 0}.ant-divider-horizontal.ant-divider-with-text{display:-ms-flexbox;display:flex;margin:16px 0;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;white-space:nowrap;text-align:center;border-top:0}.ant-divider-horizontal.ant-divider-with-text:after,.ant-divider-horizontal.ant-divider-with-text:before{position:relative;top:50%;width:50%;border-top:1px solid #f0f0f0;-webkit-transform:translateY(50%);transform:translateY(50%);content:""}.ant-divider-horizontal.ant-divider-with-text-left:before{top:50%;width:5%}.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-horizontal.ant-divider-with-text-right:before{top:50%;width:95%}.ant-divider-horizontal.ant-divider-with-text-right:after{top:50%;width:5%}.ant-divider-inner-text{display:inline-block;padding:0 1em}.ant-divider-dashed{background:none;border:dashed #f0f0f0;border-width:1px 0 0}.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed{border-top:0}.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:after,.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:before{border-style:dashed none none}.ant-divider-vertical.ant-divider-dashed{border-width:0 0 0 1px}.ant-divider-plain.ant-divider-with-text{color:rgba(0,0,0,.65);font-weight:400;font-size:14px}.ant-divider-rtl{direction:rtl}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:before{width:95%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:before{width:5%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:after{width:95%}.ant-drawer{position:fixed;z-index:1000;width:0;height:100%;-webkit-transition:height 0s ease .3s,width 0s ease .3s,-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:height 0s ease .3s,width 0s ease .3s,-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),height 0s ease .3s,width 0s ease .3s;transition:transform .3s cubic-bezier(.7,.3,.1,1),height 0s ease .3s,width 0s ease .3s,-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer>*{-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1),-webkit-box-shadow .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1),-webkit-box-shadow .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),box-shadow .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),box-shadow .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1),-webkit-box-shadow .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-content-wrapper{position:absolute;width:100%;height:100%}.ant-drawer .ant-drawer-content{width:100%;height:100%}.ant-drawer-left,.ant-drawer-right{top:0;width:0;height:100%}.ant-drawer-left .ant-drawer-content-wrapper,.ant-drawer-right .ant-drawer-content-wrapper{height:100%}.ant-drawer-left.ant-drawer-open,.ant-drawer-right.ant-drawer-open{width:100%;-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-left,.ant-drawer-left .ant-drawer-content-wrapper{left:0}.ant-drawer-left.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:6px 0 16px -8px rgba(0,0,0,.08),9px 0 28px 0 rgba(0,0,0,.05),12px 0 48px 16px rgba(0,0,0,.03);box-shadow:6px 0 16px -8px rgba(0,0,0,.08),9px 0 28px 0 rgba(0,0,0,.05),12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right,.ant-drawer-right .ant-drawer-content-wrapper{right:0}.ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:-6px 0 16px -8px rgba(0,0,0,.08),-9px 0 28px 0 rgba(0,0,0,.05),-12px 0 48px 16px rgba(0,0,0,.03);box-shadow:-6px 0 16px -8px rgba(0,0,0,.08),-9px 0 28px 0 rgba(0,0,0,.05),-12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right.ant-drawer-open.no-mask{right:1px;-webkit-transform:translateX(1px);transform:translateX(1px)}.ant-drawer-bottom,.ant-drawer-top{left:0;width:100%;height:0%}.ant-drawer-bottom .ant-drawer-content-wrapper,.ant-drawer-top .ant-drawer-content-wrapper{width:100%}.ant-drawer-bottom.ant-drawer-open,.ant-drawer-top.ant-drawer-open{height:100%;-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-top{top:0}.ant-drawer-top.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:0 6px 16px -8px rgba(0,0,0,.08),0 9px 28px 0 rgba(0,0,0,.05),0 12px 48px 16px rgba(0,0,0,.03);box-shadow:0 6px 16px -8px rgba(0,0,0,.08),0 9px 28px 0 rgba(0,0,0,.05),0 12px 48px 16px rgba(0,0,0,.03)}.ant-drawer-bottom,.ant-drawer-bottom .ant-drawer-content-wrapper{bottom:0}.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:0 -6px 16px -8px rgba(0,0,0,.08),0 -9px 28px 0 rgba(0,0,0,.05),0 -12px 48px 16px rgba(0,0,0,.03);box-shadow:0 -6px 16px -8px rgba(0,0,0,.08),0 -9px 28px 0 rgba(0,0,0,.05),0 -12px 48px 16px rgba(0,0,0,.03)}.ant-drawer-bottom.ant-drawer-open.no-mask{bottom:1px;-webkit-transform:translateY(1px);transform:translateY(1px)}.ant-drawer.ant-drawer-open .ant-drawer-mask{height:100%;opacity:1;-webkit-transition:none;transition:none;-webkit-animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1);animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-title{margin:0;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;line-height:22px}.ant-drawer-content{position:relative;z-index:1;overflow:auto;background-color:#fff;background-clip:padding-box;border:0}.ant-drawer-close{position:absolute;top:0;right:0;z-index:10;display:block;padding:20px;color:rgba(0,0,0,.45);font-weight:700;font-size:16px;font-style:normal;line-height:1;text-align:center;text-transform:none;text-decoration:none;background:transparent;border:0;outline:0;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;text-rendering:auto}.ant-drawer-close:focus,.ant-drawer-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-drawer-header-no-title .ant-drawer-close{margin-right:0;margin-right:var(--scroll-bar);padding-right:20px;padding-right:calc(20px - var(--scroll-bar))}.ant-drawer-header{position:relative;padding:16px 24px;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0}.ant-drawer-header,.ant-drawer-header-no-title{color:rgba(0,0,0,.65);background:#fff}.ant-drawer-wrapper-body{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:100%;height:100%}.ant-drawer-body{-ms-flex-positive:1;flex-grow:1;padding:24px;overflow:auto;font-size:14px;line-height:1.5715;word-wrap:break-word}.ant-drawer-footer{-ms-flex-negative:0;flex-shrink:0;padding:10px;border-top:1px solid #f0f0f0}.ant-drawer-mask{position:absolute;top:0;left:0;width:100%;height:0;background-color:rgba(0,0,0,.45);opacity:0;filter:alpha(opacity=45);-webkit-transition:opacity .3s linear,height 0s ease .3s;transition:opacity .3s linear,height 0s ease .3s}.ant-drawer-open-content{-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-drawer .ant-picker-clear{background:#fff}@-webkit-keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}.ant-drawer-rtl{direction:rtl}.ant-drawer-rtl .ant-drawer-close{right:auto;left:0}.ant-form-item .ant-mentions,.ant-form-item textarea.ant-input{height:auto}.ant-form-item .ant-upload{background:transparent}.ant-form-item .ant-upload.ant-upload-drag{background:#fafafa}.ant-form-item input[type=checkbox],.ant-form-item input[type=radio]{width:14px;height:14px}.ant-form-item .ant-checkbox-inline,.ant-form-item .ant-radio-inline{display:inline-block;margin-left:8px;font-weight:400;vertical-align:middle;cursor:pointer}.ant-form-item .ant-checkbox-inline:first-child,.ant-form-item .ant-radio-inline:first-child{margin-left:0}.ant-form-item .ant-checkbox-vertical,.ant-form-item .ant-radio-vertical{display:block}.ant-form-item .ant-checkbox-vertical+.ant-checkbox-vertical,.ant-form-item .ant-radio-vertical+.ant-radio-vertical{margin-left:0}.ant-form-item .ant-input-number+.ant-form-text{margin-left:8px}.ant-form-item .ant-input-number-handler-wrap{z-index:2}.ant-form-item .ant-cascader-picker,.ant-form-item .ant-select{width:100%}.ant-form-item .ant-input-group .ant-cascader-picker,.ant-form-item .ant-input-group .ant-select{width:auto}.ant-form-inline{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.ant-form-inline .ant-form-item{-ms-flex:none;flex:none;-ms-flex-wrap:nowrap;flex-wrap:nowrap;margin-right:16px;margin-bottom:0}.ant-form-inline .ant-form-item-with-help{margin-bottom:24px}.ant-form-inline .ant-form-item>.ant-form-item-control,.ant-form-inline .ant-form-item>.ant-form-item-label{display:inline-block;vertical-align:top}.ant-form-inline .ant-form-item .ant-form-item-has-feedback,.ant-form-inline .ant-form-item .ant-form-text{display:inline-block}.ant-form-horizontal .ant-form-item-label{-ms-flex-positive:0;flex-grow:0}.ant-form-horizontal .ant-form-item-control{-ms-flex:1 1 0px;flex:1 1}.ant-form-vertical .ant-form-item{-ms-flex-direction:column;flex-direction:column}.ant-form-vertical .ant-form-item-label>label{height:auto}.ant-col-24.ant-form-item-label,.ant-col-xl-24.ant-form-item-label,.ant-form-vertical .ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-24.ant-form-item-label>label,.ant-col-xl-24.ant-form-item-label>label,.ant-form-vertical .ant-form-item-label>label{margin:0}.ant-col-24.ant-form-item-label>label:after,.ant-col-xl-24.ant-form-item-label>label:after,.ant-form-vertical .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-24.ant-form-item-label,.ant-form-rtl.ant-col-xl-24.ant-form-item-label,.ant-form-rtl.ant-form-vertical .ant-form-item-label{text-align:right}@media (max-width:575px){.ant-form-item .ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-form-item .ant-form-item-label>label{margin:0}.ant-form-item .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-form-item .ant-form-item-label{text-align:right}.ant-form .ant-form-item{-ms-flex-wrap:wrap;flex-wrap:wrap}.ant-form .ant-form-item .ant-form-item-control,.ant-form .ant-form-item .ant-form-item-label{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.ant-col-xs-24.ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-xs-24.ant-form-item-label>label{margin:0}.ant-col-xs-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xs-24.ant-form-item-label{text-align:right}}@media (max-width:767px){.ant-col-sm-24.ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-sm-24.ant-form-item-label>label{margin:0}.ant-col-sm-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-sm-24.ant-form-item-label{text-align:right}}@media (max-width:991px){.ant-col-md-24.ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-md-24.ant-form-item-label>label{margin:0}.ant-col-md-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-md-24.ant-form-item-label{text-align:right}}@media (max-width:1199px){.ant-col-lg-24.ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-lg-24.ant-form-item-label>label{margin:0}.ant-col-lg-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-lg-24.ant-form-item-label{text-align:right}}@media (max-width:1599px){.ant-col-xl-24.ant-form-item-label{margin:0;padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-xl-24.ant-form-item-label>label{margin:0}.ant-col-xl-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xl-24.ant-form-item-label{text-align:right}}.ant-form-item-has-feedback .ant-input{padding-right:24px}.ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-right:18px}.ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{right:28px}.ant-form-item-has-feedback .ant-switch{margin:2px 0 4px}.ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection__clear,.ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-item-has-feedback>.ant-select .ant-select-selection__clear{right:28px}.ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-right:42px}.ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-right:17px}.ant-form-item-has-feedback .ant-cascader-picker-clear{right:28px}.ant-form-item-has-feedback .ant-picker,.ant-form-item-has-feedback .ant-picker-large{padding-right:29.2px}.ant-form-item-has-feedback .ant-picker-small{padding-right:25.2px}.ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:20px;margin-top:-10px;font-size:14px;line-height:20px;text-align:center;visibility:visible;-webkit-animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);pointer-events:none}.ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon svg,.ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon svg,.ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon svg,.ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon svg{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto}.ant-form-item-has-success.ant-form-item-has-feedback .ant-form-item-children-icon{color:#52c41a;-webkit-animation-name:diffZoomIn1!important;animation-name:diffZoomIn1!important}.ant-form-item-has-warning .ant-form-item-explain,.ant-form-item-has-warning .ant-form-item-split{color:#faad14}.ant-form-item-has-warning .ant-input,.ant-form-item-has-warning .ant-input-affix-wrapper,.ant-form-item-has-warning .ant-input-affix-wrapper:hover,.ant-form-item-has-warning .ant-input:hover{background-color:#fff;border-color:#faad14}.ant-form-item-has-warning .ant-input-affix-wrapper-focused,.ant-form-item-has-warning .ant-input-affix-wrapper:focus,.ant-form-item-has-warning .ant-input-focused,.ant-form-item-has-warning .ant-input:focus{border-color:#ffc53d;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(250,173,20,.2);box-shadow:0 0 0 2px rgba(250,173,20,.2)}.ant-form-item-has-warning .ant-input-affix-wrapper:not([disabled]):hover,.ant-form-item-has-warning .ant-input:not([disabled]):hover{border-color:#faad14}.ant-form-item-has-warning .ant-input-affix-wrapper input:focus{-webkit-box-shadow:none!important;box-shadow:none!important}.ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input{border-color:#ffc53d;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(250,173,20,.2);box-shadow:0 0 0 2px rgba(250,173,20,.2)}.ant-form-item-has-warning .ant-input-prefix{color:#faad14}.ant-form-item-has-warning .ant-input-group-addon{color:#faad14;background-color:#fff;border-color:#faad14}.ant-form-item-has-warning .has-feedback{color:#faad14}.ant-form-item-has-warning.ant-form-item-has-feedback .ant-form-item-children-icon{color:#faad14;-webkit-animation-name:diffZoomIn3!important;animation-name:diffZoomIn3!important}.ant-form-item-has-warning .ant-select:not(.ant-select-borderless) .ant-select-selector{border-color:#faad14!important}.ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector,.ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector{border-color:#ffc53d;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(250,173,20,.2);box-shadow:0 0 0 2px rgba(250,173,20,.2)}.ant-form-item-has-warning .ant-input-number,.ant-form-item-has-warning .ant-picker{border-color:#faad14}.ant-form-item-has-warning .ant-input-number-focused,.ant-form-item-has-warning .ant-input-number:focus,.ant-form-item-has-warning .ant-picker-focused,.ant-form-item-has-warning .ant-picker:focus{border-color:#ffc53d;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(250,173,20,.2);box-shadow:0 0 0 2px rgba(250,173,20,.2)}.ant-form-item-has-warning .ant-input-number:not([disabled]):hover,.ant-form-item-has-warning .ant-picker:not([disabled]):hover{border-color:#faad14}.ant-form-item-has-warning .ant-cascader-picker:focus .ant-cascader-input{border-color:#ffc53d;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(250,173,20,.2);box-shadow:0 0 0 2px rgba(250,173,20,.2)}.ant-form-item-has-error .ant-form-item-explain,.ant-form-item-has-error .ant-form-item-split{color:#ff4d4f}.ant-form-item-has-error .ant-input,.ant-form-item-has-error .ant-input-affix-wrapper,.ant-form-item-has-error .ant-input-affix-wrapper:hover,.ant-form-item-has-error .ant-input:hover{background-color:#fff;border-color:#ff4d4f}.ant-form-item-has-error .ant-input-affix-wrapper-focused,.ant-form-item-has-error .ant-input-affix-wrapper:focus,.ant-form-item-has-error .ant-input-focused,.ant-form-item-has-error .ant-input:focus{border-color:#ff7875;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(255,77,79,.2);box-shadow:0 0 0 2px rgba(255,77,79,.2)}.ant-form-item-has-error .ant-input-affix-wrapper:not([disabled]):hover,.ant-form-item-has-error .ant-input:not([disabled]):hover{border-color:#ff4d4f}.ant-form-item-has-error .ant-input-affix-wrapper input:focus{-webkit-box-shadow:none!important;box-shadow:none!important}.ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input{border-color:#ff7875;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(255,77,79,.2);box-shadow:0 0 0 2px rgba(255,77,79,.2)}.ant-form-item-has-error .ant-input-prefix{color:#ff4d4f}.ant-form-item-has-error .ant-input-group-addon{color:#ff4d4f;background-color:#fff;border-color:#ff4d4f}.ant-form-item-has-error .has-feedback{color:#ff4d4f}.ant-form-item-has-error.ant-form-item-has-feedback .ant-form-item-children-icon{color:#ff4d4f;-webkit-animation-name:diffZoomIn2!important;animation-name:diffZoomIn2!important}.ant-form-item-has-error .ant-select:not(.ant-select-borderless) .ant-select-selector{border-color:#ff4d4f!important}.ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector,.ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector{border-color:#ff7875;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(255,77,79,.2);box-shadow:0 0 0 2px rgba(255,77,79,.2)}.ant-form-item-has-error .ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{border:0}.ant-form-item-has-error .ant-input-number,.ant-form-item-has-error .ant-picker,.ant-form-item-has-error .ant-select.ant-select-auto-complete .ant-input:focus{border-color:#ff4d4f}.ant-form-item-has-error .ant-input-number-focused,.ant-form-item-has-error .ant-input-number:focus,.ant-form-item-has-error .ant-picker-focused,.ant-form-item-has-error .ant-picker:focus{border-color:#ff7875;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(255,77,79,.2);box-shadow:0 0 0 2px rgba(255,77,79,.2)}.ant-form-item-has-error .ant-input-number:not([disabled]):hover,.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor,.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover,.ant-form-item-has-error .ant-picker:not([disabled]):hover{border-color:#ff4d4f}.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input,.ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor,.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus{border-color:#ff7875;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(255,77,79,.2);box-shadow:0 0 0 2px rgba(255,77,79,.2)}.ant-form-item-has-error .ant-transfer-list{border-color:#ff4d4f}.ant-form-item-has-error .ant-transfer-list-search:not([disabled]){border-color:#d9d9d9}.ant-form-item-has-error .ant-transfer-list-search:not([disabled]):hover{border-color:#40a9ff;border-right-width:1px!important}.ant-form-item-has-error .ant-transfer-list-search:not([disabled]):focus{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-form-item-has-error-leave .ant-form-item-explain{color:#ff4d4f}.ant-form-item-is-validating.ant-form-item-has-feedback .ant-form-item-children-icon{display:inline-block;color:#1890ff}.ant-form{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}.ant-form legend{display:block;width:100%;margin-bottom:20px;padding:0;color:rgba(0,0,0,.45);font-size:16px;line-height:inherit;border:0;border-bottom:1px solid #d9d9d9}.ant-form label{font-size:14px}.ant-form input[type=search]{-webkit-box-sizing:border-box;box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{display:block;padding-top:15px;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715}.ant-form .ant-form-text{display:inline-block;padding-right:8px}.ant-form-small .ant-form-item-label>label{height:24px}.ant-form-small .ant-form-item-control-input{min-height:24px}.ant-form-large .ant-form-item-label>label{height:40px}.ant-form-large .ant-form-item-control-input{min-height:40px}.ant-form-item{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";margin:0 0 24px;vertical-align:top}.ant-form-item-with-help{margin-bottom:0}.ant-form-item-label{display:inline-block;-ms-flex-positive:0;flex-grow:0;overflow:hidden;white-space:nowrap;text-align:right;vertical-align:middle}.ant-form-item-label-left{text-align:left}.ant-form-item-label>label{position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:32px;color:rgba(0,0,0,.85);font-size:14px}.ant-form-item-label>label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-label>label.ant-form-item-required:before{display:inline-block;margin-right:4px;color:#ff4d4f;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:"*"}.ant-form-hide-required-mark .ant-form-item-label>label.ant-form-item-required:before{display:none}.ant-form-item-label>label:after{content:":";position:relative;top:-.5px;margin:0 8px 0 2px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:" "}.ant-form-item-control{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-positive:1;flex-grow:1}.ant-form-item-control:first-child:not([class^=ant-col-]):not([class*=" ant-col-"]){width:100%}.ant-form-item-control-input{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:32px}.ant-form-item-control-input-content{-ms-flex:auto;flex:auto;max-width:100%}.ant-form-item-explain,.ant-form-item-extra{clear:both;min-height:24px;padding-top:0;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;-webkit-transition:color .3s cubic-bezier(.215,.61,.355,1);transition:color .3s cubic-bezier(.215,.61,.355,1)}.show-help-appear,.show-help-enter,.show-help-leave{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.show-help-appear.show-help-appear-active,.show-help-enter.show-help-enter-active{-webkit-animation-name:antShowHelpIn;animation-name:antShowHelpIn;-webkit-animation-play-state:running;animation-play-state:running}.show-help-leave.show-help-leave-active{-webkit-animation-name:antShowHelpOut;animation-name:antShowHelpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.show-help-appear,.show-help-enter{opacity:0}.show-help-appear,.show-help-enter,.show-help-leave{-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1)}@-webkit-keyframes antShowHelpIn{0%{-webkit-transform:translateY(-5px);transform:translateY(-5px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes antShowHelpIn{0%{-webkit-transform:translateY(-5px);transform:translateY(-5px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes antShowHelpOut{to{-webkit-transform:translateY(-5px);transform:translateY(-5px);opacity:0}}@keyframes antShowHelpOut{to{-webkit-transform:translateY(-5px);transform:translateY(-5px);opacity:0}}@-webkit-keyframes diffZoomIn1{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes diffZoomIn1{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes diffZoomIn2{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes diffZoomIn2{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes diffZoomIn3{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes diffZoomIn3{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}.ant-form-rtl{direction:rtl}.ant-form-rtl .ant-form-item-label{text-align:left}.ant-form-rtl .ant-form-item-label>label.ant-form-item-required:before{margin-right:0;margin-left:4px}.ant-form-rtl .ant-form-item-label>label:after{margin:0 2px 0 8px}.ant-col-rtl .ant-form-item-control:first-child{width:100%}.ant-form-rtl .ant-form-item-has-feedback .ant-input{padding-right:11px;padding-left:24px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-right:11px;padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input{padding:0}.ant-form-rtl .ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{right:auto;left:28px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-number{padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection__clear,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection__clear{right:auto;left:28px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-right:0;padding-left:42px}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-right:0;margin-left:17px}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-clear{right:auto;left:28px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker,.ant-form-rtl .ant-form-item-has-feedback .ant-picker-large{padding-right:11px;padding-left:29.2px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker-small{padding-right:7px;padding-left:25.2px}.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{right:auto;left:0}.ant-form-rtl.ant-form-inline .ant-form-item{margin-right:0;margin-left:16px}.ant-input-number{-webkit-box-sizing:border-box;box-sizing:border-box;font-variant:tabular-nums;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;width:100%;min-width:0;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715;background-color:#fff;background-image:none;-webkit-transition:all .3s;transition:all .3s;display:inline-block;width:90px;margin:0;padding:0;border:1px solid #d9d9d9;border-radius:2px}.ant-input-number::-moz-placeholder{opacity:1}.ant-input-number::-webkit-input-placeholder{color:#bfbfbf}.ant-input-number:-ms-input-placeholder{color:#bfbfbf}.ant-input-number::-ms-input-placeholder{color:#bfbfbf}.ant-input-number::placeholder{color:#bfbfbf}.ant-input-number:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number:placeholder-shown{text-overflow:ellipsis}.ant-input-number-focused,.ant-input-number:focus{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-input-number[disabled]{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-input-number[disabled]:hover{border-color:#d9d9d9;border-right-width:1px!important}textarea.ant-input-number{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;-webkit-transition:all .3s,height 0s;transition:all .3s,height 0s}.ant-input-number-lg{padding:6.5px 11px}.ant-input-number-sm{padding:0 7px}.ant-input-number-handler{position:relative;display:block;width:100%;height:50%;overflow:hidden;color:rgba(0,0,0,.45);font-weight:700;line-height:0;text-align:center;-webkit-transition:all .1s linear;transition:all .1s linear}.ant-input-number-handler:active{background:#f4f4f4}.ant-input-number-handler:hover .ant-input-number-handler-down-inner,.ant-input-number-handler:hover .ant-input-number-handler-up-inner{color:#40a9ff}.ant-input-number-handler-down-inner,.ant-input-number-handler-up-inner{display:inline-block;color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;right:4px;width:12px;height:12px;color:rgba(0,0,0,.45);line-height:12px;-webkit-transition:all .1s linear;transition:all .1s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number-handler-down-inner>*,.ant-input-number-handler-up-inner>*{line-height:1}.ant-input-number-handler-down-inner svg,.ant-input-number-handler-up-inner svg{display:inline-block}.ant-input-number-handler-down-inner:before,.ant-input-number-handler-up-inner:before{display:none}.ant-input-number-handler-down-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-down-inner .ant-input-number-handler-up-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-up-inner-icon{display:block}.ant-input-number:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-input-number:hover+.ant-form-item-children-icon{opacity:0;-webkit-transition:opacity .24s linear .24s;transition:opacity .24s linear .24s}.ant-input-number-focused{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-input-number-disabled{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-input-number-disabled:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-input-number-disabled .ant-input-number-input{cursor:not-allowed}.ant-input-number-disabled .ant-input-number-handler-wrap{display:none}.ant-input-number-input{width:100%;height:30px;padding:0 11px;text-align:left;background-color:transparent;border:0;border-radius:2px;outline:0;-webkit-transition:all .3s linear;transition:all .3s linear;-moz-appearance:textfield!important}.ant-input-number-input::-moz-placeholder{opacity:1}.ant-input-number-input::-webkit-input-placeholder{color:#bfbfbf}.ant-input-number-input:-ms-input-placeholder{color:#bfbfbf}.ant-input-number-input::-ms-input-placeholder{color:#bfbfbf}.ant-input-number-input::placeholder{color:#bfbfbf}.ant-input-number-input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number-input:placeholder-shown{text-overflow:ellipsis}.ant-input-number-input[type=number]::-webkit-inner-spin-button,.ant-input-number-input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.ant-input-number-lg{padding:0;font-size:16px}.ant-input-number-lg input{height:38px}.ant-input-number-sm{padding:0}.ant-input-number-sm input{height:22px;padding:0 7px}.ant-input-number-handler-wrap{position:absolute;top:0;right:0;width:22px;height:100%;background:#fff;border-left:1px solid #d9d9d9;border-radius:0 2px 2px 0;opacity:0;-webkit-transition:opacity .24s linear .1s;transition:opacity .24s linear .1s}.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-down-inner,.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-up-inner{display:inline-block;font-size:7px;min-width:auto;margin-right:0}.ant-input-number-handler-wrap:hover .ant-input-number-handler{height:40%}.ant-input-number:hover .ant-input-number-handler-wrap{opacity:1}.ant-input-number-handler-up{border-top-right-radius:2px;cursor:pointer}.ant-input-number-handler-up-inner{top:50%;margin-top:-5px;text-align:center}.ant-input-number-handler-up:hover{height:60%!important}.ant-input-number-handler-down{top:0;border-top:1px solid #d9d9d9;border-bottom-right-radius:2px;cursor:pointer}.ant-input-number-handler-down-inner{top:50%;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ant-input-number-handler-down:hover{height:60%!important}.ant-input-number-handler-down-disabled,.ant-input-number-handler-up-disabled{cursor:not-allowed}.ant-input-number-handler-down-disabled:hover .ant-input-number-handler-down-inner,.ant-input-number-handler-up-disabled:hover .ant-input-number-handler-up-inner{color:rgba(0,0,0,.25)}.ant-input-number-rtl{direction:rtl}.ant-input-number-rtl .ant-input-number-handler-wrap{right:auto;left:0;border-right:1px solid #d9d9d9;border-left:0;border-radius:2px 0 0 2px}.ant-input-number-rtl .ant-input-number-input{direction:rtl;text-align:right}.ant-layout{display:-ms-flexbox;display:flex;-ms-flex:auto;flex:auto;-ms-flex-direction:column;flex-direction:column;min-height:0;background:#f0f2f5}.ant-layout,.ant-layout *{-webkit-box-sizing:border-box;box-sizing:border-box}.ant-layout.ant-layout-has-sider{-ms-flex-direction:row;flex-direction:row}.ant-layout.ant-layout-has-sider>.ant-layout,.ant-layout.ant-layout-has-sider>.ant-layout-content{overflow-x:hidden}.ant-layout-footer,.ant-layout-header{-ms-flex:0 0 auto;flex:0 0 auto}.ant-layout-header{height:64px;padding:0 50px;color:rgba(0,0,0,.65);line-height:64px;background:#001529}.ant-layout-footer{padding:24px 50px;color:rgba(0,0,0,.65);font-size:14px;background:#f0f2f5}.ant-layout-content{-ms-flex:auto;flex:auto;min-height:0}.ant-layout-sider{position:relative;min-width:0;background:#001529;-webkit-transition:all .2s;transition:all .2s}.ant-layout-sider-children{height:100%;margin-top:-.1px;padding-top:.1px}.ant-layout-sider-has-trigger{padding-bottom:48px}.ant-layout-sider-right{-ms-flex-order:1;order:1}.ant-layout-sider-trigger{position:fixed;bottom:0;z-index:1;height:48px;color:#fff;line-height:48px;text-align:center;background:#002140;cursor:pointer;-webkit-transition:all .2s;transition:all .2s}.ant-layout-sider-zero-width>*{overflow:hidden}.ant-layout-sider-zero-width-trigger{position:absolute;top:64px;right:-36px;z-index:1;width:36px;height:42px;color:#fff;font-size:18px;line-height:42px;text-align:center;background:#001529;border-radius:0 2px 2px 0;cursor:pointer;-webkit-transition:background .3s ease;transition:background .3s ease}.ant-layout-sider-zero-width-trigger:hover{background:#192c3e}.ant-layout-sider-zero-width-trigger-right{left:-36px;border-radius:2px 0 0 2px}.ant-layout-sider-light{background:#fff}.ant-layout-sider-light .ant-layout-sider-trigger,.ant-layout-sider-light .ant-layout-sider-zero-width-trigger{color:rgba(0,0,0,.65);background:#fff}.ant-layout-rtl{direction:rtl}.ant-list{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative}.ant-list *{outline:none}.ant-list-pagination{margin-top:24px;text-align:right}.ant-list-pagination .ant-pagination-options{text-align:left}.ant-list-more{margin-top:12px;text-align:center}.ant-list-more button{padding-right:32px;padding-left:32px}.ant-list-spin{min-height:40px;text-align:center}.ant-list-empty-text{padding:16px;color:rgba(0,0,0,.25);font-size:14px;text-align:center}.ant-list-items{margin:0;padding:0;list-style:none}.ant-list-item{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:12px 0}.ant-list-item-content{color:rgba(0,0,0,.65)}.ant-list-item-meta{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1 1;-ms-flex-align:start;align-items:flex-start;font-size:0}.ant-list-item-meta-avatar{margin-right:16px}.ant-list-item-meta-content{-ms-flex:1 0;flex:1 0}.ant-list-item-meta-title{margin-bottom:4px;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715}.ant-list-item-meta-title>a{color:rgba(0,0,0,.65);-webkit-transition:all .3s;transition:all .3s}.ant-list-item-meta-title>a:hover{color:#1890ff}.ant-list-item-meta-description{color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715}.ant-list-item-action{-ms-flex:0 0 auto;flex:0 0 auto;margin-left:48px;padding:0;font-size:0;list-style:none}.ant-list-item-action>li{position:relative;display:inline-block;padding:0 8px;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;text-align:center;cursor:pointer}.ant-list-item-action>li:first-child{padding-left:0}.ant-list-item-action-split{position:absolute;top:50%;right:0;width:1px;height:14px;margin-top:-7px;background-color:#f0f0f0}.ant-list-footer,.ant-list-header{background:transparent}.ant-list-footer,.ant-list-header{padding-top:12px;padding-bottom:12px}.ant-list-empty{padding:16px 0;color:rgba(0,0,0,.45);font-size:12px;text-align:center}.ant-list-split .ant-list-item{border-bottom:1px solid #f0f0f0}.ant-list-split .ant-list-item:last-child{border-bottom:none}.ant-list-split .ant-list-header{border-bottom:1px solid #f0f0f0}.ant-list-split.ant-list-empty .ant-list-footer{border-top:1px solid #f0f0f0}.ant-list-loading .ant-list-spin-nested-loading{min-height:32px}.ant-list-split.ant-list-something-after-last-item .ant-spin-container>.ant-list-items>.ant-list-item:last-child{border-bottom:1px solid #f0f0f0}.ant-list-lg .ant-list-item{padding:16px 24px}.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-vertical .ant-list-item{-ms-flex-align:initial;align-items:normal}.ant-list-vertical .ant-list-item-main{display:block;-ms-flex:1;flex:1 1}.ant-list-vertical .ant-list-item-extra{margin-left:40px}.ant-list-vertical .ant-list-item-meta{margin-bottom:16px}.ant-list-vertical .ant-list-item-meta-title{margin-bottom:12px;color:rgba(0,0,0,.85);font-size:16px;line-height:24px}.ant-list-vertical .ant-list-item-action{margin-top:16px;margin-left:auto}.ant-list-vertical .ant-list-item-action>li{padding:0 16px}.ant-list-vertical .ant-list-item-action>li:first-child{padding-left:0}.ant-list-grid .ant-col>.ant-list-item{display:block;max-width:100%;margin-bottom:16px;padding-top:0;padding-bottom:0;border-bottom:none}.ant-list-item-no-flex{display:block}.ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:right}.ant-list-bordered{border:1px solid #d9d9d9;border-radius:2px}.ant-list-bordered .ant-list-footer,.ant-list-bordered .ant-list-header,.ant-list-bordered .ant-list-item{padding-right:24px;padding-left:24px}.ant-list-bordered .ant-list-pagination{margin:16px 24px}.ant-list-bordered.ant-list-sm .ant-list-footer,.ant-list-bordered.ant-list-sm .ant-list-header,.ant-list-bordered.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-bordered.ant-list-lg .ant-list-footer,.ant-list-bordered.ant-list-lg .ant-list-header,.ant-list-bordered.ant-list-lg .ant-list-item{padding:16px 24px}@media screen and (max-width:768px){.ant-list-item-action,.ant-list-vertical .ant-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ant-list-item{-ms-flex-wrap:wrap;flex-wrap:wrap}.ant-list-item-action{margin-left:12px}.ant-list-vertical .ant-list-item{-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}.ant-list-vertical .ant-list-item-main{min-width:220px}.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-list-rtl{direction:rtl;text-align:right}.ant-list-rtl .ReactVirtualized__List .ant-list-item{direction:rtl}.ant-list-rtl .ant-list-pagination{text-align:left}.ant-list-rtl .ant-list-item-meta-avatar{margin-right:0;margin-left:16px}.ant-list-rtl .ant-list-item-action{margin-right:48px;margin-left:0}.ant-list-rtl .ant-list-item-action>li:first-child{padding-right:0;padding-left:8px}.ant-list-rtl .ant-list-item-action-split{right:auto;left:0}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin-right:40px;margin-left:0}.ant-list-rtl.ant-list-vertical .ant-list-item-action{margin-right:auto}.ant-list-rtl .ant-list-vertical .ant-list-item-action>li:first-child{padding-right:0;padding-left:16px}.ant-list-rtl .ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:left}@media screen and (max-width:768px){.ant-list-rtl .ant-list-item-action,.ant-list-rtl .ant-list-vertical .ant-list-item-extra{margin-right:24px;margin-left:0}}@media screen and (max-width:576px){.ant-list-rtl .ant-list-item-action{margin-right:22px;margin-left:0}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-spin{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:absolute;display:none;color:#1890ff;text-align:center;vertical-align:middle;opacity:0;-webkit-transition:-webkit-transform .3s cubic-bezier(.78,.14,.15,.86);transition:-webkit-transform .3s cubic-bezier(.78,.14,.15,.86);transition:transform .3s cubic-bezier(.78,.14,.15,.86);transition:transform .3s cubic-bezier(.78,.14,.15,.86),-webkit-transform .3s cubic-bezier(.78,.14,.15,.86)}.ant-spin-spinning{position:static;display:inline-block;opacity:1}.ant-spin-nested-loading{position:relative}.ant-spin-nested-loading>div>.ant-spin{position:absolute;top:0;left:0;z-index:4;display:block;width:100%;height:100%;max-height:400px}.ant-spin-nested-loading>div>.ant-spin .ant-spin-dot{position:absolute;top:50%;left:50%;margin:-10px}.ant-spin-nested-loading>div>.ant-spin .ant-spin-text{position:absolute;top:50%;width:100%;padding-top:5px;text-shadow:0 1px 2px #fff}.ant-spin-nested-loading>div>.ant-spin.ant-spin-show-text .ant-spin-dot{margin-top:-20px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-dot{margin:-7px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-text{padding-top:2px}.ant-spin-nested-loading>div>.ant-spin-sm.ant-spin-show-text .ant-spin-dot{margin-top:-17px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-dot{margin:-16px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-text{padding-top:11px}.ant-spin-nested-loading>div>.ant-spin-lg.ant-spin-show-text .ant-spin-dot{margin-top:-26px}.ant-spin-container{position:relative;-webkit-transition:opacity .3s;transition:opacity .3s}.ant-spin-container:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;display:none\9;width:100%;height:100%;background:#fff;opacity:0;-webkit-transition:all .3s;transition:all .3s;content:"";pointer-events:none}.ant-spin-blur{clear:both;overflow:hidden;opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.ant-spin-blur:after{opacity:.4;pointer-events:auto}.ant-spin-tip{color:rgba(0,0,0,.45)}.ant-spin-dot{position:relative;display:inline-block;font-size:20px;width:1em;height:1em}.ant-spin-dot-item{position:absolute;display:block;width:9px;height:9px;background-color:#1890ff;border-radius:100%;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;opacity:.3;-webkit-animation:antSpinMove 1s linear infinite alternate;animation:antSpinMove 1s linear infinite alternate}.ant-spin-dot-item:first-child{top:0;left:0}.ant-spin-dot-item:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.ant-spin-dot-item:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.ant-spin-dot-item:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}.ant-spin-dot-spin{-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-animation:antRotate 1.2s linear infinite;animation:antRotate 1.2s linear infinite}.ant-spin-sm .ant-spin-dot{font-size:14px}.ant-spin-sm .ant-spin-dot i{width:6px;height:6px}.ant-spin-lg .ant-spin-dot{font-size:32px}.ant-spin-lg .ant-spin-dot i{width:14px;height:14px}.ant-spin.ant-spin-show-text .ant-spin-text{display:block}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.ant-spin-blur{background:#fff;opacity:.5}}@-webkit-keyframes antSpinMove{to{opacity:1}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}.ant-spin-rtl{direction:rtl}.ant-spin-rtl .ant-spin-dot-spin{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-animation-name:antRotateRtl;animation-name:antRotateRtl}@-webkit-keyframes antRotateRtl{to{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@keyframes antRotateRtl{to{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}.ant-pagination{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}.ant-pagination,.ant-pagination ol,.ant-pagination ul{margin:0;padding:0;list-style:none}.ant-pagination:after{display:block;clear:both;height:0;overflow:hidden;visibility:hidden;content:" "}.ant-pagination-item,.ant-pagination-total-text{display:inline-block;height:32px;margin-right:8px;line-height:30px;vertical-align:middle}.ant-pagination-item{min-width:32px;font-family:Arial;text-align:center;list-style:none;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;outline:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-item a{display:block;padding:0 6px;color:rgba(0,0,0,.65);-webkit-transition:none;transition:none}.ant-pagination-item a:hover{text-decoration:none}.ant-pagination-item:focus,.ant-pagination-item:hover{border-color:#1890ff;-webkit-transition:all .3s;transition:all .3s}.ant-pagination-item:focus a,.ant-pagination-item:hover a{color:#1890ff}.ant-pagination-item-active{font-weight:500;background:#fff;border-color:#1890ff}.ant-pagination-item-active a{color:#1890ff}.ant-pagination-item-active:focus,.ant-pagination-item-active:hover{border-color:#40a9ff}.ant-pagination-item-active:focus a,.ant-pagination-item-active:hover a{color:#40a9ff}.ant-pagination-jump-next,.ant-pagination-jump-prev{outline:0}.ant-pagination-jump-next .ant-pagination-item-container,.ant-pagination-jump-prev .ant-pagination-item-container{position:relative}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon{color:#1890ff;font-size:12px;letter-spacing:-1px;opacity:0;-webkit-transition:all .2s;transition:all .2s}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon-svg,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon-svg{top:0;right:0;bottom:0;left:0;margin:auto}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis{position:absolute;top:0;right:0;bottom:0;left:0;display:block;margin:auto;color:rgba(0,0,0,.25);letter-spacing:2px;text-align:center;text-indent:.13em;opacity:1;-webkit-transition:all .2s;transition:all .2s}.ant-pagination-jump-next:focus .ant-pagination-item-link-icon,.ant-pagination-jump-next:hover .ant-pagination-item-link-icon,.ant-pagination-jump-prev:focus .ant-pagination-item-link-icon,.ant-pagination-jump-prev:hover .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:focus .ant-pagination-item-ellipsis,.ant-pagination-jump-next:hover .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:focus .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:hover .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-prev{margin-right:8px}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-next,.ant-pagination-prev{display:inline-block;min-width:32px;height:32px;color:rgba(0,0,0,.65);font-family:Arial;line-height:32px;text-align:center;vertical-align:middle;list-style:none;border-radius:2px;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-pagination-next,.ant-pagination-prev{outline:0}.ant-pagination-next a,.ant-pagination-prev a{color:rgba(0,0,0,.65);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-next:hover a,.ant-pagination-prev:hover a{border-color:#40a9ff}.ant-pagination-next .ant-pagination-item-link,.ant-pagination-prev .ant-pagination-item-link{display:block;height:100%;font-size:12px;text-align:center;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;outline:none;-webkit-transition:all .3s;transition:all .3s}.ant-pagination-next:focus .ant-pagination-item-link,.ant-pagination-next:hover .ant-pagination-item-link,.ant-pagination-prev:focus .ant-pagination-item-link,.ant-pagination-prev:hover .ant-pagination-item-link{color:#1890ff;border-color:#1890ff}.ant-pagination-disabled,.ant-pagination-disabled:focus,.ant-pagination-disabled:hover{cursor:not-allowed}.ant-pagination-disabled .ant-pagination-item-link,.ant-pagination-disabled:focus .ant-pagination-item-link,.ant-pagination-disabled:focus a,.ant-pagination-disabled:hover .ant-pagination-item-link,.ant-pagination-disabled:hover a,.ant-pagination-disabled a{color:rgba(0,0,0,.25);border-color:#d9d9d9;cursor:not-allowed}.ant-pagination-slash{margin:0 10px 0 5px}.ant-pagination-options{display:inline-block;margin-left:16px;vertical-align:middle}@media (-ms-high-contrast:none){.ant-pagination-options,.ant-pagination-options ::-ms-backdrop{vertical-align:top}}.ant-pagination-options-size-changer.ant-select{display:inline-block;width:auto;margin-right:8px}.ant-pagination-options-quick-jumper{display:inline-block;height:32px;line-height:32px;vertical-align:top}.ant-pagination-options-quick-jumper input{position:relative;display:inline-block;width:100%;min-width:0;padding:4px 11px;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5715;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s;transition:all .3s;width:50px;margin:0 8px}.ant-pagination-options-quick-jumper input::-moz-placeholder{opacity:1}.ant-pagination-options-quick-jumper input::-webkit-input-placeholder{color:#bfbfbf}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{color:#bfbfbf}.ant-pagination-options-quick-jumper input::-ms-input-placeholder{color:#bfbfbf}.ant-pagination-options-quick-jumper input::placeholder{color:#bfbfbf}.ant-pagination-options-quick-jumper input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-pagination-options-quick-jumper input-focused,.ant-pagination-options-quick-jumper input:focus{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-pagination-options-quick-jumper input-disabled{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input-disabled:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-pagination-options-quick-jumper input[disabled]{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px!important}textarea.ant-pagination-options-quick-jumper input{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;-webkit-transition:all .3s,height 0s;transition:all .3s,height 0s}.ant-pagination-options-quick-jumper input-lg{padding:6.5px 11px;font-size:16px}.ant-pagination-options-quick-jumper input-sm{padding:0 7px}.ant-pagination-simple .ant-pagination-next,.ant-pagination-simple .ant-pagination-prev{height:24px;line-height:24px;vertical-align:top}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link{height:24px;background-color:transparent;border:0}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination-simple .ant-pagination-simple-pager{display:inline-block;height:24px;margin-right:8px}.ant-pagination-simple .ant-pagination-simple-pager input{-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;margin-right:8px;padding:0 6px;text-align:center;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;outline:none;-webkit-transition:border-color .3s;transition:border-color .3s}.ant-pagination-simple .ant-pagination-simple-pager input:hover{border-color:#1890ff}.ant-pagination.mini .ant-pagination-simple-pager,.ant-pagination.mini .ant-pagination-total-text{height:24px;line-height:24px}.ant-pagination.mini .ant-pagination-item{min-width:24px;height:24px;margin:0;line-height:22px}.ant-pagination.mini .ant-pagination-item:not(.ant-pagination-item-active){background:transparent;border-color:transparent}.ant-pagination.mini .ant-pagination-next,.ant-pagination.mini .ant-pagination-prev{min-width:24px;height:24px;margin:0;line-height:24px}.ant-pagination.mini .ant-pagination-next .ant-pagination-item-link,.ant-pagination.mini .ant-pagination-prev .ant-pagination-item-link{background:transparent;border-color:transparent}.ant-pagination.mini .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination.mini .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination.mini .ant-pagination-jump-next,.ant-pagination.mini .ant-pagination-jump-prev{height:24px;margin-right:0;line-height:24px}.ant-pagination.mini .ant-pagination-options{margin-left:2px}.ant-pagination.mini .ant-pagination-options-size-changer{top:0}.ant-pagination.mini .ant-pagination-options-quick-jumper{height:24px;line-height:24px}.ant-pagination.mini .ant-pagination-options-quick-jumper input{padding:0 7px;width:44px}.ant-pagination.ant-pagination-disabled{cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item{background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item a{color:rgba(0,0,0,.25);background:transparent;border:none;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active{background:#dbdbdb;border-color:transparent}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active a{color:#fff}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link,.ant-pagination.ant-pagination-disabled .ant-pagination-item-link:focus,.ant-pagination.ant-pagination-disabled .ant-pagination-item-link:hover{color:rgba(0,0,0,.45);background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-jump-next:focus .ant-pagination-item-link-icon,.ant-pagination.ant-pagination-disabled .ant-pagination-jump-next:hover .ant-pagination-item-link-icon,.ant-pagination.ant-pagination-disabled .ant-pagination-jump-prev:focus .ant-pagination-item-link-icon,.ant-pagination.ant-pagination-disabled .ant-pagination-jump-prev:hover .ant-pagination-item-link-icon{opacity:0}.ant-pagination.ant-pagination-disabled .ant-pagination-jump-next:focus .ant-pagination-item-ellipsis,.ant-pagination.ant-pagination-disabled .ant-pagination-jump-next:hover .ant-pagination-item-ellipsis,.ant-pagination.ant-pagination-disabled .ant-pagination-jump-prev:focus .ant-pagination-item-ellipsis,.ant-pagination.ant-pagination-disabled .ant-pagination-jump-prev:hover .ant-pagination-item-ellipsis{opacity:1}@media only screen and (max-width:992px){.ant-pagination-item-after-jump-prev,.ant-pagination-item-before-jump-next{display:none}}@media only screen and (max-width:576px){.ant-pagination-options{display:none}}.ant-pagination-rtl{direction:rtl}.ant-pagination-rtl .ant-pagination-item,.ant-pagination-rtl .ant-pagination-jump-next,.ant-pagination-rtl .ant-pagination-jump-prev,.ant-pagination-rtl .ant-pagination-prev,.ant-pagination-rtl .ant-pagination-total-text{margin-right:0;margin-left:8px}.ant-pagination-rtl .ant-pagination-slash{margin:0 5px 0 10px}.ant-pagination-rtl .ant-pagination-options{margin-right:16px;margin-left:0}.ant-pagination-rtl .ant-pagination-options-size-changer.ant-select,.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager,.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager input{margin-right:0;margin-left:8px}.ant-pagination-rtl.ant-pagination.mini .ant-pagination-options{margin-right:2px;margin-left:0}.ant-mentions{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";width:100%;min-width:0;color:rgba(0,0,0,.65);font-size:14px;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;-webkit-transition:all .3s;transition:all .3s;position:relative;display:inline-block;height:auto;padding:0;overflow:hidden;line-height:1.5715;white-space:pre-wrap;vertical-align:bottom}.ant-mentions::-moz-placeholder{opacity:1}.ant-mentions::-webkit-input-placeholder{color:#bfbfbf}.ant-mentions:-ms-input-placeholder{color:#bfbfbf}.ant-mentions::-ms-input-placeholder{color:#bfbfbf}.ant-mentions::placeholder{color:#bfbfbf}.ant-mentions:-moz-placeholder-shown{text-overflow:ellipsis}.ant-mentions:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions:placeholder-shown{text-overflow:ellipsis}.ant-mentions-focused,.ant-mentions:focus,.ant-mentions:hover{border-color:#40a9ff;border-right-width:1px!important}.ant-mentions-focused,.ant-mentions:focus{outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-mentions-disabled{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-mentions-disabled:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-mentions[disabled]{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-mentions[disabled]:hover{border-color:#d9d9d9;border-right-width:1px!important}textarea.ant-mentions{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;-webkit-transition:all .3s,height 0s;transition:all .3s,height 0s}.ant-mentions-lg{padding:6.5px 11px;font-size:16px}.ant-mentions-sm{padding:0 7px}.ant-mentions-disabled>textarea{color:rgba(0,0,0,.25);background-color:#f5f5f5;cursor:not-allowed;opacity:1}.ant-mentions-disabled>textarea:hover{border-color:#d9d9d9;border-right-width:1px!important}.ant-mentions-focused{border-color:#40a9ff;border-right-width:1px!important;outline:0;-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-mentions-measure,.ant-mentions>textarea{min-height:30px;margin:0;padding:4px 11px;overflow:inherit;overflow-x:hidden;overflow-y:auto;font-weight:inherit;font-size:inherit;font-family:inherit;font-style:inherit;-webkit-font-feature-settings:inherit;font-feature-settings:inherit;font-variant:inherit;font-size-adjust:inherit;font-stretch:inherit;line-height:inherit;direction:inherit;letter-spacing:inherit;white-space:inherit;text-align:inherit;vertical-align:top;word-wrap:break-word;word-break:inherit;-moz-tab-size:inherit;-o-tab-size:inherit;tab-size:inherit}.ant-mentions>textarea{width:100%;border:none;outline:none;resize:none}.ant-mentions>textarea::-moz-placeholder{opacity:1}.ant-mentions>textarea::-webkit-input-placeholder{color:#bfbfbf}.ant-mentions>textarea:-ms-input-placeholder{color:#bfbfbf}.ant-mentions>textarea::-ms-input-placeholder{color:#bfbfbf}.ant-mentions>textarea::placeholder{color:#bfbfbf}.ant-mentions>textarea:-moz-placeholder-shown{text-overflow:ellipsis}.ant-mentions>textarea:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions>textarea:placeholder-shown{text-overflow:ellipsis}.ant-mentions>textarea:-moz-read-only{cursor:default}.ant-mentions>textarea:read-only{cursor:default}.ant-mentions-measure{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;color:transparent;pointer-events:none}.ant-mentions-measure>span{display:inline-block;min-height:1em}.ant-mentions-dropdown{margin:0;padding:0;color:rgba(0,0,0,.65);font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum",;position:absolute;top:-9999px;left:-9999px;z-index:1050;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px;font-variant:normal;background-color:#fff;border-radius:2px;outline:none;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-mentions-dropdown-hidden{display:none}.ant-mentions-dropdown-menu{max-height:250px;margin-bottom:0;padding-left:0;overflow:auto;list-style:none;outline:none}.ant-mentions-dropdown-menu-item{position:relative;display:block;min-width:100px;padding:5px 12px;overflow:hidden;color:rgba(0,0,0,.65);font-weight:400;line-height:1.5715;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;-webkit-transition:background .3s ease;transition:background .3s ease}.ant-mentions-dropdown-menu-item:hover{background-color:#f5f5f5}.ant-mentions-dropdown-menu-item:first-child{border-radius:2px 2px 0 0}.ant-mentions-dropdown-menu-item:last-child{border-radius:0 0 2px 2px}.ant-mentions-dropdown-menu-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-mentions-dropdown-menu-item-disabled:hover{color:rgba(0,0,0,.25);background-color:#fff;cursor:not-allowed}.ant-mentions-dropdown-menu-item-selected{color:rgba(0,0,0,.65);font-weight:600;background-color:#fafafa}.ant-mentions-dropdown-menu-item-active{background-color:#f5f5f5}.ant-mentions-rtl{direction:rtl}.ant-message{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:fixed;top:16px;left:0;z-index:1010;width:100%;pointer-events:none}.ant-message-notice{padding:8px;text-align:center}.ant-message-notice:first-child{margin-top:-8px}.ant-message-notice-content{display:inline-block;padding:10px 16px;background:#fff;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);pointer-events:all}.ant-message-success .anticon{color:#52c41a}.ant-message-error .anticon{color:#ff4d4f}.ant-message-warning .anticon{color:#faad14}.ant-message-info .anticon,.ant-message-loading .anticon{color:#1890ff}.ant-message .anticon{position:relative;top:1px;margin-right:8px;font-size:16px}.ant-message-notice.move-up-leave.move-up-leave-active{-webkit-animation-name:MessageMoveOut;animation-name:MessageMoveOut;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ant-message-rtl,.ant-message-rtl span{direction:rtl}.ant-message-rtl .anticon{margin-right:0;margin-left:8px}.ant-modal{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;top:100px;width:auto;margin:0 auto;padding:0 0 24px;pointer-events:none}.ant-modal-wrap{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;overflow:auto;outline:0;-webkit-overflow-scrolling:touch}.ant-modal-title{margin:0;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;line-height:22px;word-wrap:break-word}.ant-modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:0;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);pointer-events:auto}.ant-modal-close{position:absolute;top:0;right:0;z-index:10;padding:0;color:rgba(0,0,0,.45);font-weight:700;line-height:1;text-decoration:none;background:transparent;border:0;outline:0;cursor:pointer;-webkit-transition:color .3s;transition:color .3s}.ant-modal-close-x{display:block;width:56px;height:56px;font-size:16px;font-style:normal;line-height:56px;text-align:center;text-transform:none;text-rendering:auto}.ant-modal-close:focus,.ant-modal-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-modal-header{padding:16px 24px;color:rgba(0,0,0,.65);background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0}.ant-modal-body{padding:24px;font-size:14px;line-height:1.5715;word-wrap:break-word}.ant-modal-footer{padding:10px 16px;text-align:right;background:transparent;border-top:1px solid #f0f0f0;border-radius:0 0 2px 2px}.ant-modal-footer button+button{margin-bottom:0;margin-left:8px}.ant-modal.zoom-appear,.ant-modal.zoom-enter{-webkit-transform:none;transform:none;opacity:0;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;height:100%;background-color:rgba(0,0,0,.45);filter:alpha(opacity=50)}.ant-modal-mask-hidden{display:none}.ant-modal-open{overflow:hidden}.ant-modal-centered{text-align:center}.ant-modal-centered:before{display:inline-block;width:0;height:100%;vertical-align:middle;content:""}.ant-modal-centered .ant-modal{top:0;display:inline-block;text-align:left;vertical-align:middle}@media (max-width:767px){.ant-modal{max-width:calc(100vw - 16px);margin:8px auto}.ant-modal-centered .ant-modal{-ms-flex:1;flex:1 1}}.ant-modal-confirm .ant-modal-close,.ant-modal-confirm .ant-modal-header{display:none}.ant-modal-confirm .ant-modal-body{padding:32px 32px 24px}.ant-modal-confirm-body-wrapper:before{display:table;content:""}.ant-modal-confirm-body-wrapper:after{display:table;clear:both;content:""}.ant-modal-confirm-body .ant-modal-confirm-title{display:block;overflow:hidden;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;line-height:1.4}.ant-modal-confirm-body .ant-modal-confirm-content{margin-top:8px;color:rgba(0,0,0,.65);font-size:14px}.ant-modal-confirm-body>.anticon{float:left;margin-right:16px;font-size:22px}.ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:38px}.ant-modal-confirm .ant-modal-confirm-btns{float:right;margin-top:24px}.ant-modal-confirm .ant-modal-confirm-btns button+button{margin-bottom:0;margin-left:8px}.ant-modal-confirm-error .ant-modal-confirm-body>.anticon{color:#ff4d4f}.ant-modal-confirm-confirm .ant-modal-confirm-body>.anticon,.ant-modal-confirm-warning .ant-modal-confirm-body>.anticon{color:#faad14}.ant-modal-confirm-info .ant-modal-confirm-body>.anticon{color:#1890ff}.ant-modal-confirm-success .ant-modal-confirm-body>.anticon{color:#52c41a}.ant-modal-wrap-rtl{direction:rtl}.ant-modal-wrap-rtl .ant-modal-close{right:auto;left:0}.ant-modal-wrap-rtl .ant-modal-footer{text-align:left}.ant-modal-wrap-rtl .ant-modal-footer button+button{margin-right:8px;margin-left:0}.ant-modal-wrap-rtl.ant-modal-centered .ant-modal{text-align:right}.ant-notification{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:fixed;z-index:1010;width:384px;max-width:calc(100vw - 32px);margin:0 24px 0 0}.ant-notification-bottomLeft,.ant-notification-topLeft{margin-right:0;margin-left:24px}.ant-notification-bottomLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-bottomLeft .ant-notification-fade-enter.ant-notification-fade-enter-active,.ant-notification-topLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-topLeft .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationLeftFadeIn;animation-name:NotificationLeftFadeIn}.ant-notification-close-icon{font-size:14px;cursor:pointer}.ant-notification-hook-holder,.ant-notification-notice{position:relative;margin-bottom:16px;overflow:hidden;background:#fff;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-notification-hook-holder>.ant-notification-notice{margin-bottom:0;-webkit-box-shadow:none;box-shadow:none}.ant-notification-notice{padding:16px 24px;line-height:1.5715}.ant-notification-notice-message{display:inline-block;margin-bottom:8px;color:rgba(0,0,0,.85);font-size:16px;line-height:24px}.ant-notification-notice-message-single-line-auto-margin{display:block;width:calc(264px - 100%);max-width:4px;background-color:transparent;pointer-events:none}.ant-notification-notice-message-single-line-auto-margin:before{display:block;content:""}.ant-notification-notice-description{font-size:14px}.ant-notification-notice-closable .ant-notification-notice-message{padding-right:24px}.ant-notification-notice-with-icon .ant-notification-notice-message{margin-bottom:4px;margin-left:48px;font-size:16px}.ant-notification-notice-with-icon .ant-notification-notice-description{margin-left:48px;font-size:14px}.ant-notification-notice-icon{position:absolute;margin-left:4px;font-size:24px;line-height:24px}.anticon.ant-notification-notice-icon-success{color:#52c41a}.anticon.ant-notification-notice-icon-info{color:#1890ff}.anticon.ant-notification-notice-icon-warning{color:#faad14}.anticon.ant-notification-notice-icon-error{color:#ff4d4f}.ant-notification-notice-close{position:absolute;top:16px;right:22px;color:rgba(0,0,0,.45);outline:none}.ant-notification-notice-close:hover{color:rgba(0,0,0,.67)}.ant-notification-notice-btn{float:right;margin-top:16px}.ant-notification .notification-fade-effect{-webkit-animation-duration:.24s;animation-duration:.24s;-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-notification-fade-appear,.ant-notification-fade-enter{opacity:0;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-notification-fade-appear,.ant-notification-fade-enter,.ant-notification-fade-leave{-webkit-animation-duration:.24s;animation-duration:.24s;-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-notification-fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationFadeIn;animation-name:NotificationFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-notification-fade-leave.ant-notification-fade-leave-active{-webkit-animation-name:NotificationFadeOut;animation-name:NotificationFadeOut;-webkit-animation-play-state:running;animation-play-state:running}@-webkit-keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@-webkit-keyframes NotificationLeftFadeIn{0%{right:384px;opacity:0}to{right:0;opacity:1}}@keyframes NotificationLeftFadeIn{0%{right:384px;opacity:0}to{right:0;opacity:1}}@-webkit-keyframes NotificationFadeOut{0%{max-height:150px;margin-bottom:16px;padding-top:16px;padding-bottom:16px;opacity:1}to{max-height:0;margin-bottom:0;padding-top:0;padding-bottom:0;opacity:0}}@keyframes NotificationFadeOut{0%{max-height:150px;margin-bottom:16px;padding-top:16px;padding-bottom:16px;opacity:1}to{max-height:0;margin-bottom:0;padding-top:0;padding-bottom:0;opacity:0}}.ant-notification-rtl{direction:rtl}.ant-notification-rtl .ant-notification-notice-closable .ant-notification-notice-message{padding-right:0;padding-left:24px}.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-description,.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-message{margin-right:48px;margin-left:0}.ant-notification-rtl .ant-notification-notice-icon{margin-right:4px;margin-left:0}.ant-notification-rtl .ant-notification-notice-close{right:auto;left:22px}.ant-notification-rtl .ant-notification-notice-btn{float:left}.ant-page-header{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;padding:16px 24px;background-color:#fff}.ant-page-header-ghost{background-color:inherit}.ant-page-header.has-breadcrumb{padding-top:12px}.ant-page-header.has-footer{padding-bottom:0}.ant-page-header-back{margin-right:16px;font-size:16px;line-height:1}.ant-page-header-back-button{color:#1890ff;text-decoration:none;outline:none;-webkit-transition:color .3s;transition:color .3s;color:#000;cursor:pointer}.ant-page-header-back-button:focus,.ant-page-header-back-button:hover{color:#40a9ff}.ant-page-header-back-button:active{color:#096dd9}.ant-page-header .ant-divider-vertical{height:14px;margin:0 12px;vertical-align:middle}.ant-breadcrumb+.ant-page-header-heading{margin-top:8px}.ant-page-header-heading{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.ant-page-header-heading-left{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:4px 0;overflow:hidden}.ant-page-header-heading-title{margin-right:12px;margin-bottom:0;color:rgba(0,0,0,.85);font-weight:600;font-size:20px;line-height:32px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-page-header-heading .ant-avatar{margin-right:12px}.ant-page-header-heading-sub-title{margin-right:12px;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-page-header-heading-extra{margin:4px 0;white-space:nowrap}.ant-page-header-heading-extra>*{margin-left:12px;white-space:unset}.ant-page-header-heading-extra>:first-child{margin-left:0}.ant-page-header-content{padding-top:12px}.ant-page-header-footer{margin-top:16px}.ant-page-header-footer .ant-tabs-bar{margin-bottom:1px;border-bottom:0}.ant-page-header-footer .ant-tabs-bar .ant-tabs-nav .ant-tabs-tab{padding:8px 0;font-size:16px}.ant-page-header-compact .ant-page-header-heading{-ms-flex-wrap:wrap;flex-wrap:wrap}.ant-page-header-rtl{direction:rtl}.ant-page-header-rtl .ant-page-header-back{float:right;margin-right:0;margin-left:16px}.ant-page-header-rtl .ant-page-header-heading-title,.ant-page-header-rtl .ant-page-header-heading .ant-avatar{margin-right:0;margin-left:12px}.ant-page-header-rtl .ant-page-header-heading-sub-title{float:right;margin-right:0;margin-left:12px}.ant-page-header-rtl .ant-page-header-heading-tags{float:right}.ant-page-header-rtl .ant-page-header-heading-extra{float:left}.ant-page-header-rtl .ant-page-header-heading-extra>*{margin-right:12px;margin-left:0}.ant-page-header-rtl .ant-page-header-heading-extra>:first-child{margin-right:0}.ant-page-header-rtl .ant-page-header-footer .ant-tabs-bar .ant-tabs-nav{float:right}.ant-popover{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:absolute;top:0;left:0;z-index:1030;font-weight:400;white-space:normal;text-align:left;cursor:auto;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ant-popover:after{position:absolute;background:hsla(0,0%,100%,.01);content:""}.ant-popover-hidden{display:none}.ant-popover-placement-top,.ant-popover-placement-topLeft,.ant-popover-placement-topRight{padding-bottom:10px}.ant-popover-placement-right,.ant-popover-placement-rightBottom,.ant-popover-placement-rightTop{padding-left:10px}.ant-popover-placement-bottom,.ant-popover-placement-bottomLeft,.ant-popover-placement-bottomRight{padding-top:10px}.ant-popover-placement-left,.ant-popover-placement-leftBottom,.ant-popover-placement-leftTop{padding-right:10px}.ant-popover-inner{background-color:#fff;background-clip:padding-box;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);-webkit-box-shadow:0 0 8px rgba(0,0,0,.15)\9;box-shadow:0 0 8px rgba(0,0,0,.15)\9}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-popover-inner{-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}}.ant-popover-title{min-width:177px;min-height:32px;margin:0;padding:5px 16px 4px;color:rgba(0,0,0,.85);font-weight:500;border-bottom:1px solid #f0f0f0}.ant-popover-inner-content{padding:12px 16px;color:rgba(0,0,0,.65)}.ant-popover-message{position:relative;padding:4px 0 12px;color:rgba(0,0,0,.65);font-size:14px}.ant-popover-message>.anticon{position:absolute;top:8.0005px;color:#faad14;font-size:14px}.ant-popover-message-title{padding-left:22px}.ant-popover-buttons{margin-bottom:4px;text-align:right}.ant-popover-buttons button{margin-left:8px}.ant-popover-arrow{position:absolute;display:block;width:8.48528137px;height:8.48528137px;background:transparent;border-style:solid;border-width:4.24264069px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow{bottom:6.2px;border-color:transparent #fff #fff transparent;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07)}.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow{left:16px}.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow{right:16px}.ant-popover-placement-right>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-rightBottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-rightTop>.ant-popover-content>.ant-popover-arrow{left:6px;border-color:transparent transparent #fff #fff;-webkit-box-shadow:-3px 3px 7px rgba(0,0,0,.07);box-shadow:-3px 3px 7px rgba(0,0,0,.07)}.ant-popover-placement-right>.ant-popover-content>.ant-popover-arrow{top:50%;-webkit-transform:translateY(-50%) rotate(45deg);transform:translateY(-50%) rotate(45deg)}.ant-popover-placement-rightTop>.ant-popover-content>.ant-popover-arrow{top:12px}.ant-popover-placement-rightBottom>.ant-popover-content>.ant-popover-arrow{bottom:12px}.ant-popover-placement-bottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-bottomLeft>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-bottomRight>.ant-popover-content>.ant-popover-arrow{top:6px;border-color:#fff transparent transparent #fff;-webkit-box-shadow:-2px -2px 5px rgba(0,0,0,.06);box-shadow:-2px -2px 5px rgba(0,0,0,.06)}.ant-popover-placement-bottom>.ant-popover-content>.ant-popover-arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.ant-popover-placement-bottomLeft>.ant-popover-content>.ant-popover-arrow{left:16px}.ant-popover-placement-bottomRight>.ant-popover-content>.ant-popover-arrow{right:16px}.ant-popover-placement-left>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-leftBottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-leftTop>.ant-popover-content>.ant-popover-arrow{right:6px;border-color:#fff #fff transparent transparent;-webkit-box-shadow:3px -3px 7px rgba(0,0,0,.07);box-shadow:3px -3px 7px rgba(0,0,0,.07)}.ant-popover-placement-left>.ant-popover-content>.ant-popover-arrow{top:50%;-webkit-transform:translateY(-50%) rotate(45deg);transform:translateY(-50%) rotate(45deg)}.ant-popover-placement-leftTop>.ant-popover-content>.ant-popover-arrow{top:12px}.ant-popover-placement-leftBottom>.ant-popover-content>.ant-popover-arrow{bottom:12px}.ant-popover-rtl{direction:rtl;text-align:right}.ant-popover-rtl .ant-popover-message-title{padding-right:22px;padding-left:16px}.ant-popover-rtl .ant-popover-buttons{text-align:left}.ant-popover-rtl .ant-popover-buttons button{margin-right:8px;margin-left:0}.ant-progress{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block}.ant-progress-line{position:relative;width:100%;font-size:14px}.ant-progress-steps{display:inline-block}.ant-progress-steps-outer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}.ant-progress-steps-item{-ms-flex-negative:0;flex-shrink:0;min-width:2px;margin-right:2px;background:#f3f3f3}.ant-progress-small.ant-progress-line,.ant-progress-small.ant-progress-line .ant-progress-text .anticon{font-size:12px}.ant-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0}.ant-progress-show-info .ant-progress-outer{margin-right:calc(-2em - 8px);padding-right:calc(2em + 8px)}.ant-progress-inner{position:relative;display:inline-block;width:100%;overflow:hidden;vertical-align:middle;background-color:#f5f5f5;border-radius:100px}.ant-progress-circle-trail{stroke:#f5f5f5}.ant-progress-circle-path{-webkit-animation:ant-progress-appear .3s;animation:ant-progress-appear .3s}.ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#1890ff}.ant-progress-bg,.ant-progress-success-bg{position:relative;background-color:#1890ff;border-radius:100px;-webkit-transition:all .4s cubic-bezier(.08,.82,.17,1) 0s;transition:all .4s cubic-bezier(.08,.82,.17,1) 0s}.ant-progress-success-bg{position:absolute;top:0;left:0;background-color:#52c41a}.ant-progress-text{display:inline-block;width:2em;margin-left:8px;color:rgba(0,0,0,.45);font-size:1em;line-height:1;white-space:nowrap;text-align:left;vertical-align:middle;word-break:normal}.ant-progress-text .anticon{font-size:14px}.ant-progress-status-active .ant-progress-bg:before{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;border-radius:10px;opacity:0;-webkit-animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;content:""}.ant-progress-status-exception .ant-progress-bg{background-color:#ff4d4f}.ant-progress-status-exception .ant-progress-text{color:#ff4d4f}.ant-progress-status-exception .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#ff4d4f}.ant-progress-status-success .ant-progress-bg{background-color:#52c41a}.ant-progress-status-success .ant-progress-text{color:#52c41a}.ant-progress-status-success .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#52c41a}.ant-progress-circle .ant-progress-inner{position:relative;line-height:1;background-color:transparent}.ant-progress-circle .ant-progress-text{position:absolute;top:50%;left:50%;width:100%;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:1em;line-height:1;white-space:normal;text-align:center;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-progress-circle .ant-progress-text .anticon{font-size:1.16666667em}.ant-progress-circle.ant-progress-status-exception .ant-progress-text{color:#ff4d4f}.ant-progress-circle.ant-progress-status-success .ant-progress-text{color:#52c41a}@-webkit-keyframes ant-progress-active{0%{width:0;opacity:.1}20%{width:0;opacity:.5}to{width:100%;opacity:0}}@keyframes ant-progress-active{0%{width:0;opacity:.1}20%{width:0;opacity:.5}to{width:100%;opacity:0}}.ant-progress-rtl{direction:rtl}.ant-progress-rtl.ant-progress-show-info .ant-progress-outer{margin-right:0;margin-left:calc(-2em - 8px);padding-right:0;padding-left:calc(2em + 8px)}.ant-progress-rtl .ant-progress-success-bg{right:0;left:auto}.ant-progress-rtl.ant-progress-line .ant-progress-text,.ant-progress-rtl.ant-progress-steps .ant-progress-text{margin-right:8px;margin-left:0;text-align:right}.ant-rate{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block;margin:0;padding:0;color:#fadb14;font-size:20px;line-height:unset;list-style:none;outline:none}.ant-rate-disabled .ant-rate-star{cursor:default}.ant-rate-disabled .ant-rate-star:hover{-webkit-transform:scale(1);transform:scale(1)}.ant-rate-star{position:relative;display:inline-block;margin:0;padding:0;color:inherit;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-rate-star:not(:last-child){margin-right:8px}.ant-rate-star>div:focus{outline:0}.ant-rate-star>div:focus,.ant-rate-star>div:hover{-webkit-transform:scale(1.1);transform:scale(1.1)}.ant-rate-star-first,.ant-rate-star-second{color:#f0f0f0;-webkit-transition:all .3s;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-rate-star-first .anticon,.ant-rate-star-second .anticon{vertical-align:middle}.ant-rate-star-first{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;opacity:0}.ant-rate-star-half .ant-rate-star-first,.ant-rate-star-half .ant-rate-star-second{opacity:1}.ant-rate-star-full .ant-rate-star-second,.ant-rate-star-half .ant-rate-star-first{color:inherit}.ant-rate-text{display:inline-block;margin:0 8px;font-size:14px}.ant-rate-rtl{direction:rtl}.ant-rate-rtl .ant-rate-star:not(:last-child){margin-right:0;margin-left:8px}.ant-rate-rtl .ant-rate-star-first{right:0;left:auto}.ant-result{padding:48px 32px}.ant-result-success .ant-result-icon>.anticon{color:#52c41a}.ant-result-error .ant-result-icon>.anticon{color:#ff4d4f}.ant-result-info .ant-result-icon>.anticon{color:#1890ff}.ant-result-warning .ant-result-icon>.anticon{color:#faad14}.ant-result-image{width:250px;height:295px;margin:auto}.ant-result-icon{margin-bottom:24px;text-align:center}.ant-result-icon>.anticon{font-size:72px}.ant-result-title{color:rgba(0,0,0,.85);font-size:24px;line-height:1.8;text-align:center}.ant-result-subtitle{color:rgba(0,0,0,.45);font-size:14px;line-height:1.6;text-align:center}.ant-result-extra{margin:32px 0 0;text-align:center}.ant-result-extra>*{margin-right:8px}.ant-result-extra>:last-child{margin-right:0}.ant-result-content{margin-top:24px;padding:24px 40px;background-color:#fafafa}.ant-result-rtl{direction:rtl}.ant-result-rtl .ant-result-extra>*{margin-right:0;margin-left:8px}.ant-result-rtl .ant-result-extra>:last-child{margin-left:0}.ant-skeleton{display:table;width:100%}.ant-skeleton-header{display:table-cell;padding-right:16px;vertical-align:top}.ant-skeleton-header .ant-skeleton-avatar{display:inline-block;vertical-align:top;background:#f2f2f2;width:32px;height:32px;line-height:32px}.ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-lg{width:40px;height:40px;line-height:40px}.ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-sm{width:24px;height:24px;line-height:24px}.ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-content{display:table-cell;width:100%;vertical-align:top}.ant-skeleton-content .ant-skeleton-title{width:100%;height:16px;margin-top:16px;background:#f2f2f2}.ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:24px}.ant-skeleton-content .ant-skeleton-paragraph{padding:0}.ant-skeleton-content .ant-skeleton-paragraph>li{width:100%;height:16px;list-style:none;background:#f2f2f2}.ant-skeleton-content .ant-skeleton-paragraph>li:last-child:not(:first-child):not(:nth-child(2)){width:61%}.ant-skeleton-content .ant-skeleton-paragraph>li+li{margin-top:16px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title{margin-top:12px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:28px}.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton.ant-skeleton-active .ant-skeleton-button,.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title,.ant-skeleton.ant-skeleton-active .ant-skeleton-input{background:-webkit-gradient(linear,left top,right top,color-stop(25%,#f2f2f2),color-stop(37%,#e6e6e6),color-stop(63%,#f2f2f2));background:linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%);background-size:400% 100%;-webkit-animation:ant-skeleton-loading 1.4s ease infinite;animation:ant-skeleton-loading 1.4s ease infinite}.ant-skeleton-element{display:inline-block}.ant-skeleton-element .ant-skeleton-button{display:inline-block;vertical-align:top;background:#f2f2f2;border-radius:2px;width:64px;height:32px;line-height:32px}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-circle{width:32px;border-radius:50%}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-round{border-radius:32px}.ant-skeleton-element .ant-skeleton-button-lg{width:80px;height:40px;line-height:40px}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-circle{width:40px;border-radius:50%}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-round{border-radius:40px}.ant-skeleton-element .ant-skeleton-button-sm{width:48px;height:24px;line-height:24px}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-circle{width:24px;border-radius:50%}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-round{border-radius:24px}.ant-skeleton-element .ant-skeleton-avatar{display:inline-block;vertical-align:top;background:#f2f2f2;width:32px;height:32px;line-height:32px}.ant-skeleton-element .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-lg{width:40px;height:40px;line-height:40px}.ant-skeleton-element .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-sm{width:24px;height:24px;line-height:24px}.ant-skeleton-element .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-input{display:inline-block;vertical-align:top;background:#f2f2f2;width:100%;height:32px;line-height:32px}.ant-skeleton-element .ant-skeleton-input-lg{width:100%;height:40px;line-height:40px}.ant-skeleton-element .ant-skeleton-input-sm{width:100%;height:24px;line-height:24px}@-webkit-keyframes ant-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes ant-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.ant-skeleton-rtl{direction:rtl}.ant-skeleton-rtl .ant-skeleton-header{padding-right:0;padding-left:16px}.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title{-webkit-animation-name:ant-skeleton-loading-rtl;animation-name:ant-skeleton-loading-rtl}@-webkit-keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}@keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}.ant-slider{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;height:12px;margin:10px 6px;padding:4px 0;cursor:pointer;-ms-touch-action:none;touch-action:none}.ant-slider-vertical{width:12px;height:100%;margin:6px 10px;padding:0 4px}.ant-slider-vertical .ant-slider-rail{width:4px;height:100%}.ant-slider-vertical .ant-slider-track{width:4px}.ant-slider-vertical .ant-slider-handle{margin-top:-6px;margin-left:-5px}.ant-slider-vertical .ant-slider-mark{top:0;left:12px;width:18px;height:100%}.ant-slider-vertical .ant-slider-mark-text{left:4px;white-space:nowrap}.ant-slider-vertical .ant-slider-step{width:4px;height:100%}.ant-slider-vertical .ant-slider-dot{top:auto;left:2px;margin-bottom:-4px}.ant-slider-tooltip .ant-tooltip-inner{min-width:unset}.ant-slider-rtl.ant-slider-vertical .ant-slider-handle{margin-right:-5px;margin-left:0}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark{right:12px;left:auto}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark-text{right:4px;left:auto}.ant-slider-rtl.ant-slider-vertical .ant-slider-dot{right:2px;left:auto}.ant-slider-with-marks{margin-bottom:28px}.ant-slider-rail{width:100%;background-color:#f5f5f5}.ant-slider-rail,.ant-slider-track{position:absolute;height:4px;border-radius:2px;-webkit-transition:background-color .3s;transition:background-color .3s}.ant-slider-track{background-color:#91d5ff}.ant-slider-handle{position:absolute;width:14px;height:14px;margin-top:-5px;background-color:#fff;border:2px solid #91d5ff;border-radius:50%;-webkit-box-shadow:0;box-shadow:0;cursor:pointer;-webkit-transition:border-color .3s,-webkit-box-shadow .6s,-webkit-transform .3s cubic-bezier(.18,.89,.32,1.28);transition:border-color .3s,-webkit-box-shadow .6s,-webkit-transform .3s cubic-bezier(.18,.89,.32,1.28);transition:border-color .3s,box-shadow .6s,transform .3s cubic-bezier(.18,.89,.32,1.28);transition:border-color .3s,box-shadow .6s,transform .3s cubic-bezier(.18,.89,.32,1.28),-webkit-box-shadow .6s,-webkit-transform .3s cubic-bezier(.18,.89,.32,1.28)}.ant-slider-handle-dragging.ant-slider-handle-dragging.ant-slider-handle-dragging,.ant-slider-handle:focus{border-color:#46a6ff;-webkit-box-shadow:0 0 0 5px rgba(24,144,255,.12);box-shadow:0 0 0 5px rgba(24,144,255,.12)}.ant-slider-handle:focus{outline:none}.ant-slider-handle.ant-tooltip-open{border-color:#1890ff}.ant-slider:hover .ant-slider-rail{background-color:#e1e1e1}.ant-slider:hover .ant-slider-track{background-color:#69c0ff}.ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open){border-color:#69c0ff}.ant-slider-mark{position:absolute;top:14px;left:0;width:100%;font-size:14px}.ant-slider-mark-text{position:absolute;display:inline-block;color:rgba(0,0,0,.45);text-align:center;word-break:keep-all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-slider-mark-text-active{color:rgba(0,0,0,.65)}.ant-slider-step{position:absolute;width:100%;height:4px;background:transparent}.ant-slider-dot{position:absolute;top:-2px;width:8px;height:8px;background-color:#fff;border:2px solid #f0f0f0;border-radius:50%;cursor:pointer}.ant-slider-dot,.ant-slider-dot:first-child,.ant-slider-dot:last-child{margin-left:-4px}.ant-slider-dot-active{border-color:#8cc8ff}.ant-slider-disabled{cursor:not-allowed}.ant-slider-disabled .ant-slider-track{background-color:rgba(0,0,0,.25)!important}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-handle{background-color:#fff;border-color:rgba(0,0,0,.25)!important;-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-mark-text{cursor:not-allowed!important}.ant-slider-rtl{direction:rtl}.ant-slider-rtl .ant-slider-mark{right:0;left:auto}.ant-slider-rtl .ant-slider-dot,.ant-slider-rtl .ant-slider-dot:first-child,.ant-slider-rtl .ant-slider-dot:last-child{margin-right:-4px;margin-left:0}.ant-space{display:-ms-inline-flexbox;display:inline-flex}.ant-space-vertical{-ms-flex-direction:column;flex-direction:column}.ant-space-align-center{-ms-flex-align:center;align-items:center}.ant-space-align-start{-ms-flex-align:start;align-items:flex-start}.ant-space-align-end{-ms-flex-align:end;align-items:flex-end}.ant-space-align-baseline{-ms-flex-align:baseline;align-items:baseline}.ant-space-rtl{direction:rtl}.ant-statistic{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum"}.ant-statistic-title{margin-bottom:4px;color:rgba(0,0,0,.45);font-size:14px}.ant-statistic-content{color:rgba(0,0,0,.85);font-size:24px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}.ant-statistic-content-value{display:inline-block;direction:ltr}.ant-statistic-content-value-decimal{font-size:16px}.ant-statistic-content-prefix,.ant-statistic-content-suffix{display:inline-block}.ant-statistic-content-prefix{margin-right:4px}.ant-statistic-content-suffix{margin-left:4px;font-size:16px}.ant-statistic-rtl{direction:rtl}.ant-statistic-rtl .ant-statistic-content-prefix{margin-right:0;margin-left:4px}.ant-statistic-rtl .ant-statistic-content-suffix{margin-right:4px;margin-left:0}.ant-steps{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:-ms-flexbox;display:flex;width:100%;font-size:0}.ant-steps-item{position:relative;display:inline-block;-ms-flex:1;flex:1 1;overflow:hidden;vertical-align:top}.ant-steps-item-container{outline:none}.ant-steps-item:last-child{-ms-flex:none;flex:none}.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after,.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-tail{display:none}.ant-steps-item-content,.ant-steps-item-icon{display:inline-block;vertical-align:top}.ant-steps-item-icon{width:32px;height:32px;margin:0 8px 0 0;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:32px;text-align:center;border:1px solid rgba(0,0,0,.25);border-radius:32px;-webkit-transition:background-color .3s,border-color .3s;transition:background-color .3s,border-color .3s}.ant-steps-item-icon>.ant-steps-icon{position:relative;top:-1px;color:#1890ff;line-height:1}.ant-steps-item-tail{position:absolute;top:12px;left:0;width:100%;padding:0 10px}.ant-steps-item-tail:after{display:inline-block;width:100%;height:1px;background:#f0f0f0;border-radius:1px;-webkit-transition:background .3s;transition:background .3s;content:""}.ant-steps-item-title{position:relative;display:inline-block;padding-right:16px;color:rgba(0,0,0,.65);font-size:16px;line-height:32px}.ant-steps-item-title:after{position:absolute;top:16px;left:100%;display:block;width:9999px;height:1px;background:#f0f0f0;content:""}.ant-steps-item-subtitle{display:inline;margin-left:8px;font-weight:400}.ant-steps-item-description,.ant-steps-item-subtitle{color:rgba(0,0,0,.45);font-size:14px}.ant-steps-item-wait .ant-steps-item-icon{background-color:#fff;border-color:rgba(0,0,0,.25)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon{color:rgba(0,0,0,.25)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:rgba(0,0,0,.25)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item-process .ant-steps-item-icon{background-color:#fff;border-color:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#1890ff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.65)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item-process .ant-steps-item-icon{background:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#fff}.ant-steps-item-process .ant-steps-item-title{font-weight:500}.ant-steps-item-finish .ant-steps-item-icon{background-color:#fff;border-color:#1890ff}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#1890ff}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.65)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#1890ff}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.45)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#1890ff}.ant-steps-item-error .ant-steps-item-icon{background-color:#fff;border-color:#ff4d4f}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon{color:#ff4d4f}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item.ant-steps-next-error .ant-steps-item-title:after{background:#ff4d4f}.ant-steps-item-disabled{cursor:not-allowed}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]{cursor:pointer}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-icon .ant-steps-icon,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-title{-webkit-transition:color .3s;transition:color .3s}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-title{color:#1890ff}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon{border-color:#1890ff}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon .ant-steps-icon{color:#1890ff}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{margin-right:16px;white-space:nowrap}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child{margin-right:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-right:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-tail{display:none}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-description{max-width:140px;white-space:normal}.ant-steps-item-custom .ant-steps-item-icon{height:auto;background:none;border:0}.ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{top:0;left:.5px;width:32px;height:32px;font-size:24px;line-height:32px}.ant-steps-item-custom.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps:not(.ant-steps-vertical) .ant-steps-item-custom .ant-steps-item-icon{width:auto;background:none}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{margin-right:12px}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child{margin-right:0}.ant-steps-small .ant-steps-item-icon{width:24px;height:24px;margin:0 8px 0 0;font-size:12px;line-height:24px;text-align:center;border-radius:24px}.ant-steps-small .ant-steps-item-title{padding-right:12px;font-size:14px;line-height:24px}.ant-steps-small .ant-steps-item-title:after{top:12px}.ant-steps-small .ant-steps-item-description{color:rgba(0,0,0,.45);font-size:14px}.ant-steps-small .ant-steps-item-tail{top:8px}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon{width:inherit;height:inherit;line-height:inherit;background:none;border:0;border-radius:0}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{font-size:24px;line-height:24px;-webkit-transform:none;transform:none}.ant-steps-vertical{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.ant-steps-vertical .ant-steps-item{display:block;-ms-flex:1 0 auto;flex:1 0 auto;overflow:visible}.ant-steps-vertical .ant-steps-item-icon{float:left;margin-right:16px}.ant-steps-vertical .ant-steps-item-content{display:block;min-height:48px;overflow:hidden}.ant-steps-vertical .ant-steps-item-title{line-height:32px}.ant-steps-vertical .ant-steps-item-description{padding-bottom:12px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{position:absolute;top:0;left:16px;width:1px;height:100%;padding:38px 0 6px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail:after{width:1px;height:100%}.ant-steps-vertical>.ant-steps-item:not(:last-child)>.ant-steps-item-container>.ant-steps-item-tail{display:block}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{display:none}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{position:absolute;top:0;left:12px;padding:30px 0 6px}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-title{line-height:24px}.ant-steps-rtl.ant-steps-vertical .ant-steps-item-icon{float:right;margin-right:0;margin-left:16px}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{right:16px;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{right:12px;left:auto}@media (max-width:480px){.ant-steps-horizontal.ant-steps-label-horizontal{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item{display:block;-ms-flex:1 0 auto;flex:1 0 auto;overflow:visible}.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item-icon{float:left;margin-right:16px}.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item-content{display:block;min-height:48px;overflow:hidden}.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item-title{line-height:32px}.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item-description{padding-bottom:12px}.ant-steps-horizontal.ant-steps-label-horizontal>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{position:absolute;top:0;left:16px;width:1px;height:100%;padding:38px 0 6px}.ant-steps-horizontal.ant-steps-label-horizontal>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail:after{width:1px;height:100%}.ant-steps-horizontal.ant-steps-label-horizontal>.ant-steps-item:not(:last-child)>.ant-steps-item-container>.ant-steps-item-tail{display:block}.ant-steps-horizontal.ant-steps-label-horizontal>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{display:none}.ant-steps-horizontal.ant-steps-label-horizontal.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{position:absolute;top:0;left:12px;padding:30px 0 6px}.ant-steps-horizontal.ant-steps-label-horizontal.ant-steps-small .ant-steps-item-container .ant-steps-item-title{line-height:24px}.ant-steps-rtl.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item-icon{float:right;margin-right:0;margin-left:16px}.ant-steps-rtl.ant-steps-horizontal.ant-steps-label-horizontal>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{right:16px;left:auto}.ant-steps-rtl.ant-steps-horizontal.ant-steps-label-horizontal.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{right:12px;left:auto}}.ant-steps-label-vertical .ant-steps-item{overflow:visible}.ant-steps-label-vertical .ant-steps-item-tail{margin-left:58px;padding:3.5px 24px}.ant-steps-label-vertical .ant-steps-item-content{display:block;width:116px;margin-top:8px;text-align:center}.ant-steps-label-vertical .ant-steps-item-icon{display:inline-block;margin-left:42px}.ant-steps-label-vertical .ant-steps-item-title{padding-right:0;padding-left:0}.ant-steps-label-vertical .ant-steps-item-title:after{display:none}.ant-steps-label-vertical .ant-steps-item-subtitle{display:block;margin-bottom:4px;margin-left:0;line-height:1.5715}.ant-steps-label-vertical.ant-steps-small:not(.ant-steps-dot) .ant-steps-item-icon{margin-left:46px}.ant-steps-dot .ant-steps-item-title,.ant-steps-dot.ant-steps-small .ant-steps-item-title{line-height:1.5715}.ant-steps-dot .ant-steps-item-tail,.ant-steps-dot.ant-steps-small .ant-steps-item-tail{top:2px;width:100%;margin:0 0 0 70px;padding:0}.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{width:calc(100% - 20px);height:3px;margin-left:12px}.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{left:2px}.ant-steps-dot .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-icon{width:8px;height:8px;margin-left:67px;padding-right:0;line-height:8px;background:transparent;border:0}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{position:relative;float:left;width:100%;height:100%;border-radius:100px;-webkit-transition:all .3s;transition:all .3s}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{position:absolute;top:-12px;left:-26px;width:60px;height:32px;background:rgba(0,0,0,.001);content:""}.ant-steps-dot .ant-steps-item-content,.ant-steps-dot.ant-steps-small .ant-steps-item-content{width:140px}.ant-steps-dot .ant-steps-item-process .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-item-icon{position:relative;top:-1px;width:10px;height:10px;line-height:10px}.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{margin-top:8px;margin-left:0;background:none}.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{top:2px;left:-9px;margin:0;padding:22px 0 4px}.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-icon-dot{left:-2px}.ant-steps-navigation{padding-top:12px}.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-left:-12px}.ant-steps-navigation .ant-steps-item{overflow:visible;text-align:center}.ant-steps-navigation .ant-steps-item-container{display:inline-block;height:100%;margin-left:-16px;padding-bottom:12px;text-align:left;-webkit-transition:opacity .3s;transition:opacity .3s}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-content{max-width:auto}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{max-width:100%;padding-right:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title:after{display:none}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]{cursor:pointer}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]:hover{opacity:.85}.ant-steps-navigation .ant-steps-item:last-child{-ms-flex:1;flex:1 1}.ant-steps-navigation .ant-steps-item:last-child:after{display:none}.ant-steps-navigation .ant-steps-item:after{position:absolute;top:50%;left:100%;display:inline-block;width:12px;height:12px;margin-top:-14px;margin-left:-2px;border:1px solid rgba(0,0,0,.25);border-bottom:none;border-left:none;-webkit-transform:rotate(45deg);transform:rotate(45deg);content:""}.ant-steps-navigation .ant-steps-item:before{position:absolute;bottom:0;left:50%;display:inline-block;width:0;height:3px;background-color:#1890ff;-webkit-transition:width .3s,left .3s;transition:width .3s,left .3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;content:""}.ant-steps-navigation .ant-steps-item.ant-steps-item-active:before{left:0;width:100%}@media (max-width:480px){.ant-steps-navigation>.ant-steps-item{margin-right:0!important}.ant-steps-navigation>.ant-steps-item:before{display:none}.ant-steps-navigation>.ant-steps-item.ant-steps-item-active:before{top:0;right:0;left:unset;display:block;width:3px;height:calc(100% - 24px)}.ant-steps-navigation>.ant-steps-item:after{position:relative;top:-2px;left:50%;display:block;width:8px;height:8px;margin-bottom:8px;text-align:center;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ant-steps-navigation>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{visibility:hidden}}.ant-steps-rtl{direction:rtl}.ant-steps.ant-steps-rtl .ant-steps-item-icon{margin-right:0;margin-left:8px}.ant-steps-rtl .ant-steps-item-tail{right:0;left:auto}.ant-steps-rtl .ant-steps-item-title{padding-right:0;padding-left:16px}.ant-steps-rtl .ant-steps-item-title:after{right:100%;left:auto}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{margin-right:0;margin-left:16px}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child{margin-left:0}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-left:0}.ant-steps-rtl .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{right:.5px;left:auto}.ant-steps-rtl.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-right:-12px;margin-left:0}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container{margin-right:-16px;margin-left:0;text-align:right}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-navigation .ant-steps-item:after{right:100%;left:auto;margin-right:-2px;margin-left:0;-webkit-transform:rotate(225deg);transform:rotate(225deg)}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{margin-right:0;margin-left:12px}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child{margin-left:0}.ant-steps-rtl.ant-steps-small .ant-steps-item-title{padding-right:0;padding-left:12px}.ant-steps-rtl.ant-steps-label-vertical .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail{margin:0 70px 0 0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{margin-right:12px;margin-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{right:2px;left:auto}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon{margin-right:67px;margin-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{float:right}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{right:-26px;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{margin-right:0;margin-left:16px}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{right:-9px;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{right:0;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-icon-dot{right:-2px;left:auto}.ant-switch{margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:44px;height:22px;line-height:22px;vertical-align:middle;background-color:rgba(0,0,0,.25);border:0;border-radius:100px;cursor:pointer;-webkit-transition:all .36s;transition:all .36s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-switch:focus{outline:0;-webkit-box-shadow:0 0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}.ant-switch-checked:focus{-webkit-box-shadow:0 0 0 2px rgba(24,144,255,.2);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-switch:focus:hover{-webkit-box-shadow:none;box-shadow:none}.ant-switch-checked{background-color:#1890ff}.ant-switch-disabled,.ant-switch-loading{cursor:not-allowed;opacity:.4}.ant-switch-disabled *,.ant-switch-loading *{-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.ant-switch-inner{display:block;margin:0 7px 0 25px;color:#fff;font-size:12px;-webkit-transition:margin .36s;transition:margin .36s}.ant-switch-checked .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-handle{top:2px;left:2px;width:18px;height:18px}.ant-switch-handle,.ant-switch-handle:before{position:absolute;-webkit-transition:all .36s cubic-bezier(.78,.14,.15,.86);transition:all .36s cubic-bezier(.78,.14,.15,.86)}.ant-switch-handle:before{top:0;right:0;bottom:0;left:0;background-color:#fff;border-radius:9px;-webkit-box-shadow:0 2px 4px 0 rgba(0,35,11,.2);box-shadow:0 2px 4px 0 rgba(0,35,11,.2);content:""}.ant-switch-checked .ant-switch-handle{left:calc(100% - 20px)}.ant-switch:not(.ant-switch-disabled):active .ant-switch-handle:before{right:-30%;left:0}.ant-switch:not(.ant-switch-disabled):active.ant-switch-checked .ant-switch-handle:before{right:0;left:-30%}.ant-switch-loading-icon{position:absolute;top:50%;left:50%;color:rgba(0,0,0,.65);-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-switch-checked .ant-switch-loading-icon{color:#1890ff}.ant-switch-small{min-width:28px;height:16px;line-height:16px}.ant-switch-small .ant-switch-inner{margin:0 5px 0 18px;font-size:12px}.ant-switch-small .ant-switch-handle{width:12px;height:12px}.ant-switch-small .ant-switch-loading-icon{-webkit-transform:translate(-50%,-50%) scale(.66667);transform:translate(-50%,-50%) scale(.66667)}.ant-switch-small.ant-switch-checked .ant-switch-inner{margin:0 18px 0 5px}.ant-switch-small.ant-switch-checked .ant-switch-handle{left:calc(100% - 14px)}.ant-switch-rtl{direction:rtl}.ant-switch-rtl .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-rtl .ant-switch-handle{right:2px;left:auto}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active .ant-switch-handle:before{right:0;left:-30%}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active.ant-switch-checked .ant-switch-handle:before{right:-30%;left:0}.ant-switch-rtl.ant-switch-checked .ant-switch-inner{margin:0 7px 0 25px}.ant-switch-rtl.ant-switch-checked .ant-switch-handle{right:calc(100% - 20px)}.ant-switch-rtl.ant-switch-small.ant-switch-checked .ant-switch-handle{right:calc(100% - 14px)}.ant-table.ant-table-middle .ant-table-footer,.ant-table.ant-table-middle .ant-table-tbody>tr>td,.ant-table.ant-table-middle .ant-table-thead>tr>th,.ant-table.ant-table-middle .ant-table-title,.ant-table.ant-table-middle tfoot>tr>td,.ant-table.ant-table-middle tfoot>tr>th{padding:12px 8px}.ant-table.ant-table-middle .ant-table-thead th.ant-table-column-has-sorters{padding:0}.ant-table.ant-table-middle .ant-table-thead .ant-table-filter-column{margin:-12px -8px}.ant-table.ant-table-middle .ant-table-thead .ant-table-filter-column-title{padding:12px 2.3em 12px 8px}.ant-table.ant-table-middle .ant-table-thead .ant-table-column-sorters{padding:12px 8px}.ant-table.ant-table-middle .ant-table-expanded-row-fixed{margin:-12px -8px}.ant-table.ant-table-middle .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-12px -8px -12px 25px}.ant-table.ant-table-small .ant-table-footer,.ant-table.ant-table-small .ant-table-tbody>tr>td,.ant-table.ant-table-small .ant-table-thead>tr>th,.ant-table.ant-table-small .ant-table-title,.ant-table.ant-table-small tfoot>tr>td,.ant-table.ant-table-small tfoot>tr>th{padding:8px}.ant-table.ant-table-small .ant-table-thead th.ant-table-column-has-sorters{padding:0}.ant-table.ant-table-small .ant-table-thead .ant-table-filter-column{margin:-8px}.ant-table.ant-table-small .ant-table-thead .ant-table-filter-column-title{padding:8px 2.3em 8px 8px}.ant-table.ant-table-small .ant-table-thead .ant-table-column-sorters{padding:8px}.ant-table.ant-table-small .ant-table-expanded-row-fixed{margin:-8px}.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-8px -8px -8px 25px}.ant-table-small .ant-table-thead>tr>th{background-color:#fafafa}.ant-table-small .ant-table-selection-column{width:46px;min-width:46px}.ant-table.ant-table-bordered .ant-table-title{border:1px solid #f0f0f0;border-bottom:0}.ant-table.ant-table-bordered .ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered tbody>tr>td,.ant-table.ant-table-bordered tfoot>tr>td,.ant-table.ant-table-bordered tfoot>tr>th,.ant-table.ant-table-bordered thead>tr>th{border-right:1px solid #f0f0f0}.ant-table.ant-table-bordered table thead>tr:not(:last-child)>th{border-bottom:1px solid #f0f0f0}.ant-table.ant-table-bordered .ant-table-container{border:1px solid #f0f0f0;border-right:0;border-bottom:0}.ant-table.ant-table-bordered .ant-table-expanded-row-fixed{margin:-16px -17px}.ant-table.ant-table-bordered .ant-table-expanded-row-fixed:after{position:absolute;top:0;right:1px;bottom:0;border-right:1px solid #f0f0f0;content:""}.ant-table.ant-table-bordered.ant-table-scroll-horizontal tr.ant-table-expanded-row>td,.ant-table.ant-table-bordered.ant-table-scroll-horizontal tr.ant-table-placeholder>td{border-right:0}.ant-table.ant-table-bordered.ant-table-middle .ant-table-expanded-row-fixed{margin:-12px -9px}.ant-table.ant-table-bordered.ant-table-small .ant-table-expanded-row-fixed{margin:-8px -9px}.ant-table.ant-table-bordered .ant-table-footer{border:1px solid #f0f0f0;border-top:0}.ant-table-wrapper:before{display:table;content:""}.ant-table-wrapper:after{display:table;clear:both;content:""}.ant-table{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;z-index:0;clear:both;background:#fff;border-radius:2px}.ant-table table{width:100%;text-align:left;border-radius:2px 2px 0 0;border-collapse:separate;border-spacing:0}.ant-table-tbody>tr>td,.ant-table-thead>tr>th,.ant-table tfoot>tr>td,.ant-table tfoot>tr>th{position:relative;padding:16px;overflow-wrap:break-word}.ant-table-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first{overflow:visible}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last .ant-table-cell-content,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first .ant-table-cell-content{display:block;overflow:hidden;text-overflow:ellipsis}.ant-table-title{padding:16px}.ant-table-footer{padding:16px;color:rgba(0,0,0,.85);background:#fafafa}.ant-table-thead>tr>th{color:rgba(0,0,0,.85);font-weight:500;text-align:left;background:#fafafa;border-bottom:1px solid #f0f0f0;-webkit-transition:background .3s ease;transition:background .3s ease}.ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-thead>tr:not(:last-child)>th[colspan]{border-bottom:0}.ant-table-tbody>tr>td{border-bottom:1px solid #f0f0f0;-webkit-transition:background .3s;transition:background .3s}.ant-table-tbody>tr.ant-table-row:hover>td{background:#fafafa}.ant-table-tbody>tr.ant-table-row-selected>td{background:#e6f7ff;border-color:rgba(0,0,0,.03)}.ant-table-tbody>tr.ant-table-row-selected:hover>td{background:#dcf4ff}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table{margin:-16px -16px -16px 33px}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table td{background:transparent}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td{border-bottom:0}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:first-child,.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:last-child{border-radius:0}.ant-table tfoot>tr>td,.ant-table tfoot>tr>th{border-bottom:1px solid #f0f0f0}.ant-table-pagination.ant-pagination{margin:16px 0}.ant-table-pagination-left{float:left}.ant-table-pagination-center{text-align:center}.ant-table-pagination-right{float:right}.ant-table-thead th.ant-table-column-has-sorters{padding:0;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-table-thead th.ant-table-column-has-sorters:hover{background:#f2f2f2}.ant-table-thead th.ant-table-column-has-sorters:hover .ant-table-filter-trigger-container{background:#f7f7f7}.ant-table-thead th.ant-table-column-sort{background:#f5f5f5}td.ant-table-column-sort{background:#fafafa}.ant-table-column-sorters-with-tooltip{display:inline-block;width:100%}.ant-table-column-sorters{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding:16px}.ant-table-column-sorter{margin-top:.15em;margin-bottom:-.15em;margin-left:8px;color:#bfbfbf}.ant-table-column-sorter-full{margin-top:-.2em;margin-bottom:0}.ant-table-column-sorter-inner{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.ant-table-column-sorter-down,.ant-table-column-sorter-up{display:inline-block;font-size:11px}.ant-table-column-sorter-down.active,.ant-table-column-sorter-up.active{color:#1890ff}.ant-table-column-sorter-up+.ant-table-column-sorter-down{margin-top:-.3em}.ant-table-filter-column{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:-16px}.ant-table-filter-column-title{-ms-flex:auto;flex:auto;padding:16px 2.3em 16px 16px}.ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column{margin:0}.ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column-title{padding:0 2.3em 0 0}.ant-table-filter-trigger-container{position:absolute;top:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex:none;flex:none;-ms-flex-align:stretch;align-items:stretch;-ms-flex-item-align:stretch;align-self:stretch;cursor:pointer;-webkit-transition:background-color .3s;transition:background-color .3s}.ant-table-filter-trigger-container-open,.ant-table-filter-trigger-container:hover,.ant-table-thead th.ant-table-column-has-sorters:hover .ant-table-filter-trigger-container:hover{background:#e5e5e5}.ant-table-filter-trigger{display:block;width:2.3em;color:#bfbfbf;font-size:12px;-webkit-transition:color .3s;transition:color .3s}.ant-table-filter-trigger .anticon{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-table-filter-trigger-container-open .ant-table-filter-trigger,.ant-table-filter-trigger:hover{color:rgba(0,0,0,.45)}.ant-table-filter-trigger.active{color:#1890ff}.ant-table-filter-dropdown{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";min-width:120px;background-color:#fff;border-radius:2px;-webkit-box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}.ant-table-filter-dropdown .ant-dropdown-menu{max-height:calc(100vh - 130px);overflow-x:hidden;border:0;-webkit-box-shadow:none;box-shadow:none}.ant-table-filter-dropdown-submenu>ul{max-height:calc(100vh - 130px);overflow-x:hidden;overflow-y:auto}.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-table-filter-dropdown .ant-checkbox-wrapper+span{padding-left:8px}.ant-table-filter-dropdown-btns{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:7px 8px 7px 3px;overflow:hidden;background-color:inherit;border-top:1px solid #f0f0f0}.ant-table .ant-table-selection-col{width:60px}table tr td.ant-table-selection-column,table tr th.ant-table-selection-column{padding-right:8px;padding-left:8px;text-align:center}table tr td.ant-table-selection-column .ant-radio-wrapper,table tr th.ant-table-selection-column .ant-radio-wrapper{margin-right:0}.ant-table-selection{position:relative}.ant-table-selection-extra{position:absolute;top:0;right:0;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-table-selection-extra .anticon{display:inline-block;font-size:10px;color:#bfbfbf}.ant-table-selection-extra .anticon:hover{color:#a6a6a6}.ant-table-expand-icon-col{width:48px}.ant-table-row-expand-icon-cell{text-align:center}.ant-table-row-indent{float:left;height:1px}.ant-table-row-expand-icon{color:#1890ff;text-decoration:none;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;position:relative;display:-ms-inline-flexbox;display:inline-flex;float:left;-webkit-box-sizing:border-box;box-sizing:border-box;width:17px;height:17px;padding:0;color:inherit;line-height:12px;vertical-align:-2px;background:#fff;border:1px solid #f0f0f0;border-radius:2px;outline:none;-webkit-transition:all .3s;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{color:#40a9ff}.ant-table-row-expand-icon:active{color:#096dd9}.ant-table-row-expand-icon:active,.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{border-color:currentColor}.ant-table-row-expand-icon:after,.ant-table-row-expand-icon:before{position:absolute;background:currentColor;-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;content:""}.ant-table-row-expand-icon:before{top:7px;right:3px;left:3px;height:1px}.ant-table-row-expand-icon:after{top:3px;bottom:3px;left:7px;width:1px;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ant-table-row-expand-icon-collapsed:before{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.ant-table-row-expand-icon-collapsed:after{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.ant-table-row-expand-icon-spaced{background:transparent;border:0}.ant-table-row-expand-icon-spaced:after,.ant-table-row-expand-icon-spaced:before{display:none;content:none}.ant-table-row-indent+.ant-table-row-expand-icon{margin-top:2.5005px;margin-right:8px}tr.ant-table-expanded-row:hover>td,tr.ant-table-expanded-row>td{background:#fbfbfb}.ant-table .ant-table-expanded-row-fixed{position:relative;margin:-16px;padding:16px}.ant-table-tbody>tr.ant-table-placeholder{text-align:center}.ant-table-empty .ant-table-tbody>tr.ant-table-placeholder{color:rgba(0,0,0,.25)}.ant-table-tbody>tr.ant-table-placeholder:hover>td{background:#fff}.ant-table-cell-fix-left,.ant-table-cell-fix-right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff}.ant-table-cell-fix-left-first:after,.ant-table-cell-fix-left-last:after{right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.ant-table-cell-fix-left-first:after,.ant-table-cell-fix-left-last:after,.ant-table-cell-fix-right-first:after,.ant-table-cell-fix-right-last:after{position:absolute;top:0;bottom:-1px;width:30px;-webkit-transition:-webkit-box-shadow .3s;transition:-webkit-box-shadow .3s;transition:box-shadow .3s;transition:box-shadow .3s,-webkit-box-shadow .3s;content:"";pointer-events:none}.ant-table-cell-fix-right-first:after,.ant-table-cell-fix-right-last:after{left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.ant-table .ant-table-container:after,.ant-table .ant-table-container:before{position:absolute;top:0;bottom:0;z-index:1;width:30px;-webkit-transition:-webkit-box-shadow .3s;transition:-webkit-box-shadow .3s;transition:box-shadow .3s;transition:box-shadow .3s,-webkit-box-shadow .3s;content:"";pointer-events:none}.ant-table .ant-table-container:before{left:0}.ant-table .ant-table-container:after{right:0}.ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container{position:relative}.ant-table-ping-left .ant-table-cell-fix-left-first:after,.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container:before{-webkit-box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.15);box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.15)}.ant-table-ping-right:not(.ant-table-has-fix-right) .ant-table-container{position:relative}.ant-table-ping-right .ant-table-cell-fix-right-first:after,.ant-table-ping-right .ant-table-cell-fix-right-last:after,.ant-table-ping-right:not(.ant-table-has-fix-right) .ant-table-container:after{-webkit-box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.15);box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.15)}@media (-ms-high-contrast:none){.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-right .ant-table-cell-fix-right-first:after{-webkit-box-shadow:none!important;box-shadow:none!important}}.ant-table-title{border-radius:2px 2px 0 0}.ant-table-title+.ant-table-container{border-top-left-radius:0;border-top-right-radius:0}.ant-table-title+.ant-table-container table>thead>tr:first-child th:first-child,.ant-table-title+.ant-table-container table>thead>tr:first-child th:last-child{border-radius:0}.ant-table-container{border-top-right-radius:2px}.ant-table-container,.ant-table-container table>thead>tr:first-child th:first-child{border-top-left-radius:2px}.ant-table-container table>thead>tr:first-child th:last-child{border-top-right-radius:2px}.ant-table-footer{border-radius:0 0 2px 2px}.ant-table-rtl,.ant-table-wrapper-rtl{direction:rtl}.ant-table-wrapper-rtl .ant-table table{text-align:right}.ant-table-wrapper-rtl .ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-wrapper-rtl .ant-table-thead>tr>th{text-align:right}.ant-table-tbody>tr .ant-table.ant-table-rtl{margin:-16px 33px -16px -16px}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination,.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-left{float:left}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-right{float:right}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-center{float:none;text-align:center}.ant-table-wrapper-rtl .ant-table-column-sorter{margin-right:8px;margin-left:0}.ant-table-wrapper-rtl .ant-table-filter-column-title{padding:16px 16px 16px 2.3em}.ant-table-wrapper-rtl .ant-table-filter-trigger-container{right:auto;left:0}.ant-dropdown-rtl .ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown .ant-checkbox-wrapper+span{padding-right:8px;padding-left:0}.ant-table-wrapper-rtl .ant-table-selection{text-align:center}.ant-table-wrapper-rtl .ant-table-selection-extra{right:auto;left:-10px}.ant-table-wrapper-rtl .ant-table-row-expand-icon,.ant-table-wrapper-rtl .ant-table-row-indent{float:right}.ant-table-wrapper-rtl .ant-table-row-indent+.ant-table-row-expand-icon{margin-right:0;margin-left:8px}.ant-table-wrapper-rtl .ant-table-row-expand-icon:after{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:before{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:after{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.ant-timeline{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";margin:0;padding:0;list-style:none}.ant-timeline-item{position:relative;margin:0;padding-bottom:20px;font-size:14px;list-style:none}.ant-timeline-item-tail{position:absolute;top:10px;left:4px;height:calc(100% - 10px);border-left:2px solid #f0f0f0}.ant-timeline-item-pending .ant-timeline-item-head{font-size:12px;background-color:transparent}.ant-timeline-item-pending .ant-timeline-item-tail{display:none}.ant-timeline-item-head{position:absolute;width:10px;height:10px;background-color:#fff;border:2px solid transparent;border-radius:100px}.ant-timeline-item-head-blue{color:#1890ff;border-color:#1890ff}.ant-timeline-item-head-red{color:#ff4d4f;border-color:#ff4d4f}.ant-timeline-item-head-green{color:#52c41a;border-color:#52c41a}.ant-timeline-item-head-gray{color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-timeline-item-head-custom{position:absolute;top:5.5px;left:5px;width:auto;height:auto;margin-top:0;padding:3px 1px;line-height:1;text-align:center;border:0;border-radius:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-timeline-item-content{position:relative;top:-7.001px;margin:0 0 0 26px;word-break:break-word}.ant-timeline-item-last>.ant-timeline-item-tail{display:none}.ant-timeline-item-last>.ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-tail{left:50%}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-left:-4px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-left:1px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{left:calc(50% - 4px);width:calc(50% - 14px);text-align:left}.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:calc(50% - 12px);margin:0;text-align:right}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{left:calc(100% - 6px)}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:calc(100% - 18px)}.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail{display:block;height:calc(100% - 14px);border-left:2px dotted #f0f0f0}.ant-timeline.ant-timeline-reverse .ant-timeline-item-last .ant-timeline-item-tail{display:none}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{top:15px;display:block;height:calc(100% - 15px);border-left:2px dotted #f0f0f0}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-label .ant-timeline-item-label{position:absolute;top:-7.001px;width:calc(50% - 12px);text-align:right}.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{left:calc(50% + 14px);width:calc(50% - 14px);text-align:left}.ant-timeline-rtl{direction:rtl}.ant-timeline-rtl .ant-timeline-item-tail{right:4px;left:auto;border-right:2px solid #f0f0f0;border-left:none}.ant-timeline-rtl .ant-timeline-item-head-custom{right:5px;left:auto;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}.ant-timeline-rtl .ant-timeline-item-content{margin:0 18px 0 0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-tail{right:50%;left:auto}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-right:-4px;margin-left:0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-right:1px;margin-left:0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{right:calc(50% - 4px);left:auto;text-align:right}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{right:0;left:auto}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:100%;margin-right:18px;text-align:right}.ant-timeline-rtl.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{border-right:2px dotted #f0f0f0;border-left:none}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-label{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{right:calc(50% + 14px);text-align:right}.ant-transfer-customize-list{display:-ms-flexbox;display:flex}.ant-transfer-customize-list .ant-transfer-operation{-ms-flex:none;flex:none;-ms-flex-item-align:center;align-self:center}.ant-transfer-customize-list .ant-transfer-list{-ms-flex:auto;flex:auto;width:auto;height:auto;min-height:200px}.ant-transfer-customize-list .ant-transfer-list-body-with-search{padding-top:0}.ant-transfer-customize-list .ant-transfer-list-body-search-wrapper{position:relative;padding-bottom:0}.ant-transfer-customize-list .ant-transfer-list-body-customize-wrapper{padding:12px}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small{border:0;border-radius:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th{background:#fafafa}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content .ant-table-row:last-child td{border-bottom:1px solid #f0f0f0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small .ant-table-body{margin:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:16px 0 4px}.ant-transfer-customize-list .ant-input[disabled]{background-color:transparent}.ant-transfer{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative}.ant-transfer-disabled .ant-transfer-list{background:#f5f5f5}.ant-transfer-list{position:relative;display:inline-block;width:180px;height:200px;padding-top:40px;vertical-align:middle;border:1px solid #d9d9d9;border-radius:2px}.ant-transfer-list-with-footer{padding-bottom:34px}.ant-transfer-list-search{padding-right:24px;padding-left:8px}.ant-transfer-list-search-action{position:absolute;top:12px;right:12px;bottom:12px;width:28px;color:rgba(0,0,0,.25);line-height:32px;text-align:center}.ant-transfer-list-search-action .anticon{color:rgba(0,0,0,.25);-webkit-transition:all .3s;transition:all .3s}.ant-transfer-list-search-action .anticon:hover{color:rgba(0,0,0,.45)}span.ant-transfer-list-search-action{pointer-events:none}.ant-transfer-list-header{position:absolute;top:0;left:0;width:100%;padding:8px 12px 9px;overflow:hidden;color:rgba(0,0,0,.65);background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0}.ant-transfer-list-header-title{position:absolute;right:12px}.ant-transfer-list-header .ant-checkbox-wrapper+span{padding-left:8px}.ant-transfer-list-body{position:relative;height:100%;font-size:14px}.ant-transfer-list-body-search-wrapper{position:absolute;top:0;left:0;width:100%;padding:12px}.ant-transfer-list-body-with-search{padding-top:56px}.ant-transfer-list-content{height:100%;margin:0;padding:0;overflow:auto;list-style:none}.ant-transfer-list-content-item{min-height:32px;padding:6px 12px;overflow:hidden;line-height:20px;white-space:nowrap;text-overflow:ellipsis;-webkit-transition:all .3s;transition:all .3s}.ant-transfer-list-content-item>span{padding-right:0}.ant-transfer-list-content-item-text{padding-left:8px}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:#f5f5f5;cursor:pointer}.ant-transfer-list-content-item-checked{background-color:#e6f7ff}.ant-transfer-list-content-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-transfer-list-body-not-found{position:absolute;top:50%;width:100%;padding-top:0;color:rgba(0,0,0,.25);text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ant-transfer-list-body-with-search .ant-transfer-list-body-not-found{margin-top:16px}.ant-transfer-list-footer{position:absolute;bottom:0;left:0;width:100%;border-top:1px solid #f0f0f0;border-radius:0 0 2px 2px}.ant-transfer-operation{display:inline-block;margin:0 8px;overflow:hidden;vertical-align:middle}.ant-transfer-operation .ant-btn{display:block}.ant-transfer-operation .ant-btn:first-child{margin-bottom:4px}.ant-transfer-operation .ant-btn .anticon{font-size:12px}.ant-transfer .ant-empty-image{max-height:-2px}.ant-transfer-rtl{direction:rtl}.ant-transfer-rtl .ant-transfer-list-search{padding-right:8px;padding-left:24px}.ant-transfer-rtl .ant-transfer-list-search-action{right:auto;left:12px}.ant-transfer-rtl .ant-transfer-list-header{right:0;left:auto}.ant-transfer-rtl .ant-transfer-list-header-title{right:auto;left:12px}.ant-transfer-rtl .ant-transfer-list-header .ant-checkbox-wrapper+span{padding-right:8px;padding-left:0}.ant-transfer-rtl .ant-transfer-list-body-search-wrapper{right:0;left:auto}.ant-transfer-rtl .ant-transfer-list-content-item>span{padding-left:0}.ant-transfer-rtl .ant-transfer-list-content-item-text{padding-right:8px;padding-left:0}.ant-transfer-rtl .ant-transfer-list-footer{right:0;left:auto}.ant-select-tree-checkbox{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;top:-.09em;display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;outline:none;cursor:pointer}.ant-select-tree-checkbox-input:focus+.ant-select-tree-checkbox-inner,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-inner,.ant-select-tree-checkbox:hover .ant-select-tree-checkbox-inner{border-color:#1890ff}.ant-select-tree-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #1890ff;border-radius:2px;visibility:hidden;-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;content:""}.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox:after,.ant-select-tree-checkbox:hover:after{visibility:visible}.ant-select-tree-checkbox-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;direction:ltr;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;border-collapse:separate;-webkit-transition:all .3s;transition:all .3s}.ant-select-tree-checkbox-inner:after{position:absolute;top:50%;left:22%;display:table;width:5.71428571px;height:9.14285714px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(0) translate(-50%,-50%);transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;-webkit-transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:" "}.ant-select-tree-checkbox-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1) translate(-50%,-50%);transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;-webkit-transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:" "}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-select-tree-checkbox-disabled{cursor:not-allowed}.ant-select-tree-checkbox-disabled.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{border-color:rgba(0,0,0,.25);-webkit-animation-name:none;animation-name:none}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-input{cursor:not-allowed}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{border-color:#f5f5f5;border-collapse:separate;-webkit-animation-name:none;animation-name:none}.ant-select-tree-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-tree-checkbox-disabled:hover:after,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-disabled:after{visibility:hidden}.ant-select-tree-checkbox-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset;cursor:pointer}.ant-select-tree-checkbox-wrapper.ant-select-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-select-tree-checkbox-wrapper+.ant-select-tree-checkbox-wrapper{margin-left:8px}.ant-select-tree-checkbox+span{padding-right:8px;padding-left:8px}.ant-select-tree-checkbox-group{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block}.ant-select-tree-checkbox-group-item{display:inline-block;margin-right:8px}.ant-select-tree-checkbox-group-item:last-child{margin-right:0}.ant-select-tree-checkbox-group-item+.ant-select-tree-checkbox-group-item{margin-left:0}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner:after{top:50%;left:50%;width:8px;height:8px;background-color:#1890ff;border:0;-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1);opacity:1;content:" "}.ant-select-tree-checkbox-indeterminate.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-tree-select-dropdown{padding:8px 4px 0}.ant-tree-select-dropdown-rtl{direction:rtl}.ant-tree-select-dropdown .ant-select-tree{border-radius:0}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner{-ms-flex-align:stretch;align-items:stretch}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner .ant-select-tree-treenode{padding-bottom:8px}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper{-ms-flex:auto;flex:auto}.ant-select-tree{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";background:#fff;border-radius:2px;-webkit-transition:background-color .3s;transition:background-color .3s}.ant-select-tree-focused:not(:hover):not(.ant-select-tree-active-focused){background:#e6f7ff}.ant-select-tree-list-holder-inner{-ms-flex-align:start;align-items:flex-start}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner{-ms-flex-align:stretch;align-items:stretch}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-node-content-wrapper{-ms-flex:auto;flex:auto}.ant-select-tree .ant-select-tree-treenode{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;padding:0 0 4px;outline:none}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper:hover{background:transparent}.ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper{background:#f5f5f5}.ant-select-tree-indent{-ms-flex-item-align:stretch;align-self:stretch;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree-indent-unit{display:inline-block;width:24px}.ant-select-tree .ant-select-tree-switcher{-ms-flex:none;flex:none;width:24px;height:24px;margin:0;line-height:24px;text-align:center;cursor:pointer}.ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon,.ant-select-tree .ant-select-tree-switcher .ant-tree-switcher-icon{font-size:10px;display:inline-block;vertical-align:baseline}.ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon svg,.ant-select-tree .ant-select-tree-switcher .ant-tree-switcher-icon svg{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.ant-select-tree .ant-select-tree-switcher-noop{cursor:default}.ant-select-tree .ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ant-select-tree .ant-select-tree-switcher-loading-icon{color:#1890ff}.ant-select-tree .ant-select-tree-checkbox{top:auto;margin:4px 8px 0 0}.ant-select-tree .ant-select-tree-node-content-wrapper{min-height:24px;margin:0;padding:0 4px;color:inherit;line-height:24px;background:transparent;border-radius:2px;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-select-tree .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected{background-color:#bae7ff}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle{display:inline-block;width:24px;height:24px;line-height:24px;text-align:center;vertical-align:top}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle:empty{display:none}.ant-select-tree-node-content-wrapper[draggable=true]{line-height:20px;border-top:2px solid transparent;border-bottom:2px solid transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree .ant-select-tree-treenode.drag-over>[draggable]{color:#fff;background-color:#1890ff;opacity:.8}.ant-select-tree .ant-select-tree-treenode.drag-over-gap-top>[draggable]{border-top-color:#1890ff}.ant-select-tree .ant-select-tree-treenode.drag-over-gap-bottom>[draggable]{border-bottom-color:#1890ff}.ant-select-tree-show-line .ant-select-tree-indent-unit{position:relative;height:100%}.ant-select-tree-show-line .ant-select-tree-indent-unit:before{position:absolute;top:calc(100% - 4px);right:-12px;bottom:-28px;border-right:1px solid #d9d9d9;content:""}.ant-select-tree-show-line .ant-select-tree-indent-unit-end:before,.ant-select-tree-show-line .ant-select-tree-treenode-motion:not(.ant-motion-collapse-leave):not(.ant-motion-collapse-appear-active) .ant-select-tree-indent-unit:before{display:none}.ant-select-tree-show-line .ant-select-tree-switcher{z-index:1;background:#fff}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@-webkit-keyframes antCheckboxEffect{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.5}to{-webkit-transform:scale(1.6);transform:scale(1.6);opacity:0}}@keyframes antCheckboxEffect{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.5}to{-webkit-transform:scale(1.6);transform:scale(1.6);opacity:0}}.ant-tree.ant-tree-directory .ant-tree-treenode{position:relative}.ant-tree.ant-tree-directory .ant-tree-treenode:before{position:absolute;top:0;right:0;bottom:4px;left:0;-webkit-transition:background-color .3s;transition:background-color .3s;content:"";pointer-events:none}.ant-tree.ant-tree-directory .ant-tree-treenode:hover:before{background:#f5f5f5}.ant-tree.ant-tree-directory .ant-tree-treenode>*{z-index:1}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-switcher{-webkit-transition:color .3s;transition:color .3s}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper{border-radius:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper.ant-tree-node-selected{color:#fff;background:transparent}.ant-tree.ant-tree-directory .ant-tree-treenode-selected:before,.ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover:before{background:#1890ff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher{color:#fff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-node-content-wrapper{color:#fff;background:transparent}.ant-tree-checkbox{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";position:relative;top:-.09em;display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;outline:none;cursor:pointer}.ant-tree-checkbox-input:focus+.ant-tree-checkbox-inner,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner,.ant-tree-checkbox:hover .ant-tree-checkbox-inner{border-color:#1890ff}.ant-tree-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #1890ff;border-radius:2px;visibility:hidden;-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;content:""}.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox:after,.ant-tree-checkbox:hover:after{visibility:visible}.ant-tree-checkbox-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;direction:ltr;background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;border-collapse:separate;-webkit-transition:all .3s;transition:all .3s}.ant-tree-checkbox-inner:after{position:absolute;top:50%;left:22%;display:table;width:5.71428571px;height:9.14285714px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(0) translate(-50%,-50%);transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;-webkit-transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:" "}.ant-tree-checkbox-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0}.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1) translate(-50%,-50%);transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;-webkit-transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:" "}.ant-tree-checkbox-checked .ant-tree-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-tree-checkbox-disabled{cursor:not-allowed}.ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{border-color:rgba(0,0,0,.25);-webkit-animation-name:none;animation-name:none}.ant-tree-checkbox-disabled .ant-tree-checkbox-input{cursor:not-allowed}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{border-color:#f5f5f5;border-collapse:separate;-webkit-animation-name:none;animation-name:none}.ant-tree-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tree-checkbox-disabled:hover:after,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-disabled:after{visibility:hidden}.ant-tree-checkbox-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset;cursor:pointer}.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-tree-checkbox-wrapper+.ant-tree-checkbox-wrapper{margin-left:8px}.ant-tree-checkbox+span{padding-right:8px;padding-left:8px}.ant-tree-checkbox-group{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";display:inline-block}.ant-tree-checkbox-group-item{display:inline-block;margin-right:8px}.ant-tree-checkbox-group-item:last-child{margin-right:0}.ant-tree-checkbox-group-item+.ant-tree-checkbox-group-item{margin-left:0}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner:after{top:50%;left:50%;width:8px;height:8px;background-color:#1890ff;border:0;-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1);opacity:1;content:" "}.ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-tree{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";background:#fff;border-radius:2px;-webkit-transition:background-color .3s;transition:background-color .3s}.ant-tree-focused:not(:hover):not(.ant-tree-active-focused){background:#e6f7ff}.ant-tree-list-holder-inner{-ms-flex-align:start;align-items:flex-start}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner{-ms-flex-align:stretch;align-items:stretch}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper{-ms-flex:auto;flex:auto}.ant-tree .ant-tree-treenode{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;padding:0 0 4px;outline:none}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree .ant-tree-treenode-active .ant-tree-node-content-wrapper{background:#f5f5f5}.ant-tree-indent{-ms-flex-item-align:stretch;align-self:stretch;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree-indent-unit{display:inline-block;width:24px}.ant-tree .ant-tree-switcher{-ms-flex:none;flex:none;width:24px;height:24px;margin:0;line-height:24px;text-align:center;cursor:pointer}.ant-tree .ant-tree-switcher .ant-select-tree-switcher-icon,.ant-tree .ant-tree-switcher .ant-tree-switcher-icon{font-size:10px;display:inline-block;vertical-align:baseline}.ant-tree .ant-tree-switcher .ant-select-tree-switcher-icon svg,.ant-tree .ant-tree-switcher .ant-tree-switcher-icon svg{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.ant-tree .ant-tree-switcher-noop{cursor:default}.ant-tree .ant-tree-switcher_close .ant-tree-switcher-icon svg{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ant-tree .ant-tree-switcher-loading-icon{color:#1890ff}.ant-tree .ant-tree-checkbox{top:auto;margin:4px 8px 0 0}.ant-tree .ant-tree-node-content-wrapper{min-height:24px;margin:0;padding:0 4px;color:inherit;line-height:24px;background:transparent;border-radius:2px;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-tree .ant-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:#bae7ff}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle{display:inline-block;width:24px;height:24px;line-height:24px;text-align:center;vertical-align:top}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle:empty{display:none}.ant-tree-node-content-wrapper[draggable=true]{line-height:20px;border-top:2px solid transparent;border-bottom:2px solid transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree .ant-tree-treenode.drag-over>[draggable]{color:#fff;background-color:#1890ff;opacity:.8}.ant-tree .ant-tree-treenode.drag-over-gap-top>[draggable]{border-top-color:#1890ff}.ant-tree .ant-tree-treenode.drag-over-gap-bottom>[draggable]{border-bottom-color:#1890ff}.ant-tree-show-line .ant-tree-indent-unit{position:relative;height:100%}.ant-tree-show-line .ant-tree-indent-unit:before{position:absolute;top:calc(100% - 4px);right:-12px;bottom:-28px;border-right:1px solid #d9d9d9;content:""}.ant-tree-show-line .ant-tree-indent-unit-end:before,.ant-tree-show-line .ant-tree-treenode-motion:not(.ant-motion-collapse-leave):not(.ant-motion-collapse-appear-active) .ant-tree-indent-unit:before{display:none}.ant-tree-show-line .ant-tree-switcher{z-index:1;background:#fff}.ant-tree-rtl,.ant-tree .ant-tree-treenode-rtl{direction:rtl}.ant-tree-rtl.ant-tree .ant-tree-switcher_close .ant-tree-switcher-icon svg{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ant-tree-rtl.ant-tree-show-line .ant-tree-indent-unit:before{right:auto;left:-12px;border-right:none;border-left:1px solid #d9d9d9}.ant-typography{color:rgba(0,0,0,.65)}.ant-typography.ant-typography-secondary{color:rgba(0,0,0,.45)}.ant-typography.ant-typography-warning{color:#faad14}.ant-typography.ant-typography-danger{color:#ff4d4f}.ant-typography.ant-typography-disabled{color:rgba(0,0,0,.25);cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-typography p,div.ant-typography{margin-bottom:1em}.ant-typography h1,h1.ant-typography{margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:600;font-size:38px;line-height:1.23}.ant-typography h2,h2.ant-typography{margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:600;font-size:30px;line-height:1.35}.ant-typography h3,h3.ant-typography{margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:600;font-size:24px;line-height:1.35}.ant-typography h4,h4.ant-typography{margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:600;font-size:20px;line-height:1.4}.ant-typography+h1.ant-typography,.ant-typography+h2.ant-typography,.ant-typography+h3.ant-typography,.ant-typography+h4.ant-typography,.ant-typography div+h1,.ant-typography div+h2,.ant-typography div+h3,.ant-typography div+h4,.ant-typography h1+h1,.ant-typography h1+h2,.ant-typography h1+h3,.ant-typography h1+h4,.ant-typography h2+h1,.ant-typography h2+h2,.ant-typography h2+h3,.ant-typography h2+h4,.ant-typography h3+h1,.ant-typography h3+h2,.ant-typography h3+h3,.ant-typography h3+h4,.ant-typography h4+h1,.ant-typography h4+h2,.ant-typography h4+h3,.ant-typography h4+h4,.ant-typography li+h1,.ant-typography li+h2,.ant-typography li+h3,.ant-typography li+h4,.ant-typography p+h1,.ant-typography p+h2,.ant-typography p+h3,.ant-typography p+h4,.ant-typography ul+h1,.ant-typography ul+h2,.ant-typography ul+h3,.ant-typography ul+h4{margin-top:1.2em}span.ant-typography-ellipsis{display:inline-block}.ant-typography a{color:#1890ff;text-decoration:none;outline:none;cursor:pointer;-webkit-transition:color .3s;transition:color .3s}.ant-typography a:focus,.ant-typography a:hover{color:#40a9ff}.ant-typography a:active{color:#096dd9}.ant-typography a:active,.ant-typography a:hover{text-decoration:none}.ant-typography a[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed;pointer-events:none}.ant-typography code{margin:0 .2em;padding:.2em .4em .1em;font-size:85%;background:rgba(0,0,0,.06);border:1px solid rgba(0,0,0,.06);border-radius:3px}.ant-typography mark{padding:0;background-color:#ffe58f}.ant-typography ins,.ant-typography u{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto}.ant-typography del,.ant-typography s{text-decoration:line-through}.ant-typography strong{font-weight:600}.ant-typography-copy,.ant-typography-edit,.ant-typography-expand{color:#1890ff;text-decoration:none;outline:none;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;margin-left:8px}.ant-typography-copy:focus,.ant-typography-copy:hover,.ant-typography-edit:focus,.ant-typography-edit:hover,.ant-typography-expand:focus,.ant-typography-expand:hover{color:#40a9ff}.ant-typography-copy:active,.ant-typography-edit:active,.ant-typography-expand:active{color:#096dd9}.ant-typography-copy-success,.ant-typography-copy-success:focus,.ant-typography-copy-success:hover{color:#52c41a}.ant-typography-edit-content{position:relative}div.ant-typography-edit-content{left:-12px;margin-top:-5px;margin-bottom:calc(1em - 6px)}.ant-typography-edit-content-confirm{position:absolute;right:10px;bottom:8px;color:rgba(0,0,0,.45);pointer-events:none}.ant-typography-edit-content textarea{-moz-transition:none}.ant-typography ol,.ant-typography ul{margin:0 0 1em;padding:0}.ant-typography ol li,.ant-typography ul li{margin:0 0 0 20px;padding:0 0 0 4px}.ant-typography ul{list-style-type:circle}.ant-typography ul ul{list-style-type:disc}.ant-typography ol{list-style-type:decimal}.ant-typography-ellipsis-single-line{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}span.ant-typography-ellipsis-single-line{vertical-align:bottom}.ant-typography-ellipsis-multiple-line{display:-webkit-box;-webkit-line-clamp:3; - /*! autoprefixer: ignore next */-webkit-box-orient:vertical;overflow:hidden}.ant-typography-rtl{direction:rtl}.ant-typography-rtl .ant-typography-copy,.ant-typography-rtl .ant-typography-edit,.ant-typography-rtl .ant-typography-expand{margin-right:8px;margin-left:0}.ant-typography-rtl .ant-typography-expand{float:left}div.ant-typography-edit-content.ant-typography-rtl{right:-12px;left:auto}.ant-typography-rtl .ant-typography-edit-content-confirm{right:auto;left:10px}.ant-typography-rtl.ant-typography ol li,.ant-typography-rtl.ant-typography ul li{margin:0 20px 0 0;padding:0 4px 0 0}.ant-upload{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";outline:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;width:100%;outline:none}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{display:table;float:left;width:104px;height:104px;margin-right:8px;margin-bottom:8px;text-align:center;vertical-align:top;background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;-webkit-transition:border-color .3s ease;transition:border-color .3s ease}.ant-upload.ant-upload-select-picture-card>.ant-upload{display:table-cell;width:100%;height:100%;padding:8px;text-align:center;vertical-align:middle}.ant-upload.ant-upload-select-picture-card:hover{border-color:#1890ff}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#d9d9d9}.ant-upload.ant-upload-drag{position:relative;width:100%;height:100%;text-align:center;background:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;-webkit-transition:border-color .3s;transition:border-color .3s}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#096dd9}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#40a9ff}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#40a9ff;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{margin:0 0 4px;color:rgba(0,0,0,.85);font-size:16px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:rgba(0,0,0,.45);font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:rgba(0,0,0,.25);font-size:30px;-webkit-transition:all .3s;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:rgba(0,0,0,.45)}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{display:table;content:""}.ant-upload-picture-card-wrapper:after{display:table;clear:both;content:""}.ant-upload-list{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum","tnum";line-height:1.5715}.ant-upload-list:after,.ant-upload-list:before{display:table;content:""}.ant-upload-list:after{clear:both}.ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-right:14px}.ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-right:28px}.ant-upload-list-item{position:relative;height:22.001px;margin-top:8px;font-size:14px}.ant-upload-list-item-name{display:inline-block;width:100%;padding-left:22px;overflow:hidden;line-height:1.5715;white-space:nowrap;text-overflow:ellipsis}.ant-upload-list-item-name-icon-count-1{padding-right:14px}.ant-upload-list-item-card-actions{position:absolute;right:0;opacity:0}.ant-upload-list-item-card-actions.picture{top:25px;line-height:1;opacity:1}.ant-upload-list-item-card-actions .anticon{padding-right:6px;color:rgba(0,0,0,.45)}.ant-upload-list-item-info{height:100%;padding:0 12px 0 4px;-webkit-transition:background-color .3s;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;width:100%;height:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{position:absolute;top:5px;color:rgba(0,0,0,.45);font-size:14px}.ant-upload-list-item .anticon-close{display:inline-block;font-size:10px;position:absolute;top:6px;right:4px;color:rgba(0,0,0,.45);line-height:0;cursor:pointer;opacity:0;-webkit-transition:all .3s;transition:all .3s}.ant-upload-list-item .anticon-close:hover{color:rgba(0,0,0,.65)}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:#f5f5f5}.ant-upload-list-item:hover .ant-upload-list-item-card-actions,.ant-upload-list-item:hover .anticon-close{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#ff4d4f}.ant-upload-list-item-error .ant-upload-list-item-card-actions{opacity:1}.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{color:#ff4d4f}.ant-upload-list-item-progress{position:absolute;bottom:-12px;width:100%;padding-left:26px;font-size:14px;line-height:0}.ant-upload-list-picture-card .ant-upload-list-item,.ant-upload-list-picture .ant-upload-list-item{position:relative;height:66px;padding:8px;border:1px solid #d9d9d9;border-radius:2px}.ant-upload-list-picture-card .ant-upload-list-item:hover,.ant-upload-list-picture .ant-upload-list-item:hover{background:transparent}.ant-upload-list-picture-card .ant-upload-list-item-error,.ant-upload-list-picture .ant-upload-list-item-error{border-color:#ff4d4f}.ant-upload-list-picture-card .ant-upload-list-item-info,.ant-upload-list-picture .ant-upload-list-item-info{padding:0}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info{background:transparent}.ant-upload-list-picture-card .ant-upload-list-item-uploading,.ant-upload-list-picture .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture .ant-upload-list-item-thumbnail{position:absolute;top:8px;left:8px;width:48px;height:48px;line-height:54px;text-align:center;opacity:.8}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#fff2f0}.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#ff4d4f}.ant-upload-list-picture-card .ant-upload-list-item-icon,.ant-upload-list-picture .ant-upload-list-item-icon{position:absolute;top:50%;left:50%;font-size:26px;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon,.ant-upload-list-picture .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture-card .ant-upload-list-item-image,.ant-upload-list-picture .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img,.ant-upload-list-picture .ant-upload-list-item-thumbnail img{display:block;width:48px;height:48px;overflow:hidden}.ant-upload-list-picture-card .ant-upload-list-item-name,.ant-upload-list-picture .ant-upload-list-item-name{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100%;margin:0 0 0 8px;padding-right:8px;padding-left:48px;overflow:hidden;line-height:44px;white-space:nowrap;text-overflow:ellipsis;-webkit-transition:all .3s;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1,.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1{padding-right:18px}.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2,.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2{padding-right:36px}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name{line-height:28px}.ant-upload-list-picture-card .ant-upload-list-item-progress,.ant-upload-list-picture .ant-upload-list-item-progress{bottom:14px;width:calc(100% - 24px);margin-top:0;padding-left:56px}.ant-upload-list-picture-card .anticon-close,.ant-upload-list-picture .anticon-close{position:absolute;top:8px;right:8px;line-height:1;opacity:1}.ant-upload-list-picture-card.ant-upload-list:after{display:none}.ant-upload-list-picture-card-container,.ant-upload-list-picture-card .ant-upload-list-item{float:left;width:104px;height:104px;margin:0 8px 8px 0}.ant-upload-list-picture-card .ant-upload-list-item-info{position:relative;height:100%;overflow:hidden}.ant-upload-list-picture-card .ant-upload-list-item-info:before{position:absolute;z-index:1;width:100%;height:100%;background-color:rgba(0,0,0,.5);opacity:0;-webkit-transition:all .3s;transition:all .3s;content:" "}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{position:absolute;top:50%;left:50%;z-index:10;white-space:nowrap;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;-webkit-transition:all .3s;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{z-index:10;width:16px;margin:0 4px;color:hsla(0,0%,100%,.85);font-size:16px;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{position:static;display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;margin:8px 0 0;padding:0;line-height:1.5715;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{position:absolute;bottom:10px;display:block}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:#fafafa}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;padding-left:0}.ant-upload-list .ant-upload-success-icon{color:#52c41a;font-weight:700}.ant-upload-list .ant-upload-animate-enter,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave,.ant-upload-list .ant-upload-animate-leave{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:cubic-bezier(.78,.14,.15,.86);animation-fill-mode:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-enter{-webkit-animation-name:uploadAnimateIn;animation-name:uploadAnimateIn}.ant-upload-list .ant-upload-animate-leave{-webkit-animation-name:uploadAnimateOut;animation-name:uploadAnimateOut}.ant-upload-list .ant-upload-animate-inline-enter{-webkit-animation-name:uploadAnimateInlineIn;animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{-webkit-animation-name:uploadAnimateInlineOut;animation-name:uploadAnimateInlineOut}@-webkit-keyframes uploadAnimateIn{0%{height:0;margin:0;padding:0;opacity:0}}@keyframes uploadAnimateIn{0%{height:0;margin:0;padding:0;opacity:0}}@-webkit-keyframes uploadAnimateOut{to{height:0;margin:0;padding:0;opacity:0}}@keyframes uploadAnimateOut{to{height:0;margin:0;padding:0;opacity:0}}@-webkit-keyframes uploadAnimateInlineIn{0%{width:0;height:0;margin:0;padding:0;opacity:0}}@keyframes uploadAnimateInlineIn{0%{width:0;height:0;margin:0;padding:0;opacity:0}}@-webkit-keyframes uploadAnimateInlineOut{to{width:0;height:0;margin:0;padding:0;opacity:0}}@keyframes uploadAnimateInlineOut{to{width:0;height:0;margin:0;padding:0;opacity:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{float:right;margin-right:0;margin-left:8px}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-right:22px;padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-right:22px;padding-left:28px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-right:22px;padding-left:0}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{right:auto;left:0}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-right:0;padding-left:5px}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item .anticon-close{right:auto;left:4px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-right:0;padding-left:5px}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-right:26px;padding-left:0}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail{right:8px;left:auto}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon{right:50%;left:auto;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name{margin:0 8px 0 0;padding-right:48px;padding-left:8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1{padding-right:48px;padding-left:18px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2{padding-right:48px;padding-left:36px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress{padding-right:56px;padding-left:0}.ant-upload-list-rtl.ant-upload-list-picture-card .anticon-close,.ant-upload-list-rtl.ant-upload-list-picture .anticon-close{right:auto;left:8px}.ant-upload-list-rtl .ant-upload-list-picture-card-container,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item{float:right;margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{right:50%;left:auto;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-info{padding:0} -/*# sourceMappingURL=2.63b65d4e.chunk.css.map */ \ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css.map.REMOVED.git-id b/Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css.map.REMOVED.git-id deleted file mode 100644 index 0a040f95c..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css.map.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b08a15bae8cfee93d20507de17e736616121cc5c \ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css b/Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css deleted file mode 100644 index 490dfba6a..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css +++ /dev/null @@ -1,2 +0,0 @@ -body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}@-webkit-keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}} -/*# sourceMappingURL=main.2d51ff4f.chunk.css.map */ \ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css.map b/Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css.map deleted file mode 100644 index 5c05aedd4..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["index.css","App.css"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CCVA,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,mDAA4C,CAA5C,2CACF,CACF,CAEA,YACE,wBAAyB,CACzB,gBAAiB,CACjB,YAAa,CACb,qBAAsB,CACtB,kBAAmB,CACnB,sBAAuB,CACvB,4BAA6B,CAC7B,UACF,CAEA,UACE,aACF,CAEA,iCACE,GACE,sBACF,CACA,GACE,uBACF,CACF,CAPA,yBACE,GACE,sBACF,CACA,GACE,uBACF,CACF","file":"main.2d51ff4f.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","@import '~antd/dist/antd.css';\n\n.App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"]} \ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/static/js/2.a0af91be.chunk.js b/Web/webSdkDemo-NG/basic_video_call/build/static/js/2.a0af91be.chunk.js deleted file mode 100644 index ca1cd8d2c..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/static/js/2.a0af91be.chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see 2.a0af91be.chunk.js.LICENSE.txt */ -(this.webpackJsonpbasic_video_call=this.webpackJsonpbasic_video_call||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(26)},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t}),{})}t.svgBaseProps={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"};var m="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";t.iconStyles=m;var h=!1;t.useInsertStyles=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;(0,a.useEffect)((function(){h||((0,l.insertCss)(e,{prepend:!0}),h=!0)}),[])}},function(e,t,n){"use strict";var r={};function o(e,t){0}function a(e,t,n){t||r[n]||(e(!1,n),r[n]=!0)}t.a=function(e,t){a(o,e,t)}},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=(r=n(63))&&r.__esModule?r:{default:r};t.default=o,e.exports=o},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,l,u=i(e),c=1;c0?r:n)(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(12);function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&setTimeout((function(){e.onMotionEnd({deadline:!0})}),r)}}))},e.nextFrame=function(t){e.cancelNextFrame(),e.raf=c()(t)},e.cancelNextFrame=function(){e.raf&&(c.a.cancel(e.raf),e.raf=null)},e.state={status:"none",statusActive:!1,newStatus:!1,statusStyle:null},e.$cacheEle=null,e.node=null,e.raf=null,e}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),d(t,[{key:"componentDidMount",value:function(){this.onDomUpdate()}},{key:"componentDidUpdate",value:function(){this.onDomUpdate()}},{key:"componentWillUnmount",value:function(){this._destroyed=!0,this.removeEventListener(this.$cacheEle),this.cancelNextFrame()}},{key:"render",value:function(){var e,t=this.state,n=t.status,o=t.statusActive,a=t.statusStyle,i=this.props,u=i.children,c=i.motionName,d=i.visible,m=i.removeOnLeave,h=i.leavedClassName,v=i.eventProps;return u?"none"!==n&&r(this.props)?u(f({},v,{className:l()((e={},p(e,Object(s.b)(c,n),"none"!==n),p(e,Object(s.b)(c,n+"-active"),"none"!==n&&o),p(e,c,"string"===typeof c),e)),style:a}),this.setNodeRef):d?u(f({},v),this.setNodeRef):m?null:u(f({},v,{className:h}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,o=t.status;if(!r(e))return{};var a=e.visible,i=e.motionAppear,l=e.motionEnter,u=e.motionLeave,c=e.motionLeaveImmediately,s={prevProps:e};return("appear"===o&&!i||"enter"===o&&!l||"leave"===o&&!u)&&(s.status="none",s.statusActive=!1,s.newStatus=!1),!n&&a&&i&&(s.status="appear",s.statusActive=!1,s.newStatus=!0),n&&!n.visible&&a&&l&&(s.status="enter",s.statusActive=!1,s.newStatus=!0),(n&&n.visible&&!a&&u||!n&&c&&!a&&u)&&(s.status="leave",s.statusActive=!1,s.newStatus=!0),s}}]),t}(o.a.Component);return i.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},n?o.a.forwardRef((function(e,t){return o.a.createElement(i,f({internalRef:t},e))})):i}(s.c)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n.n(r);function a(e){return e instanceof HTMLElement?e:o.a.findDOMNode(e)}},,function(e,t,n){"use strict";var r=n(15),o="function"===typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113,m=o?Symbol.for("react.memo"):60115,h=o?Symbol.for("react.lazy"):60116,v="function"===typeof Symbol&&Symbol.iterator;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nN.length&&N.push(e)}function j(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case a:case i:u=!0}}if(u)return r(o,t,""===n?"."+z(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c

+ * If the previous EGLSurface isn't fully destroyed, e.g. it's still current on a + * context somewhere, the create call will fail with complaints from the Surface + * about already being connected. + */ + public void recreate(EglCore newEglCore) { + if (mSurface == null) { + throw new RuntimeException("not yet implemented for SurfaceTexture"); + } + mEglCore = newEglCore; // switch to new context + createWindowSurface(mSurface); // create new surface + } +} diff --git a/Android/APIExample/settings.gradle b/Android/APIExample/settings.gradle index f3d24886f..793eb282f 100644 --- a/Android/APIExample/settings.gradle +++ b/Android/APIExample/settings.gradle @@ -2,3 +2,4 @@ rootProject.name='APIExample' include ':app' include ':lib-stream-encrypt' include ':lib-component' +include ':lib-push-externalvideo' From 4757f89746e99c6f3070fc47c726bd6b5a0d4414 Mon Sep 17 00:00:00 2001 From: CavanSu <403029552@qq.com> Date: Tue, 23 Jun 2020 10:37:00 +0800 Subject: [PATCH 030/430] mac join video channel --- iOS/APIExample-Mac/Base.lproj/Main.storyboard | 17 +++++--- iOS/APIExample-Mac/Info.plist | 4 ++ iOS/APIExample-Mac/Popover.storyboard | 2 +- iOS/APIExample-Mac/ReplaceSegue.swift | 16 +++++++ iOS/APIExample.xcodeproj/project.pbxproj | 6 +++ .../Common/BaseViewController.swift | 41 ++++++++++++++++-- iOS/APIExample/Common/KeyCenter.swift | 4 +- iOS/APIExample/Common/LogViewController.swift | 10 ++--- .../Examples/Advanced/RTMPInjection.swift | 18 ++++---- .../Examples/Advanced/RTMPStreaming.swift | 22 +++++----- .../Examples/Advanced/VideoMetadata.swift | 22 +++++----- .../Examples/Basic/JoinChannelAudio.swift | 20 ++++----- .../Examples/Basic/JoinChannelVideo.swift | 42 ++++++++++--------- iOS/APIExample/ViewController.swift | 32 ++++++++++---- 14 files changed, 169 insertions(+), 87 deletions(-) create mode 100644 iOS/APIExample-Mac/ReplaceSegue.swift diff --git a/iOS/APIExample-Mac/Base.lproj/Main.storyboard b/iOS/APIExample-Mac/Base.lproj/Main.storyboard index 89e201a21..0efac5698 100644 --- a/iOS/APIExample-Mac/Base.lproj/Main.storyboard +++ b/iOS/APIExample-Mac/Base.lproj/Main.storyboard @@ -789,7 +789,7 @@ - + @@ -856,6 +856,7 @@ + @@ -876,7 +877,7 @@ - + @@ -911,18 +912,22 @@ + + + + - + - + - + - + diff --git a/iOS/APIExample-Mac/Info.plist b/iOS/APIExample-Mac/Info.plist index a544ad3ab..8287dbfd1 100644 --- a/iOS/APIExample-Mac/Info.plist +++ b/iOS/APIExample-Mac/Info.plist @@ -32,5 +32,9 @@ NSSupportsSuddenTermination + NSMicrophoneUsageDescription + Mic + NSCameraUsageDescription + Camera diff --git a/iOS/APIExample-Mac/Popover.storyboard b/iOS/APIExample-Mac/Popover.storyboard index 36bd4ffda..e230ad9c5 100644 --- a/iOS/APIExample-Mac/Popover.storyboard +++ b/iOS/APIExample-Mac/Popover.storyboard @@ -8,7 +8,7 @@ - + diff --git a/iOS/APIExample-Mac/ReplaceSegue.swift b/iOS/APIExample-Mac/ReplaceSegue.swift new file mode 100644 index 000000000..c1cde9199 --- /dev/null +++ b/iOS/APIExample-Mac/ReplaceSegue.swift @@ -0,0 +1,16 @@ +// +// ReplaceSegue.swift +// Agora-Rtm-Tutorial-Mac +// +// Created by CavanSu on 2019/1/31. +// Copyright © 2019 Agora. All rights reserved. +// + +import Cocoa + +class ReplaceSegue: NSStoryboardSegue { + override func perform() { + let sourceVC = self.sourceController as! NSViewController + sourceVC.view.window?.contentViewController = self.destinationController as? NSViewController + } +} diff --git a/iOS/APIExample.xcodeproj/project.pbxproj b/iOS/APIExample.xcodeproj/project.pbxproj index 885f2f89a..0c9cb65e2 100644 --- a/iOS/APIExample.xcodeproj/project.pbxproj +++ b/iOS/APIExample.xcodeproj/project.pbxproj @@ -40,6 +40,8 @@ A75A56DD24A0603100D0089E /* RTMPStreaming.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75A56D824A0603000D0089E /* RTMPStreaming.swift */; }; A75A56DE24A0603100D0089E /* VideoMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75A56D924A0603000D0089E /* VideoMetadata.swift */; }; A75A56DF24A0603100D0089E /* RTMPInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75A56DA24A0603000D0089E /* RTMPInjection.swift */; }; + A75A56E124A06AA600D0089E /* ReplaceSegue.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75A56E024A06AA600D0089E /* ReplaceSegue.swift */; }; + A75A56E224A06DBC00D0089E /* JoinChannelVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75A56D424A0603000D0089E /* JoinChannelVideo.swift */; }; A7847F922458062900469187 /* StatisticsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F912458062900469187 /* StatisticsInfo.swift */; }; A7847F942458089E00469187 /* AgoraExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7847F932458089E00469187 /* AgoraExtension.swift */; }; A7BD7660247CC6920062A6B3 /* UITypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */; }; @@ -90,6 +92,7 @@ A75A56D824A0603000D0089E /* RTMPStreaming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RTMPStreaming.swift; sourceTree = ""; }; A75A56D924A0603000D0089E /* VideoMetadata.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoMetadata.swift; sourceTree = ""; }; A75A56DA24A0603000D0089E /* RTMPInjection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RTMPInjection.swift; sourceTree = ""; }; + A75A56E024A06AA600D0089E /* ReplaceSegue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReplaceSegue.swift; sourceTree = ""; }; A7847F912458062900469187 /* StatisticsInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatisticsInfo.swift; sourceTree = ""; }; A7847F932458089E00469187 /* AgoraExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AgoraExtension.swift; sourceTree = ""; }; A7BD765F247CC6920062A6B3 /* UITypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITypeAlias.swift; sourceTree = ""; }; @@ -259,6 +262,7 @@ A7BD7666247CCAA80062A6B3 /* APIExample-Mac */ = { isa = PBXGroup; children = ( + A75A56E024A06AA600D0089E /* ReplaceSegue.swift */, A7BD766D247CCAAA0062A6B3 /* Main.storyboard */, A7584AEF2480B4FE0088FACB /* Popover.storyboard */, A70FE7B92489F07000C38E3C /* Supporting Files */, @@ -499,11 +503,13 @@ buildActionMask = 2147483647; files = ( A7BD7675247CCAC80062A6B3 /* ViewController.swift in Sources */, + A75A56E224A06DBC00D0089E /* JoinChannelVideo.swift in Sources */, A70FE7B52489EEEA00C38E3C /* VideoView.swift in Sources */, A70FE7B42489EEC000C38E3C /* (null) in Sources */, A7584B062480E18A0088FACB /* LogViewController.swift in Sources */, A7584B052480C0F80088FACB /* BaseViewController.swift in Sources */, A7BD7668247CCAA80062A6B3 /* AppDelegate.swift in Sources */, + A75A56E124A06AA600D0089E /* ReplaceSegue.swift in Sources */, A70FE7B62489EF3800C38E3C /* StatisticsInfo.swift in Sources */, A70FE7B72489EFC200C38E3C /* KeyCenter.swift in Sources */, A70FE7B82489F04500C38E3C /* AgoraExtension.swift in Sources */, diff --git a/iOS/APIExample/Common/BaseViewController.swift b/iOS/APIExample/Common/BaseViewController.swift index ce663bf28..9ad3d522d 100644 --- a/iOS/APIExample/Common/BaseViewController.swift +++ b/iOS/APIExample/Common/BaseViewController.swift @@ -41,15 +41,50 @@ class BaseViewController: AGViewController { self.present(newViewController, animated: true, completion: nil) } - func showAlert(title: String?, msg:String) { - let alertController = UIAlertController(title: title, message: msg, preferredStyle: .alert) + #else + + override func viewDidAppear() { + super.viewDidAppear() + view.window?.delegate = self + } + #endif + + func showAlert(title: String? = nil, message: String) { + #if os(iOS) + let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) let action = UIAlertAction(title: "OK", style: .cancel, handler: nil) alertController.addAction(action) self.present(alertController, animated: true, completion: nil) + + #else + + let alert = NSAlert() + + var full = message + if let title = title { + full = title + full + } + + alert.messageText = full + alert.addButton(withTitle: "OK") + alert.alertStyle = .informational + guard let window = NSApplication.shared.windows.first else { + return + } + alert.beginSheetModal(for: window, completionHandler: nil) + #endif } - #endif } +#if os(macOS) +extension BaseViewController: NSWindowDelegate { + func windowShouldClose(_ sender: NSWindow) -> Bool { + closeDelegate?.viewControllerNeedClose(self) + return false + } +} +#endif + class RenderViewController: AGViewController { private var streamViews: [AGView]? diff --git a/iOS/APIExample/Common/KeyCenter.swift b/iOS/APIExample/Common/KeyCenter.swift index 1b7de54eb..0de8c2ad3 100644 --- a/iOS/APIExample/Common/KeyCenter.swift +++ b/iOS/APIExample/Common/KeyCenter.swift @@ -7,8 +7,8 @@ // struct KeyCenter { - static let AppId: String = "" + static let AppId: String = <#Your App Id#> // assign token to nil if you have not enabled app certificate - static var Token: String? = nil + static var Token: String? = <#Temp Access Token#> } diff --git a/iOS/APIExample/Common/LogViewController.swift b/iOS/APIExample/Common/LogViewController.swift index 43eeb9aa7..2b9b40e94 100644 --- a/iOS/APIExample/Common/LogViewController.swift +++ b/iOS/APIExample/Common/LogViewController.swift @@ -26,7 +26,7 @@ enum LogLevel { } struct LogItem { - var msg:String + var message:String var level:LogLevel var dateTime:Date } @@ -34,9 +34,9 @@ struct LogItem { class LogUtils { static var logs:[LogItem] = [] - static func log(msg:String, level: LogLevel) { - LogUtils.logs.append(LogItem(msg: msg, level: level, dateTime: Date())) - print("\(level.description): \(msg)") + static func log(message: String, level: LogLevel) { + LogUtils.logs.append(LogItem(message: message, level: level, dateTime: Date())) + print("\(level.description): \(message)") } static func removeAll() { @@ -66,7 +66,7 @@ extension LogViewController: UITableViewDataSource { cell?.textLabel?.lineBreakMode = .byWordWrapping; let dateFormatterPrint = DateFormatter() dateFormatterPrint.dateFormat = "yyyy-MM-dd HH:mm:ss" - cell?.textLabel?.text = "\(dateFormatterPrint.string(from: logitem.dateTime)) - \(logitem.level.description): \(logitem.msg)" + cell?.textLabel?.text = "\(dateFormatterPrint.string(from: logitem.dateTime)) - \(logitem.level.description): \(logitem.message)" return cell! } } diff --git a/iOS/APIExample/Examples/Advanced/RTMPInjection.swift b/iOS/APIExample/Examples/Advanced/RTMPInjection.swift index 5ed65fd43..d70df8264 100644 --- a/iOS/APIExample/Examples/Advanced/RTMPInjection.swift +++ b/iOS/APIExample/Examples/Advanced/RTMPInjection.swift @@ -48,7 +48,7 @@ class RTMPInjection: BaseViewController { } agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } @@ -117,7 +117,7 @@ class RTMPInjection: BaseViewController { // Error code description can be found at: // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + self.showAlert(title: "Error", message: "joinChannel call failed: \(result), please check your params") } } @@ -146,7 +146,7 @@ extension RTMPInjection: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// @param warningCode warning code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { - LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + LogUtils.log(message: "warning: \(warningCode.description)", level: .warning) } /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand @@ -156,14 +156,14 @@ extension RTMPInjection: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { - LogUtils.log(msg: "error: \(errorCode.description)", level: .error) + LogUtils.log(message: "error: \(errorCode.description)", level: .error) } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param elapsed time elapse since current sdk instance join the channel in ms func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { - LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + LogUtils.log(message: "remote user join: \(uid) \(elapsed)ms", level: .info) /// RTMP Inject stream uid is always 666 if uid != 666 { @@ -195,7 +195,7 @@ extension RTMPInjection: AgoraRtcEngineDelegate { /// @param reason reason why this user left, note this event may be triggered when the remote user /// become an audience in live broadcasting profile func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { - LogUtils.log(msg: "remote user left: \(uid) reason \(reason.rawValue)", level: .info) + LogUtils.log(message: "remote user left: \(uid) reason \(reason.rawValue)", level: .info) // to unlink your view from sdk, so that your view reference will be released // note the video will stay at its last frame, to completely remove it @@ -214,11 +214,11 @@ extension RTMPInjection: AgoraRtcEngineDelegate { /// @param uid User ID. /// @param status Status of the externally injected stream. See AgoraInjectStreamStatus. func rtcEngine(_ engine: AgoraRtcEngineKit, streamInjectedStatusOfUrl url: String, uid: UInt, status: AgoraInjectStreamStatus) { - LogUtils.log(msg: "rtmp injection: \(url) status \(status.rawValue)", level: .info) + LogUtils.log(message: "rtmp injection: \(url) status \(status.rawValue)", level: .info) if status == .startSuccess { - self.showAlert(title: "Notice", msg: "RTMP Inject Success") + self.showAlert(title: "Notice", message: "RTMP Inject Success") } else if status == .startFailed { - self.showAlert(title: "Error", msg: "RTMP Inject Failed") + self.showAlert(title: "Error", message: "RTMP Inject Failed") } } } diff --git a/iOS/APIExample/Examples/Advanced/RTMPStreaming.swift b/iOS/APIExample/Examples/Advanced/RTMPStreaming.swift index 157047149..99bc582af 100644 --- a/iOS/APIExample/Examples/Advanced/RTMPStreaming.swift +++ b/iOS/APIExample/Examples/Advanced/RTMPStreaming.swift @@ -50,7 +50,7 @@ class RTMPStreamingMain: BaseViewController { } agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } @@ -106,7 +106,7 @@ class RTMPStreamingMain: BaseViewController { // the token has to match the ones used for channel join let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) { [unowned self] (channel, uid, elapsed) -> Void in self.isJoined = true - LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + LogUtils.log(message: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) // add transcoding user so the video stream will be involved // in future RTMP Stream @@ -120,7 +120,7 @@ class RTMPStreamingMain: BaseViewController { // Error code description can be found at: // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + self.showAlert(title: "Error", message: "joinChannel call failed: \(result), please check your params") } } @@ -152,7 +152,7 @@ extension RTMPStreamingMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// @param warningCode warning code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { - LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + LogUtils.log(message: "warning: \(warningCode.description)", level: .warning) } /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand @@ -162,14 +162,14 @@ extension RTMPStreamingMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { - LogUtils.log(msg: "error: \(errorCode.description)", level: .error) + LogUtils.log(message: "error: \(errorCode.description)", level: .error) } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param elapsed time elapse since current sdk instance join the channel in ms func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { - LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + LogUtils.log(message: "remote user join: \(uid) \(elapsed)ms", level: .info) // only one remote video view is available for this // tutorial. Here we check if there exists a surface @@ -201,7 +201,7 @@ extension RTMPStreamingMain: AgoraRtcEngineDelegate { /// @param reason reason why this user left, note this event may be triggered when the remote user /// become an audience in live broadcasting profile func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { - LogUtils.log(msg: "remote user left: \(uid) reason \(reason.rawValue)", level: .info) + LogUtils.log(message: "remote user left: \(uid) reason \(reason.rawValue)", level: .info) // to unlink your view from sdk, so that your view reference will be released // note the video will stay at its last frame, to completely remove it @@ -227,16 +227,16 @@ extension RTMPStreamingMain: AgoraRtcEngineDelegate { /// @param state state of rtmp streaming /// @param reason func rtcEngine(_ engine: AgoraRtcEngineKit, rtmpStreamingChangedToState url: String, state: AgoraRtmpStreamingState, errorCode: AgoraRtmpStreamingErrorCode) { - LogUtils.log(msg: "rtmp streaming: \(url) state \(state.rawValue) error \(errorCode.rawValue)", level: .info) + LogUtils.log(message: "rtmp streaming: \(url) state \(state.rawValue) error \(errorCode.rawValue)", level: .info) if(state == .running) { - self.showAlert(title: "Notice", msg: "RTMP Publish Success") + self.showAlert(title: "Notice", message: "RTMP Publish Success") } else if(state == .failure) { - self.showAlert(title: "Error", msg: "RTMP Publish Failed: \(errorCode.rawValue)") + self.showAlert(title: "Error", message: "RTMP Publish Failed: \(errorCode.rawValue)") } } /// callback when live transcoding is properly updated func rtcEngineTranscodingUpdated(_ engine: AgoraRtcEngineKit) { - LogUtils.log(msg: "live transcoding updated", level: .info) + LogUtils.log(message: "live transcoding updated", level: .info) } } diff --git a/iOS/APIExample/Examples/Advanced/VideoMetadata.swift b/iOS/APIExample/Examples/Advanced/VideoMetadata.swift index 84cf23582..ce09bd4c7 100644 --- a/iOS/APIExample/Examples/Advanced/VideoMetadata.swift +++ b/iOS/APIExample/Examples/Advanced/VideoMetadata.swift @@ -54,7 +54,7 @@ class VideoMetadataMain: BasicVideoViewController { // leave channel when exiting the view if(isJoined) { agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } @@ -96,14 +96,14 @@ class VideoMetadataMain: BasicVideoViewController { // the token has to match the ones used for channel join let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in self.isJoined = true - LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + LogUtils.log(message: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) } if(result != 0) { // Usually happens with invalid parameters // Error code description can be found at: // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + self.showAlert(title: "Error", message: "joinChannel call failed: \(result), please check your params") } } @@ -123,7 +123,7 @@ extension VideoMetadataMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// @param warningCode warning code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { - LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + LogUtils.log(message: "warning: \(warningCode.description)", level: .warning) } /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand @@ -133,15 +133,15 @@ extension VideoMetadataMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { - LogUtils.log(msg: "error: \(errorCode)", level: .error) - self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") + LogUtils.log(message: "error: \(errorCode)", level: .error) + self.showAlert(title: "Error", message: "Error \(errorCode.description) occur") } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param elapsed time elapse since current sdk instance join the channel in ms func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { - LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + LogUtils.log(message: "remote user join: \(uid) \(elapsed)ms", level: .info) // Only one remote video view is available for this // tutorial. Here we check if there exists a surface @@ -159,7 +159,7 @@ extension VideoMetadataMain: AgoraRtcEngineDelegate { /// @param reason reason why this user left, note this event may be triggered when the remote user /// become an audience in live broadcasting profile func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { - LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) + LogUtils.log(message: "remote user left: \(uid) reason \(reason)", level: .info) // to unlink your view from sdk, so that your view reference will be released // note the video will stay at its last frame, to completely remove it @@ -193,10 +193,10 @@ extension VideoMetadataMain : AgoraMediaMetadataDelegate, AgoraMediaMetadataData if(metadata.count > MAX_META_LENGTH) { //if data exceeding limit, return nil to not send anything - LogUtils.log(msg: "invalid metadata: length exceeds \(MAX_META_LENGTH)", level: .info) + LogUtils.log(message: "invalid metadata: length exceeds \(MAX_META_LENGTH)", level: .info) return nil } - LogUtils.log(msg: "metadata sent", level: .info) + LogUtils.log(message: "metadata sent", level: .info) self.metadata = nil return metadata } @@ -207,7 +207,7 @@ extension VideoMetadataMain : AgoraMediaMetadataDelegate, AgoraMediaMetadataData /// @param timestamp The timestamp (ms) of the received metadata. func receiveMetadata(_ data: Data, fromUser uid: Int, atTimestamp timestamp: TimeInterval) { DispatchQueue.main.async { - LogUtils.log(msg: "metadata received", level: .info) + LogUtils.log(message: "metadata received", level: .info) let alert = UIAlertController(title: "Metadata received", message: String(data: data, encoding: .utf8), preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) self.present(alert, animated: true, completion: nil) diff --git a/iOS/APIExample/Examples/Basic/JoinChannelAudio.swift b/iOS/APIExample/Examples/Basic/JoinChannelAudio.swift index 59d50d86a..a3a336325 100644 --- a/iOS/APIExample/Examples/Basic/JoinChannelAudio.swift +++ b/iOS/APIExample/Examples/Basic/JoinChannelAudio.swift @@ -6,13 +6,9 @@ // Copyright © 2020 Agora Corp. All rights reserved. // -import UIKit - -import Foundation import UIKit import AgoraRtcKit - class JoinChannelAudioMain: BaseViewController { @IBOutlet weak var joinButton: UIButton! @IBOutlet weak var channelTextField: UITextField! @@ -38,7 +34,7 @@ class JoinChannelAudioMain: BaseViewController { // leave channel when exiting the view if(isJoined) { agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } @@ -68,14 +64,14 @@ class JoinChannelAudioMain: BaseViewController { // the token has to match the ones used for channel join let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in self.isJoined = true - LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + LogUtils.log(message: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) } if(result != 0) { // Usually happens with invalid parameters // Error code description can be found at: // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html - self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + self.showAlert(title: "Error", message: "joinChannel call failed: \(result), please check your params") } } } @@ -89,7 +85,7 @@ extension JoinChannelAudioMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// @param warningCode warning code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { - LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + LogUtils.log(message: "warning: \(warningCode.description)", level: .warning) } /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand @@ -99,15 +95,15 @@ extension JoinChannelAudioMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { - LogUtils.log(msg: "error: \(errorCode)", level: .error) - self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") + LogUtils.log(message: "error: \(errorCode)", level: .error) + self.showAlert(title: "Error", message: "Error \(errorCode.description) occur") } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param elapsed time elapse since current sdk instance join the channel in ms func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { - LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + LogUtils.log(message: "remote user join: \(uid) \(elapsed)ms", level: .info) } /// callback when a remote user is leaving the channel, note audience in live broadcast mode will NOT trigger this event @@ -115,6 +111,6 @@ extension JoinChannelAudioMain: AgoraRtcEngineDelegate { /// @param reason reason why this user left, note this event may be triggered when the remote user /// become an audience in live broadcasting profile func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { - LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) + LogUtils.log(message: "remote user left: \(uid) reason \(reason)", level: .info) } } diff --git a/iOS/APIExample/Examples/Basic/JoinChannelVideo.swift b/iOS/APIExample/Examples/Basic/JoinChannelVideo.swift index d0de9f33a..be83dab8f 100644 --- a/iOS/APIExample/Examples/Basic/JoinChannelVideo.swift +++ b/iOS/APIExample/Examples/Basic/JoinChannelVideo.swift @@ -31,6 +31,7 @@ class JoinChannelVideoMain: BasicVideoViewController { } } + #if os(iOS) override func viewDidLoad() { super.viewDidLoad() // layout render view @@ -40,13 +41,12 @@ class JoinChannelVideoMain: BasicVideoViewController { agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) } - #if os(iOS) override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // leave channel when exiting the view if(isJoined) { agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } @@ -56,13 +56,21 @@ class JoinChannelVideoMain: BasicVideoViewController { } #else + override func viewDidAppear() { + super.viewDidAppear() + // layout render view + renderVC.layoutStream(views: [localVideo, remoteVideo]) + + // set up agora instance when view loaded + agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: KeyCenter.AppId, delegate: self) + } override func viewWillDisappear() { super.viewWillDisappear() // leave channel when exiting the view if(isJoined) { agoraKit.leaveChannel { (stats) -> Void in - LogUtils.log(msg: "left channel, duration: \(stats.duration)", level: .info) + LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } @@ -103,7 +111,7 @@ class JoinChannelVideoMain: BasicVideoViewController { // the token has to match the ones used for channel join let result = agoraKit.joinChannel(byToken: nil, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in self.isJoined = true - LogUtils.log(msg: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) + LogUtils.log(message: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) } if(result != 0) { // Usually happens with invalid parameters @@ -111,10 +119,14 @@ class JoinChannelVideoMain: BasicVideoViewController { // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html #if os(iOS) - self.showAlert(title: "Error", msg: "joinChannel call failed: \(result), please check your params") + self.showAlert(title: "Error", message: "joinChannel call failed: \(result), please check your params") #endif } } + + deinit { + print("deinit") + } } /// agora rtc engine delegate events @@ -126,7 +138,7 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// @param warningCode warning code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { - LogUtils.log(msg: "warning: \(warningCode.description)", level: .warning) + LogUtils.log(message: "warning: \(warningCode.description)", level: .warning) } /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand @@ -136,17 +148,15 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate { /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { - LogUtils.log(msg: "error: \(errorCode)", level: .error) - #if os(iOS) - self.showAlert(title: "Error", msg: "Error \(errorCode.description) occur") - #endif + LogUtils.log(message: "error: \(errorCode)", level: .error) + self.showAlert(title: "Error", message: "Error \(errorCode.description) occur") } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param elapsed time elapse since current sdk instance join the channel in ms func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { - LogUtils.log(msg: "remote user join: \(uid) \(elapsed)ms", level: .info) + LogUtils.log(message: "remote user join: \(uid) \(elapsed)ms", level: .info) // Only one remote video view is available for this // tutorial. Here we check if there exists a surface @@ -164,7 +174,7 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate { /// @param reason reason why this user left, note this event may be triggered when the remote user /// become an audience in live broadcasting profile func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { - LogUtils.log(msg: "remote user left: \(uid) reason \(reason)", level: .info) + LogUtils.log(message: "remote user left: \(uid) reason \(reason)", level: .info) // to unlink your view from sdk, so that your view reference will be released // note the video will stay at its last frame, to completely remove it @@ -177,11 +187,3 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate { agoraKit.setupRemoteVideo(videoCanvas) } } - -#if os(macOS) -extension JoinChannelVideoMain: NSWindowDelegate { - func windowShouldClose(_ sender: NSWindow) -> Bool { - return false - } -} -#endif diff --git a/iOS/APIExample/ViewController.swift b/iOS/APIExample/ViewController.swift index 51dfb30bf..14de49171 100644 --- a/iOS/APIExample/ViewController.swift +++ b/iOS/APIExample/ViewController.swift @@ -23,6 +23,7 @@ struct MenuItem { } class ViewController: AGViewController { + #if os(iOS) var menus:[MenuSection] = [ MenuSection(name: "Basic", rows: [ MenuItem(name: "Join a channel (Video)", controller: "JoinChannelVideo"), @@ -33,13 +34,16 @@ class ViewController: AGViewController { MenuItem(name: "RTMP Injection", controller: "RTMPInjection"), MenuItem(name: "Video metadata", controller: "VideoMetadata") ]), -// MenuSection(name: "Quality Metrics", rows: [ -// MenuItem(name: "Lastmile Test", controller: "Lastmile"), -// MenuItem(name: "Realtime Stats", controller: "RealtimeStats") -// ]) ] - #if os(macOS) + #else + + var menus:[MenuSection] = [ + MenuSection(name: "Basic", rows: [ + MenuItem(name: "Join a channel (Video)", controller: "JoinChannelVideoMain") + ]) + ] + @IBOutlet weak var sectionTableView: NSTableView! @IBOutlet weak var subTableView: NSTableView! @@ -49,6 +53,12 @@ class ViewController: AGViewController { super.viewDidLoad() sectionTableView.selectRowIndexes(IndexSet(integer: 0), byExtendingSelection: false) } + + override func prepare(for segue: NSStoryboardSegue, sender: Any?) { + if let vc = segue.destinationController as? BaseViewController { + vc.closeDelegate = self + } + } #endif } @@ -102,10 +112,12 @@ extension ViewController: NSTableViewDelegate, NSTableViewDataSource { if tableView == sectionTableView { sectionSelected = row subTableView.reloadData() + return true } else { - + let name = "\(menus[sectionSelected].rows[row].controller)" + self.performSegue(withIdentifier: name, sender: nil) + return false } - return true } func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { @@ -126,4 +138,10 @@ extension ViewController: NSTableViewDelegate, NSTableViewDataSource { return 36 } } + +extension ViewController: ViewControllerCloseDelegate { + func viewControllerNeedClose(_ liveVC: AGViewController) { + liveVC.view.window?.contentViewController = self + } +} #endif From f597273d74f1115fba24b7073dd81db35cf9b6ca Mon Sep 17 00:00:00 2001 From: sbd021 Date: Tue, 23 Jun 2020 23:43:48 +0800 Subject: [PATCH 031/430] add detail comment for windows,modify readme and fix some bugs --- windows/APIExample/APIExample/APIExample.rc | Bin 23424 -> 23416 bytes .../APIExample/APIExample/APIExample.vcxproj | 6 +- .../APIExample/APIExample.vcxproj.filters | 18 +- .../APIExample/APIExample/APIExampleDlg.cpp | 4 + windows/APIExample/APIExample/APIExampleDlg.h | 4 +- .../APIExample/AgoraRtmpStreaming.cpp | 58 ++- .../APIExample/CAgoraMetaDataDlg.cpp | 62 ++- .../APIExample/APIExample/CAgoraMetaDataDlg.h | 1 + .../APIExample/CAgoraRtmpInjectionDlg.cpp | 389 ++++++++++++++++++ .../APIExample/CAgoraRtmpInjectionDlg.h | 102 +++++ .../APIExample/CAgoraRtmpStreaming.h | 80 ++++ .../APIExample/CLiveBroadcastingDlg.cpp | 88 ++-- .../APIExample/CLiveBroadcastingDlg.h | 23 ++ windows/APIExample/APIExample/resource.h | 3 +- windows/APIExample/APIExample/stdafx.h | 2 +- windows/APIExample/APIExample/zh-cn.ini | 2 +- windows/APIExample/README.md | 2 +- windows/APIExample/README.zh.md | 2 +- 18 files changed, 766 insertions(+), 80 deletions(-) create mode 100644 windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.cpp create mode 100644 windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.h create mode 100644 windows/APIExample/APIExample/CAgoraRtmpStreaming.h diff --git a/windows/APIExample/APIExample/APIExample.rc b/windows/APIExample/APIExample/APIExample.rc index 2f2e510f39cb3605baf30683098cf7690d631d46..829f0c28754607ae41bfb11ee4434a3612c26e1e 100644 GIT binary patch delta 38 rcmZqJ&iG>+v#*` delta 19 bcmeydjj>@n - - + + @@ -226,7 +226,7 @@ if exist en.ini (copy en.ini $(SolutionDir)$(Platform)\$(Configuration)) - + diff --git a/windows/APIExample/APIExample/APIExample.vcxproj.filters b/windows/APIExample/APIExample/APIExample.vcxproj.filters index 464a8e181..d9453eb0e 100644 --- a/windows/APIExample/APIExample/APIExample.vcxproj.filters +++ b/windows/APIExample/APIExample/APIExample.vcxproj.filters @@ -57,21 +57,21 @@ Header Files - - Advanced\RTMPInject - Header Files Header Files - - Advanced\RTMPStream - Advanced\VideoMetadata + + Advanced\RTMPInject + + + Advanced\RTMPStream + @@ -92,9 +92,6 @@ Source Files - - Advanced\RTMPInject - Source Files @@ -104,6 +101,9 @@ Advanced\VideoMetadata + + Advanced\RTMPInject + diff --git a/windows/APIExample/APIExample/APIExampleDlg.cpp b/windows/APIExample/APIExample/APIExampleDlg.cpp index e4e1261fd..804a293b5 100644 --- a/windows/APIExample/APIExample/APIExampleDlg.cpp +++ b/windows/APIExample/APIExample/APIExampleDlg.cpp @@ -385,6 +385,10 @@ void CAPIExampleDlg::ReleaseScene(CTreeCtrl& treeScene, HTREEITEM& hSelectItem) m_pRtmpStreamingDlg->UnInitAgora(); m_pRtmpStreamingDlg->ShowWindow(SW_HIDE); } + else if (str.Compare(advancedVideoMetadata) == 0) { + m_pVideoSEIDlg->UnInitAgora(); + m_pVideoSEIDlg->ShowWindow(SW_HIDE); + } } LRESULT CAPIExampleDlg::OnEIDJoinLeaveChannel(WPARAM wParam, LPARAM lParam) diff --git a/windows/APIExample/APIExample/APIExampleDlg.h b/windows/APIExample/APIExample/APIExampleDlg.h index 4d167b00f..c25afe866 100644 --- a/windows/APIExample/APIExample/APIExampleDlg.h +++ b/windows/APIExample/APIExample/APIExampleDlg.h @@ -4,8 +4,8 @@ #pragma once #include "CLiveBroadcastingDlg.h" -#include "AgoraRtmpInjectionDlg.h" -#include "AgoraRtmpStreaming.h" +#include "CAgoraRtmpInjectionDlg.h" +#include "CAgoraRtmpStreaming.h" #include "CAgoraMetaDataDlg.h" #include #include diff --git a/windows/APIExample/APIExample/AgoraRtmpStreaming.cpp b/windows/APIExample/APIExample/AgoraRtmpStreaming.cpp index d64e89710..0e24470ee 100644 --- a/windows/APIExample/APIExample/AgoraRtmpStreaming.cpp +++ b/windows/APIExample/APIExample/AgoraRtmpStreaming.cpp @@ -3,25 +3,20 @@ #include "stdafx.h" #include "APIExample.h" -#include "AgoraRtmpStreaming.h" +#include "CAgoraRtmpStreaming.h" #include "afxdialogex.h" void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + // send EID_JOINCHANNEL_SUCCESS to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); } } -void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onStreamInjectedStatus(const char* url, uid_t uid, int status) -{ - if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_INJECT_STATUS), (WPARAM)uid, (LPARAM)status); - } -} - void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) { + // send EID_LEAVE_CHANNEL to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); } @@ -29,6 +24,7 @@ void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onLeaveChannel(const RtcStats& void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) { + // send EID_USER_JOINED to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); } @@ -36,11 +32,11 @@ void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onUserJoined(uid_t uid, int el void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + // send EID_USER_OFFLINE to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); } } - void CAgoraRtmpStreamingDlgRtcEngineEventHandler::onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { if (m_hMsgHanlder) { @@ -142,24 +138,29 @@ bool CAgoraRtmpStreamingDlg::InitAgora() } +//uninit agora after receive onLeaveChannel event void CAgoraRtmpStreamingDlg::UnInitAgora() { if (m_rtcEngine) { + //stop preview m_rtcEngine->stopPreview(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + // disable video m_rtcEngine->disableVideo(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + // release rtcengine m_rtcEngine->release(true); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); m_rtcEngine = NULL; } } - BOOL CAgoraRtmpStreamingDlg::OnInitDialog() { CDialogEx::OnInitDialog(); + //init ctrls InitCtrlText(); + //create local render video wnd m_localVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 100); RECT rcArea; @@ -171,6 +172,7 @@ BOOL CAgoraRtmpStreamingDlg::OnInitDialog() // EXCEPTION: OCX Property Pages should return FALSE } +//init ctrl text void CAgoraRtmpStreamingDlg::InitCtrlText() { m_staRemoveUrl.SetWindowText(rtmpStreamingCtrlPublishUrl); @@ -185,7 +187,7 @@ void CAgoraRtmpStreamingDlg::InitCtrlText() void CAgoraRtmpStreamingDlg::OnShowWindow(BOOL bShow, UINT nStatus) { CDialogEx::OnShowWindow(bShow, nStatus); - + //start local video render when this scene dialog show if (bShow) { RenderLocalVideo(); } @@ -195,16 +197,19 @@ void CAgoraRtmpStreamingDlg::OnShowWindow(BOOL bShow, UINT nStatus) void CAgoraRtmpStreamingDlg::RenderLocalVideo() { if (m_rtcEngine) { + //start preview m_rtcEngine->startPreview(); VideoCanvas canvas; canvas.renderMode = RENDER_MODE_FIT; canvas.uid = 0; canvas.view = m_localVideoWnd.GetSafeHwnd(); + // Setup local video to render your local camera preview m_rtcEngine->setupLocalVideo(canvas); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("render local video")); } } +//remove all publish urls void CAgoraRtmpStreamingDlg::RemoveAllRtmpUrls() { m_bRemoveAll = true; @@ -232,6 +237,7 @@ void CAgoraRtmpStreamingDlg::OnBnClickedButtonJoinchannel() } std::string szChannelId = cs2utf8(strChannelName); + //join channel, if uid=0 agora server will calculate an uid and return it if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { m_btnJoinChannel.EnableWindow(FALSE); } @@ -241,15 +247,17 @@ void CAgoraRtmpStreamingDlg::OnBnClickedButtonJoinchannel() m_btnAddStream.EnableWindow(FALSE); m_btnRemoveStream.EnableWindow(FALSE); m_btnJoinChannel.EnableWindow(FALSE); + //remove all publish urls before leave channel RemoveAllRtmpUrls(); } - else if (0 == m_rtcEngine->leaveChannel()) { + else if (0 == m_rtcEngine->leaveChannel()) {//leave channel m_btnJoinChannel.EnableWindow(FALSE); } } } - +//add publish stream url. Add one publish url once. +//you can add many times, less than 10. void CAgoraRtmpStreamingDlg::OnBnClickedButtonAddstream() { if (!m_rtcEngine || !m_initialize) @@ -276,7 +284,7 @@ void CAgoraRtmpStreamingDlg::OnBnClickedButtonAddstream() } } - +//remove publish stream url void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveStream() { if (!m_rtcEngine || !m_initialize) @@ -291,7 +299,7 @@ void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveStream() m_rtcEngine->removePublishStreamUrl(szUrl.c_str()); } - +//remove all publish stream urls void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveAllstream() { if (m_cmbRtmpUrl.GetCount() == 0 && m_cmbRtmpUrl.GetCurSel() >= 0) { @@ -310,6 +318,7 @@ void CAgoraRtmpStreamingDlg::OnBnClickedButtonRemoveAllstream() LRESULT CAgoraRtmpStreamingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) { + //must add publish stream after join channel success,enable add button m_btnJoinChannel.EnableWindow(TRUE); m_btnAddStream.EnableWindow(TRUE); m_btnRemoveStream.EnableWindow(TRUE); @@ -320,6 +329,7 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lP m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); m_btnAddStream.EnableWindow(TRUE); + //notify parent window not change scene after join channel success ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); return 0; } @@ -334,6 +344,7 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); m_btnRemoveStream.EnableWindow(FALSE); m_btnAddStream.EnableWindow(TRUE); + //notify parent window leave channel success ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); return 0; } @@ -345,6 +356,7 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar m_btnRemoveStream.EnableWindow(TRUE); switch (rtmpState->state) { + //Idle remove stream url success case RTMP_STREAM_PUBLISH_STATE_IDLE: { strInfo.Format(_T("%s:%S"), agoraRtmpStateIdle, rtmpState->url); @@ -376,11 +388,13 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar } break; + //The SDK is connecting to Agora's streaming server and the RTMP server. case RTMP_STREAM_PUBLISH_STATE_CONNECTING: { strInfo = agoraRtmpStateConnecting; } break; + //The RTMP streaming publishes. case RTMP_STREAM_PUBLISH_STATE_RUNNING: strInfo = agoraRtmpStateRunning; if (rtmpState->error == RTMP_STREAM_PUBLISH_ERROR_OK) { @@ -396,58 +410,70 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar } break; + //The RTMP streaming is recovering case RTMP_STREAM_PUBLISH_STATE_RECOVERING: strInfo.Format(agoraRtmpStateRecovering); break; + // RTMP Streaming failed case RTMP_STREAM_PUBLISH_STATE_FAILURE: { switch (rtmpState->state) { + //Invalid argument used. case RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT: { strInfo = agoraRtmpStateInvalidArg; } break; + //Invalid argument used. case RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED: { strInfo = agoraRtmpStateEncrypted; } break; + //Timeout for the RTMP streaming. case RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT: { strInfo = agoraRtmpStateConnTimeout; } break; + //Timeout for the RTMP streaming. case RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR: { strInfo = agoraRtmpStateInrealErr; } break; + //Timeout for the RTMP streaming. case RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR: { strInfo = agoraRtmpStateServerErr; } break; + //The RTMP streaming publishes too frequently. case RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN: { strInfo = agoraRtmpStateTooOften; } break; + //The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. case RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT: { strInfo = agoraRtmpStateReachLimit; } break; + //The host manipulates other hosts' URLs. Check your app logic. case RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED: { strInfo = agoraRtmpStateNotAuth; } break; + //Agora's server fails to find the RTMP streaming. case RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND: { strInfo = agoraRtmpStateNotFound; } break; + //The format of the RTMP streaming URL is not supported. case RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED: { strInfo = agoraRtmpStateNotSupported; @@ -470,7 +496,7 @@ LRESULT CAgoraRtmpStreamingDlg::OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lPar rtmpState = NULL; return 0; } - +//show list info details void CAgoraRtmpStreamingDlg::OnSelchangeListInfoBroadcasting() { int sel = m_lstInfo.GetCurSel(); diff --git a/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp b/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp index afb31206e..2b57b9bd1 100644 --- a/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp +++ b/windows/APIExample/APIExample/CAgoraMetaDataDlg.cpp @@ -19,7 +19,7 @@ int CAgoraMetaDataObserver::getMaxMetadataSize() { return m_maxSize; } - +// send metadata callback bool CAgoraMetaDataObserver::onReadyToSendMetadata(Metadata &metadata) { if (m_sendSEI.length() > 0) { @@ -29,7 +29,7 @@ bool CAgoraMetaDataObserver::onReadyToSendMetadata(Metadata &metadata) metadata.size = m_sendSEI.length(); return true; } - +// receive metadata callback void CAgoraMetaDataObserver::onMetadataReceived(const Metadata &metadata) { if (m_hMsgHanlder) { @@ -54,12 +54,14 @@ void CAgoraMetaDataObserver::SetSendSEI(std::string utf8Msg) //event void CAgoraMetaDataEventHanlder::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + // send EID_JOINCHANNEL_SUCCESS to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); } } void CAgoraMetaDataEventHanlder::onUserJoined(uid_t uid, int elapsed) { + // send EID_USER_JOINED to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); } @@ -67,6 +69,7 @@ void CAgoraMetaDataEventHanlder::onUserJoined(uid_t uid, int elapsed) { void CAgoraMetaDataEventHanlder::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + // send EID_USER_OFFLINE to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); } @@ -74,6 +77,7 @@ void CAgoraMetaDataEventHanlder::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TY void CAgoraMetaDataEventHanlder::onLeaveChannel(const RtcStats& stats) { + // send EID_LEAVE_CHANNEL to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); } @@ -81,6 +85,7 @@ void CAgoraMetaDataEventHanlder::onLeaveChannel(const RtcStats& stats) void CAgoraMetaDataEventHanlder::onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) { + //send EID_REMOTE_VIDEO_STATE_CHANED to UI if (m_hMsgHanlder) { PVideoStateStateChanged stateChanged = new VideoStateStateChanged; stateChanged->uid = uid; @@ -113,7 +118,7 @@ void CAgoraMetaDataDlg::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_EDIT_SEI, m_edtSendSEI); DDX_Control(pDX, IDC_EDIT_RECV, m_edtRecvSEI); DDX_Control(pDX, IDC_STATIC_METADATA_INFO, m_staMetaData); - DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo); + DDX_Control(pDX, IDC_LIST_INFO_METADATA, m_lstInfo); DDX_Control(pDX, IDC_STATIC_VIDEO, m_staVideoArea); DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); DDX_Control(pDX, IDC_BUTTON_SEND, m_btnSendSEI); @@ -131,6 +136,7 @@ BEGIN_MESSAGE_MAP(CAgoraMetaDataDlg, CDialogEx) ON_WM_SHOWWINDOW() ON_BN_CLICKED(IDC_BUTTON_SEND, &CAgoraMetaDataDlg::OnBnClickedButtonSend) ON_BN_CLICKED(IDC_BUTTON_CLEAR, &CAgoraMetaDataDlg::OnBnClickedButtonClear) + ON_LBN_SELCHANGE(IDC_LIST_INFO_METADATA, &CAgoraMetaDataDlg::OnSelchangeListInfoMetadata) END_MESSAGE_MAP() @@ -170,10 +176,13 @@ void CAgoraMetaDataDlg::OnBnClickedButtonJoinchannel() BOOL CAgoraMetaDataDlg::OnInitDialog() { CDialogEx::OnInitDialog(); + //init ctrl InitCtrlText(); + //create local video wnd and remote video wnd m_localVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 100); m_remoteVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 100); + //move and show vido wnds RECT rcArea; m_staVideoArea.GetClientRect(&rcArea); @@ -201,17 +210,20 @@ void CAgoraMetaDataDlg::InitCtrlText() bool CAgoraMetaDataDlg::InitAgora() { + //create agora rtc engine instance + //agora rtc engine is Singleton in one process m_rtcEngine = createAgoraRtcEngine(); if (!m_rtcEngine) { m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("createAgoraRtcEngine failed")); return false; } + //set msg receiver for agora event m_eventHandler.SetMsgReceiver(m_hWnd); RtcEngineContext context; - context.appId = APP_ID; + context.appId = APP_ID;//assign appid context.eventHandler = &m_eventHandler; - m_rtcEngine->initialize(context); + //initialize engine int ret = m_rtcEngine->initialize(context); if (ret != 0) { m_initialize = false; @@ -223,29 +235,35 @@ bool CAgoraMetaDataDlg::InitAgora() else m_initialize = true; m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); + //enable video m_rtcEngine->enableVideo(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); - + //set channel profile to live broadcasting m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); + //registe mediaMetadataObserver m_metaDataObserver.SetMsgReceiver(m_hWnd); m_rtcEngine->registerMediaMetadataObserver(&m_metaDataObserver, IMetadataObserver::VIDEO_METADATA); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("registerMediaMetadataObserver")); m_btnJoinChannel.EnableWindow(TRUE); return true; } - +//uninit agora after receive onLeaveChannel event void CAgoraMetaDataDlg::UnInitAgora() { if (m_rtcEngine) { + //stop preview m_rtcEngine->stopPreview(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + // disable video m_rtcEngine->disableVideo(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + // release rtcengine m_rtcEngine->release(true); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); m_rtcEngine = NULL; @@ -266,7 +284,7 @@ LRESULT CAgoraMetaDataDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) m_localVideoWnd.SetUID(wParam); - //notify parent window + //notify parent window not change scene after join channel success ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); return 0; } @@ -281,7 +299,7 @@ LRESULT CAgoraMetaDataDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) strInfo.Format(_T("leave channel success %s"), getCurrentTime()); m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); - //notify parent window + //notify parent window leave channel success ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); return 0; } @@ -291,17 +309,19 @@ LRESULT CAgoraMetaDataDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) CString strInfo; strInfo.Format(_T("%u joined"), wParam); m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); - - /* VideoCanvas canvas; + //setupRemoteViedeo:Initializes the video view of a remote user. + //VideoCanvas:set canvas for render video by assigning uid and hwnd. + VideoCanvas canvas; canvas.uid = wParam; canvas.view = m_remoteVideoWnd.GetSafeHwnd(); canvas.renderMode = RENDER_MODE_FIT; - m_rtcEngine->setupRemoteVideo(canvas);*/ + m_rtcEngine->setupRemoteVideo(canvas); return 0; } LRESULT CAgoraMetaDataDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) { + //clear remote video render fater remote user offline uid_t remoteUid = (uid_t)wParam; VideoCanvas canvas; canvas.uid = remoteUid; @@ -348,6 +368,7 @@ LRESULT CAgoraMetaDataDlg::OnEIDRemoteVideoStateChanged(WPARAM wParam, LPARAM lP LRESULT CAgoraMetaDataDlg::OnEIDMetadataReceived(WPARAM wParam, LPARAM lParam) { + //show video metadata send by remote users IMetadataObserver::Metadata* metaData = (IMetadataObserver::Metadata*)wParam; CString strInfo; strInfo.Format(_T("onMetadataReceived:uid:%u, ts=%d, size:%d."), metaData->uid, metaData->timeStampMs, metaData->size, metaData->buffer); @@ -364,11 +385,13 @@ LRESULT CAgoraMetaDataDlg::OnEIDMetadataReceived(WPARAM wParam, LPARAM lParam) void CAgoraMetaDataDlg::RenderLocalVideo() { if (m_rtcEngine) { + //start preview m_rtcEngine->startPreview(); VideoCanvas canvas; canvas.renderMode = RENDER_MODE_FIT; canvas.uid = 0; canvas.view = m_localVideoWnd.GetSafeHwnd(); + // Setup local video to render your local camera preview m_rtcEngine->setupLocalVideo(canvas); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("render local video")); } @@ -377,13 +400,13 @@ void CAgoraMetaDataDlg::RenderLocalVideo() void CAgoraMetaDataDlg::OnShowWindow(BOOL bShow, UINT nStatus) { CDialogEx::OnShowWindow(bShow, nStatus); - + //start local video render when this scene dialog show if (bShow) { RenderLocalVideo(); } } - +//set send sei info void CAgoraMetaDataDlg::OnBnClickedButtonSend() { CString strSend; @@ -394,9 +417,18 @@ void CAgoraMetaDataDlg::OnBnClickedButtonSend() m_metaDataObserver.SetSendSEI(utf8msg); } - +//clear send sei info void CAgoraMetaDataDlg::OnBnClickedButtonClear() { m_edtSendSEI.SetWindowText(_T("")); m_metaDataObserver.SetSendSEI(""); } + +//show list info details +void CAgoraMetaDataDlg::OnSelchangeListInfoMetadata() +{ + int sel = m_lstInfo.GetCurSel(); + CString strDetail; + m_lstInfo.GetText(sel, strDetail); + m_staMetaData.SetWindowText(strDetail); +} diff --git a/windows/APIExample/APIExample/CAgoraMetaDataDlg.h b/windows/APIExample/APIExample/CAgoraMetaDataDlg.h index 2f0030dea..8d37f3847 100644 --- a/windows/APIExample/APIExample/CAgoraMetaDataDlg.h +++ b/windows/APIExample/APIExample/CAgoraMetaDataDlg.h @@ -90,4 +90,5 @@ class CAgoraMetaDataDlg : public CDialogEx CButton m_btnSendSEI; afx_msg void OnBnClickedButtonSend(); afx_msg void OnBnClickedButtonClear(); + afx_msg void OnSelchangeListInfoMetadata(); }; diff --git a/windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.cpp b/windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.cpp new file mode 100644 index 000000000..198055fcb --- /dev/null +++ b/windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.cpp @@ -0,0 +1,389 @@ +// AgoraRtmpInjectionDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "APIExample.h" +#include "CAgoraRtmpInjectionDlg.h" +#include "afxdialogex.h" +void CAgoraRtmpInjectionRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) +{ + // send EID_JOINCHANNEL_SUCCESS to UI + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); + } +} + +void CAgoraRtmpInjectionRtcEngineEventHandler::onStreamInjectedStatus(const char* url, uid_t uid, int status) +{ + // send EID_INJECT_STATUS to UI + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_INJECT_STATUS), (WPARAM)uid, (LPARAM)status); + } +} + +void CAgoraRtmpInjectionRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) +{ + // send EID_LEAVE_CHANNEL to UI + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); + } +} + +void CAgoraRtmpInjectionRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) +{ + // send EID_USER_JOINED to UI + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); + } +} + +void CAgoraRtmpInjectionRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) +{ + // send EID_USER_OFFLINE to UI + if (m_hMsgHanlder) { + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); + } +} + +// CAgoraRtmpInjectionDlg dialog + +IMPLEMENT_DYNAMIC(CAgoraRtmpInjectionDlg, CDialogEx) + +CAgoraRtmpInjectionDlg::CAgoraRtmpInjectionDlg(CWnd* pParent /*=nullptr*/) + : CDialogEx(IDD_DIALOG_RTMPINJECT, pParent) +{ + +} + +CAgoraRtmpInjectionDlg::~CAgoraRtmpInjectionDlg() +{ +} + +void CAgoraRtmpInjectionDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo); + DDX_Control(pDX, IDC_BUTTON_JOINCHANNEL, m_btnJoinChannel); + DDX_Control(pDX, IDC_BUTTON_ADDSTREAM, m_btnAddStream); + DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannelName); + DDX_Control(pDX, IDC_EDIT_INJECT_URL, m_edtInjectUrl); + DDX_Control(pDX, IDC_STATIC_VIDEO, m_staVideoArea); + DDX_Control(pDX, IDC_STATIC_CHANNELNAME, m_staChannelName); + DDX_Control(pDX, IDC_STATIC_INJECT_URL, m_staInjectUrl); + DDX_Control(pDX, IDC_STATIC_DETAIL, m_staDetail); +} + + +BEGIN_MESSAGE_MAP(CAgoraRtmpInjectionDlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_ADDSTREAM, &CAgoraRtmpInjectionDlg::OnBnClickedButtonAddstream) + ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CAgoraRtmpInjectionDlg::OnBnClickedButtonJoinchannel) + ON_WM_SHOWWINDOW() + ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraRtmpInjectionDlg::OnEIDJoinChannelSuccess) + ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraRtmpInjectionDlg::OnEIDLeaveChannel) + ON_MESSAGE(WM_MSGID(EID_INJECT_STATUS), &CAgoraRtmpInjectionDlg::OnEIDStreamInjectedStatus) + ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraRtmpInjectionDlg::OnEIDUserJoined) + ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraRtmpInjectionDlg::OnEIDUserOffline) + + ON_LBN_SELCHANGE(IDC_LIST_INFO_BROADCASTING, &CAgoraRtmpInjectionDlg::OnSelchangeListInfoBroadcasting) +END_MESSAGE_MAP() + + +// CAgoraRtmpInjectionDlg message handlers +BOOL CAgoraRtmpInjectionDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + //init ctrl + InitCtrlText(); + //create local video wnd + m_localVideoWnd.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 1, 1), this, ID_BASEWND_VIDEO + 200); + + //move local video wnd + RECT rcArea; + m_staVideoArea.GetClientRect(&rcArea); + m_localVideoWnd.MoveWindow(&rcArea); + m_localVideoWnd.ShowWindow(SW_SHOW); + + m_btnAddStream.EnableWindow(FALSE); + m_edtInjectUrl.EnableWindow(FALSE); + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CAgoraRtmpInjectionDlg::InitCtrlText() +{ + m_staInjectUrl.SetWindowText(rtmpInjectCtrlUrl); + m_btnAddStream.SetWindowText(rtmpInjectCtrlInject); + m_staChannelName.SetWindowText(commonCtrlChannel); + m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel); +} + +bool CAgoraRtmpInjectionDlg::InitAgora() +{ + //create agora rtc engine instance + //agora rtc engine is Singleton in one process + m_rtcEngine = createAgoraRtcEngine(); + if (!m_rtcEngine) { + m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("createAgoraRtcEngine failed")); + return false; + } + //set msg receiver for agora event + m_eventHandler.SetMsgReceiver(m_hWnd); + + RtcEngineContext context; + context.appId = APP_ID;//assign appid + context.eventHandler = &m_eventHandler; + //initialize engine + int ret = m_rtcEngine->initialize(context); + if (ret != 0) { + m_initialize = false; + CString strInfo; + strInfo.Format(_T("initialize failed: %d"), ret); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + return false; + } + else + m_initialize = true; + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); + //enable video + m_rtcEngine->enableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); + //set channel profile to live broadcasting + m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); + //set client role to broadcaster + m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); + + m_btnJoinChannel.EnableWindow(TRUE); + return true; +} + +//uninit agora after receive onLeaveChannel event +void CAgoraRtmpInjectionDlg::UnInitAgora() +{ + if (m_rtcEngine) { + //stop preview + m_rtcEngine->stopPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + // disable video + m_rtcEngine->disableVideo(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + // release rtcengine + m_rtcEngine->release(true); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); + m_rtcEngine = NULL; + } +} +void CAgoraRtmpInjectionDlg::RenderLocalVideo() +{ + if (m_rtcEngine) { + //start preview + m_rtcEngine->startPreview(); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("startPreview")); + VideoCanvas canvas; + canvas.renderMode = RENDER_MODE_FIT; + canvas.uid = 0; + canvas.view = m_localVideoWnd.GetSafeHwnd(); + // Setup local video to render your local camera preview + m_rtcEngine->setupLocalVideo(canvas); + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setupLocalVideo")); + + } +} + + +void CAgoraRtmpInjectionDlg::OnShowWindow(BOOL bShow, UINT nStatus) +{ + CDialogEx::OnShowWindow(bShow, nStatus); + //start local video render when this scene dialog show + if (bShow) { + RenderLocalVideo(); + } +} + +void CAgoraRtmpInjectionDlg::OnBnClickedButtonAddstream() +{ + if (!m_rtcEngine || !m_initialize) + return; + + if (m_addInjectStream) {//remove stream + m_addInjectStream = false; + m_edtInjectUrl.EnableWindow(TRUE); + m_btnAddStream.SetWindowText(_T("Inject URL")); + //remove inject stream + int ret = m_rtcEngine->removeInjectStreamUrl(m_injectUrl.c_str()); + } + else {//inject stream + CString strURL; + m_edtInjectUrl.GetWindowText(strURL); + if (strURL.IsEmpty()) { + AfxMessageBox(_T("Fill INJECT URL first")); + return; + } + + std::string szURL = cs2utf8(strURL); + InjectStreamConfig config; + //inject stream + m_rtcEngine->addInjectStreamUrl(szURL.c_str(), config); + m_injectUrl = szURL; + m_addInjectStream = true; + //disable add button after inject stream + m_edtInjectUrl.EnableWindow(FALSE); + m_btnAddStream.SetWindowText(_T("Remove URL")); + } + m_btnAddStream.EnableWindow(FALSE); + m_edtInjectUrl.EnableWindow(FALSE); +} + + +void CAgoraRtmpInjectionDlg::OnBnClickedButtonJoinchannel() +{ + if (!m_rtcEngine || !m_initialize) + return; + + if (!joinChannel) { + CString strChannelName; + m_edtChannelName.GetWindowText(strChannelName); + if (strChannelName.IsEmpty()) { + AfxMessageBox(_T("Fill channel name first")); + return; + } + + std::string szChannelId = cs2utf8(strChannelName); + //join channel, if uid=0 agora server will calculate an uid and return it + if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { + m_btnJoinChannel.EnableWindow(FALSE); + } + } + else { + //leave channel + if (0 == m_rtcEngine->leaveChannel()) { + m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("leave channel")); + m_btnJoinChannel.EnableWindow(FALSE); + } + } +} + +LRESULT CAgoraRtmpInjectionDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) +{ + m_btnJoinChannel.EnableWindow(TRUE); + joinChannel = true; + m_btnJoinChannel.SetWindowText(_T("LeaveChannel")); + //must inject stream after join channel success,enable add button + m_btnAddStream.EnableWindow(TRUE); + m_edtInjectUrl.EnableWindow(TRUE); + CString strInfo; + strInfo.Format(_T("%s:join success, uid=%u"), getCurrentTime(), wParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + //notify parent window not change scene after join channel success + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); + return 0; +} + +LRESULT CAgoraRtmpInjectionDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) +{ + m_btnJoinChannel.EnableWindow(TRUE); + joinChannel = false; + m_btnJoinChannel.SetWindowText(_T("JoinChannel")); + CString strInfo; + strInfo.Format(_T("leave channel success")); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + //notify parent window leave channel success + ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); + return 0; +} + +LRESULT CAgoraRtmpInjectionDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) +{ + uid_t remoteUid = (uid_t)wParam; + if (remoteUid == 666) {//inject stream join channel with uid 666 + CString strInfo; + strInfo.Format(_T("%u joined, 666 is inject stream"), remoteUid); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + //mute audio and video steam. + //If you want receive audio and video steam, skip these tow api. + m_rtcEngine->muteRemoteAudioStream(666, true); + m_rtcEngine->muteRemoteVideoStream(666, true); + } + + return 0; +} + +LRESULT CAgoraRtmpInjectionDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) +{ + uid_t remoteUid = (uid_t)wParam; + if (remoteUid == 666) {//inject stream is removed + CString strInfo; + strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + } + return 0; +} + +LRESULT CAgoraRtmpInjectionDlg::OnEIDStreamInjectedStatus(WPARAM wParam, LPARAM lParam) +{ + CString strInfo; + switch ((INJECT_STREAM_STATUS)lParam) + { + //The external video stream imported successfully + case INJECT_STREAM_STATUS_START_SUCCESS: + strInfo.Format(_T("%s, err: %d"), agoraInjectStartSucc, 0); + break; + //The external video stream already exists + case INJECT_STREAM_STATUS_START_ALREADY_EXISTS: + strInfo.Format(_T("%s, err: %d"), agoraInjectExist, 1); + break; + //The external video stream to be imported is unauthorized + case INJECT_STREAM_STATUS_START_UNAUTHORIZED: + strInfo.Format(_T("%s, err: %d"), agoraInjectStartUnAuth, 2); + break; + //Import external video stream timeout. + case INJECT_STREAM_STATUS_START_TIMEDOUT: + strInfo.Format(_T("%s, err: %d"), agoraInjectStartTimeout, 3); + break; + //Import external video stream failed + case INJECT_STREAM_STATUS_START_FAILED: + strInfo.Format(_T("%s, err: %d"), agoraInjectStartFailed, 4); + break; + //The external video stream stopped importing successfully + case INJECT_STREAM_STATUS_STOP_SUCCESS: + strInfo.Format(_T("%s, err: %d"), agoraInjectStopSuccess, 5); + break; + //No external video stream is found + case INJECT_STREAM_STATUS_STOP_NOT_FOUND: + strInfo.Format(_T("%s, err: %d"), agoraInjectNotFound, 6); + break; + //The external video stream to be stopped importing is unauthorized + case INJECT_STREAM_STATUS_STOP_UNAUTHORIZED: + strInfo.Format(_T("%s, err: %d"), agoraInjectStopUnAuth, 7); + break; + //Stop importing external video stream timeout + case INJECT_STREAM_STATUS_STOP_TIMEDOUT: + strInfo.Format(_T("%s, err: %d"), agoraInjectStopTimeout, 8); + break; + //Stop importing external video stream failed + case INJECT_STREAM_STATUS_STOP_FAILED: + strInfo.Format(_T("%s, err: %d"), agoraInjectStopFailed, 9); + break; + //The external video stream is corrupted + case INJECT_STREAM_STATUS_BROKEN: + strInfo.Format(_T("%s, err: %d"), agoraInjectBroken, 10); + break; + default: + break; + } + + m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); + m_btnAddStream.EnableWindow(TRUE); + m_edtInjectUrl.EnableWindow(TRUE); + return 0; +} + +//show list info details +void CAgoraRtmpInjectionDlg::OnSelchangeListInfoBroadcasting() +{ + int sel = m_lstInfo.GetCurSel(); + CString strDetail; + m_lstInfo.GetText(sel, strDetail); + m_staDetail.SetWindowText(strDetail); +} diff --git a/windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.h b/windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.h new file mode 100644 index 000000000..8da6041a4 --- /dev/null +++ b/windows/APIExample/APIExample/CAgoraRtmpInjectionDlg.h @@ -0,0 +1,102 @@ +#pragma once +#include +#include "AGVideoWnd.h" +class CAgoraRtmpInjectionRtcEngineEventHandler + : public IRtcEngineEventHandler +{ +public: + CAgoraRtmpInjectionRtcEngineEventHandler() {} + ~CAgoraRtmpInjectionRtcEngineEventHandler() {} + void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; + /** Occurs when a voice or video stream URL address is added to a live broadcast. + + @param url Pointer to the URL address of the externally injected stream. + @param uid User ID. + @param status State of the externally injected stream: #INJECT_STREAM_STATUS.*/ + virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) override; + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics.*/ + virtual void onLeaveChannel(const RtcStats& stats) override; + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered.*/ + virtual void onUserJoined(uid_t uid, int elapsed) override; + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience.*/ + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override; + +private: + HWND m_hMsgHanlder; +}; + +// CAgoraRtmpInjectionDlg dialog + +class CAgoraRtmpInjectionDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CAgoraRtmpInjectionDlg) + +public: + CAgoraRtmpInjectionDlg(CWnd* pParent = nullptr); // standard constructor + virtual ~CAgoraRtmpInjectionDlg(); + bool InitAgora(); + void UnInitAgora(); + +// Dialog Data + enum { IDD = IDD_DIALOG_RTMPINJECT }; +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedButtonAddstream(); + afx_msg void OnBnClickedButtonJoinchannel(); + afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDStreamInjectedStatus(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); + virtual BOOL OnInitDialog(); + +private: + void InitCtrlText(); + void RenderLocalVideo(); + CAGVideoWnd m_localVideoWnd; + + IRtcEngine* m_rtcEngine = nullptr; + CAgoraRtmpInjectionRtcEngineEventHandler m_eventHandler; + bool joinChannel = false; + bool m_initialize = false; + std::string m_injectUrl; + bool m_addInjectStream = false; +public: + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + CListBox m_lstInfo; + CButton m_btnJoinChannel; + CButton m_btnAddStream; + CEdit m_edtChannelName; + CEdit m_edtInjectUrl; + CStatic m_staVideoArea; + + + CStatic m_staChannelName; + CStatic m_staInjectUrl; + CStatic m_staDetail; + afx_msg void OnSelchangeListInfoBroadcasting(); +}; diff --git a/windows/APIExample/APIExample/CAgoraRtmpStreaming.h b/windows/APIExample/APIExample/CAgoraRtmpStreaming.h new file mode 100644 index 000000000..2cc958f09 --- /dev/null +++ b/windows/APIExample/APIExample/CAgoraRtmpStreaming.h @@ -0,0 +1,80 @@ +#pragma once +#include "AGVideoWnd.h" +#include +class CAgoraRtmpStreamingDlgRtcEngineEventHandler + : public IRtcEngineEventHandler +{ +public: + CAgoraRtmpStreamingDlgRtcEngineEventHandler() {} + ~CAgoraRtmpStreamingDlgRtcEngineEventHandler() {} + void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; + virtual void onLeaveChannel(const RtcStats& stats) override; + virtual void onUserJoined(uid_t uid, int elapsed) override; + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override; + virtual void onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode)override; + +private: + HWND m_hMsgHanlder; +}; + +// CAgoraRtmpStreamingDlg dialog + +class CAgoraRtmpStreamingDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CAgoraRtmpStreamingDlg) + +public: + CAgoraRtmpStreamingDlg(CWnd* pParent = nullptr); // standard constructor + virtual ~CAgoraRtmpStreamingDlg(); + bool InitAgora(); + void UnInitAgora(); +// Dialog Data + enum { IDD = IDD_DIALOG_RTMP_STREAMING }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() + +private: + void InitCtrlText(); + void RenderLocalVideo(); + void RemoveAllRtmpUrls(); + + IRtcEngine* m_rtcEngine = nullptr; + CAgoraRtmpStreamingDlgRtcEngineEventHandler m_eventHandler; + bool joinChannel = false; + bool m_initialize = false; + CAGVideoWnd m_localVideoWnd; + std::set m_urlSet; + int m_removeUrlCount = 0; + bool m_bRemoveAll = false; + +public: + virtual BOOL OnInitDialog(); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + afx_msg void OnBnClickedButtonJoinchannel(); + afx_msg void OnBnClickedButtonAddstream(); + afx_msg void OnBnClickedButtonRemoveStream(); + afx_msg void OnBnClickedButtonRemoveAllstream(); + + afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEIDRtmpStateChanged(WPARAM wParam, LPARAM lParam); + afx_msg void OnSelchangeListInfoBroadcasting(); + CEdit m_edtChannelName; + CEdit m_edtRtmpUrl; + CButton m_btnAddStream; + CButton m_btnRemoveStream; + CComboBox m_cmbRtmpUrl; + CStatic m_staChannelName; + CStatic m_staPublishUrl; + CButton m_btnRemoveAll; + CStatic m_staRemoveUrl; + // m_staVideoArea + CButton m_btnJoinChannel; + CListBox m_lstInfo; + CStatic m_staVideoArea; + CStatic m_staDetail; +}; diff --git a/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp b/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp index 5fc6a3db6..03278bd21 100644 --- a/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp +++ b/windows/APIExample/APIExample/CLiveBroadcastingDlg.cpp @@ -9,28 +9,33 @@ void CLiveBroadcastingRtcEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + // send EID_JOINCHANNEL_SUCCESS to UI if (m_hMsgHanlder) { ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)uid, (LPARAM)elapsed); } } -void CLiveBroadcastingRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) { +void CLiveBroadcastingRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) +{ + // send EID_LEAVE_CHANNEL to UI if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); } } -void CLiveBroadcastingRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) +void CLiveBroadcastingRtcEngineEventHandler::onUserJoined(uid_t uid, int elapsed) { + // send EID_USER_JOINED to UI if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_JOINED), (WPARAM)uid, (LPARAM)elapsed); } } -void CLiveBroadcastingRtcEngineEventHandler::onLeaveChannel(const RtcStats& stats) +void CLiveBroadcastingRtcEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + // send EID_USER_OFFLINE to UI if (m_hMsgHanlder) { - ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_LEAVE_CHANNEL), 0, 0); + ::PostMessage(m_hMsgHanlder, WM_MSGID(EID_USER_OFFLINE), (WPARAM)uid, (LPARAM)reason); } } // CLiveBroadcastingDlg dialog @@ -80,6 +85,7 @@ END_MESSAGE_MAP() BOOL CLiveBroadcastingDlg::OnInitDialog() { + //init ctrl CDialogEx::OnInitDialog(); InitCtrlText(); CreateAllVideoWnds(); @@ -88,13 +94,14 @@ BOOL CLiveBroadcastingDlg::OnInitDialog() m_cmbRole.InsertString(i++, agoraRoleBroadcaster); m_cmbRole.InsertString(i++, agoraRoleAudience); m_cmbRole.SetCurSel(0); - // + //1vn i = 0; m_cmbPersons.InsertString(i++, _T("1V1")); m_cmbPersons.InsertString(i++, _T("1V3")); m_cmbPersons.InsertString(i++, _T("1V8")); m_cmbPersons.InsertString(i++, _T("1V15")); m_cmbPersons.SetCurSel(0); + //show render wnds ShowVideoWnds(); m_btnJoinChannel.EnableWindow(FALSE); @@ -103,6 +110,7 @@ BOOL CLiveBroadcastingDlg::OnInitDialog() // EXCEPTION: OCX Property Pages should return FALSE } +// init ctrl text void CLiveBroadcastingDlg::InitCtrlText() { m_staRole.SetWindowText(commonCtrlClientRole); @@ -111,6 +119,7 @@ void CLiveBroadcastingDlg::InitCtrlText() m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel); } +// create render video wnds void CLiveBroadcastingDlg::CreateAllVideoWnds() { for (int i = 0; i < VIDEO_COUNT; ++i) { @@ -119,7 +128,7 @@ void CLiveBroadcastingDlg::CreateAllVideoWnds() } } - +//show render video wnds void CLiveBroadcastingDlg::ShowVideoWnds() { m_videoArea.ShowWindow(SW_HIDE); @@ -127,25 +136,25 @@ void CLiveBroadcastingDlg::ShowVideoWnds() int col = 2; m_maxVideoCount = 4; switch (m_cmbPersons.GetCurSel()) { - case PEOPLE_IN_CHANNEL_2: { + case PEOPLE_IN_CHANNEL_2: {//1v2 row = 1; col = 2; m_maxVideoCount = 2; } break; - case PEOPLE_IN_CHANNEL_4: { + case PEOPLE_IN_CHANNEL_4: {//1v3 int row = 2; int col = 2; m_maxVideoCount = 4; } break; - case PEOPLE_IN_CHANNEL_9: { + case PEOPLE_IN_CHANNEL_9: {//1v8 row = 3; col = 3; m_maxVideoCount = 9; } break; - case PEOPLE_IN_CHANNEL_16: { + case PEOPLE_IN_CHANNEL_16: {//1v15 row = 4; col = 4; m_maxVideoCount = 16; @@ -160,7 +169,7 @@ void CLiveBroadcastingDlg::ShowVideoWnds() int w = (rcArea.right -rcArea.left - space * (col - 1)) / col; int h = (rcArea.bottom - rcArea.top - space * (row - 1)) / row; - + // video wnds: row * col layout for (int r = 0; r < row; r++) { for (int c = 0; c < col; c++) { int x = rcArea.left + (w + space) * c; @@ -175,7 +184,8 @@ void CLiveBroadcastingDlg::ShowVideoWnds() } } } - + //setupRemoteViedeo:Initializes the video view of a remote user. + //VideoCanvas:set canvas for render video by assigning uid and hwnd. for (int i = m_maxVideoCount; i < VIDEO_COUNT; i++) { m_videoWnds[i].ShowWindow(0); if (m_videoWnds[i].GetUID() != 0) { @@ -187,19 +197,24 @@ void CLiveBroadcastingDlg::ShowVideoWnds() } } +//init agora bool CLiveBroadcastingDlg::InitAgora() { + //create agora rtc engine instance + //agora rtc engine is Singleton in one process m_rtcEngine = createAgoraRtcEngine(); if (!m_rtcEngine) { m_lstInfo.InsertString(m_lstInfo.GetCount()-1, _T("createAgoraRtcEngine failed")); return false; } + //set msg receiver for agora event m_eventHandler.SetMsgReceiver(m_hWnd); RtcEngineContext context; - context.appId = APP_ID; + context.appId = APP_ID;//assign appid context.eventHandler = &m_eventHandler; - m_rtcEngine->initialize(context); + + //initialize engine int ret = m_rtcEngine->initialize(context); if (ret != 0) { m_initialize = false; @@ -211,11 +226,13 @@ bool CLiveBroadcastingDlg::InitAgora() else m_initialize = true; m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success")); + //enable video m_rtcEngine->enableVideo(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("enable video")); - + //set channel profile to live broadcasting m_rtcEngine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("live broadcasting")); + //set client role to broadcaster m_rtcEngine->setClientRole(CLIENT_ROLE_BROADCASTER); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("setClientRole broadcaster")); @@ -224,13 +241,17 @@ bool CLiveBroadcastingDlg::InitAgora() return true; } +//uninit agora after receive onLeaveChannel event void CLiveBroadcastingDlg::UnInitAgora() { if (m_rtcEngine) { + //stop preview m_rtcEngine->stopPreview(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview")); + // disable video m_rtcEngine->disableVideo(); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo")); + // release rtcengine m_rtcEngine->release(true); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine")); m_rtcEngine = NULL; @@ -240,27 +261,30 @@ void CLiveBroadcastingDlg::UnInitAgora() void CLiveBroadcastingDlg::RenderLocalVideo() { if (m_rtcEngine) { + //start preview m_rtcEngine->startPreview(); VideoCanvas canvas; canvas.renderMode = RENDER_MODE_FIT; canvas.uid = 0; canvas.view = m_videoWnds[0].GetSafeHwnd(); + // Setup local video to render your local camera preview m_rtcEngine->setupLocalVideo(canvas); m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("render local video")); } } - +//change wnds layout void CLiveBroadcastingDlg::OnSelchangeComboPersons() { int index = m_cmbPersons.GetCurSel(); ShowVideoWnds(); } - +//change client role void CLiveBroadcastingDlg::OnSelchangeComboRole() { if (m_rtcEngine) { + //set client role m_rtcEngine->setClientRole(CLIENT_ROLE_TYPE(m_cmbRole.GetCurSel() + 1)); m_lstInfo.InsertString(m_lstInfo.GetCount(), m_cmbRole.GetCurSel() == 0 ? _T("setClientRole broadcaster"): _T("setClientRole Audience")); @@ -281,12 +305,14 @@ void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel() } std::string szChannelId = cs2utf8(strChannelName); + //join channel, if uid=0 agora server will calculate an uid and return it if (0 == m_rtcEngine->joinChannel(APP_TOKEN, szChannelId.c_str(), "", 0)) { strInfo.Format(_T("join channel %s"), getCurrentTime()); m_btnJoinChannel.EnableWindow(FALSE); } } else { + //leave channel if (0 == m_rtcEngine->leaveChannel()) { strInfo.Format(_T("leave channel %s"), getCurrentTime()); m_btnJoinChannel.EnableWindow(FALSE); @@ -296,17 +322,16 @@ void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel() m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); } - - void CLiveBroadcastingDlg::OnShowWindow(BOOL bShow, UINT nStatus) { CDialogEx::OnShowWindow(bShow, nStatus); - + //start local video render when this scene dialog show if (bShow) { RenderLocalVideo(); } } +//joinchannel success LRESULT CLiveBroadcastingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) { m_btnJoinChannel.EnableWindow(TRUE); @@ -320,7 +345,7 @@ LRESULT CLiveBroadcastingDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lPar m_videoWnds[0].SetUID(wParam); m_lstUids.push_back(wParam); - //notify parent window + //notify parent window not change scene after join channel success ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), TRUE, 0); return 0; } @@ -336,10 +361,10 @@ LRESULT CLiveBroadcastingDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam) m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo); m_lstUids.clear(); for (int i = 0; i < m_maxVideoCount; i++) { - m_videoWnds[i].SetUID(0); + m_videoWnds[i].SetUID(0);//set wnd not used } - //notify parent window + //notify parent window leave channel success ::PostMessage(GetParent()->GetSafeHwnd(), WM_MSGID(EID_JOINCHANNEL_SUCCESS), FALSE, 0); return 0; } @@ -354,24 +379,28 @@ LRESULT CLiveBroadcastingDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) m_lstUids.push_back(wParam); for (int i = 0; i < m_maxVideoCount; i++) { - if (m_videoWnds[i].GetUID() == 0) { + if (m_videoWnds[i].GetUID() == 0) {//find a wnd not used VideoCanvas canvas; canvas.uid = wParam; canvas.view = m_videoWnds[i].GetSafeHwnd(); canvas.renderMode = RENDER_MODE_FIT; + m_videoWnds[i].SetUID(wParam); + //setupRemoteViedeo:Initializes the video view of a remote user. + //VideoCanvas:set canvas for render video by assigning uid and hwnd. m_rtcEngine->setupRemoteVideo(canvas); break; } } return 0; } - +//user offline LRESULT CLiveBroadcastingDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) { uid_t remoteUid = (uid_t)wParam; VideoCanvas canvas; canvas.uid = remoteUid; canvas.view = NULL; + //clear remote video render fater remote user offline m_rtcEngine->setupRemoteVideo(canvas); CString strInfo; strInfo.Format(_T("%u offline, reason:%d"), remoteUid, lParam); @@ -379,7 +408,7 @@ LRESULT CLiveBroadcastingDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) for (int i = 0; i < m_maxVideoCount; i++){ if (m_videoWnds[i].GetUID() == remoteUid) { - m_videoWnds[i].SetUID(0); + m_videoWnds[i].SetUID(0);//set wnd not used m_videoWnds[i].Invalidate(); break; } @@ -395,10 +424,9 @@ LRESULT CLiveBroadcastingDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) return 0; } - +//show list info details void CLiveBroadcastingDlg::OnSelchangeListInfoBroadcasting() { - int sel = m_lstInfo.GetCurSel(); CString strDetail; m_lstInfo.GetText(sel, strDetail); diff --git a/windows/APIExample/APIExample/CLiveBroadcastingDlg.h b/windows/APIExample/APIExample/CLiveBroadcastingDlg.h index bfa0b6020..baf6819e7 100644 --- a/windows/APIExample/APIExample/CLiveBroadcastingDlg.h +++ b/windows/APIExample/APIExample/CLiveBroadcastingDlg.h @@ -13,9 +13,32 @@ class CLiveBroadcastingRtcEngineEventHandler CLiveBroadcastingRtcEngineEventHandler() {} ~CLiveBroadcastingRtcEngineEventHandler() {} void SetMsgReceiver(HWND hWnd) { m_hMsgHanlder = hWnd; } + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override; + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered.*/ virtual void onUserJoined(uid_t uid, int elapsed) override; + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience.*/ virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override; + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics.*/ virtual void onLeaveChannel(const RtcStats& stats) override; private: HWND m_hMsgHanlder; diff --git a/windows/APIExample/APIExample/resource.h b/windows/APIExample/APIExample/resource.h index 2bd3b6a17..ad58cfd0d 100644 --- a/windows/APIExample/APIExample/resource.h +++ b/windows/APIExample/APIExample/resource.h @@ -51,6 +51,7 @@ #define IDC_STATIC_DETAIL 1038 #define IDC_STATIC_METADATA_INFO 1039 #define IDC_BUTTON_CLEAR 1040 +#define IDC_LIST_INFO_METADATA 1041 // Next default values for new objects // @@ -58,7 +59,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 132 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1041 +#define _APS_NEXT_CONTROL_VALUE 1042 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/windows/APIExample/APIExample/stdafx.h b/windows/APIExample/APIExample/stdafx.h index d53bb093d..e6b687ece 100644 --- a/windows/APIExample/APIExample/stdafx.h +++ b/windows/APIExample/APIExample/stdafx.h @@ -37,7 +37,7 @@ #pragma warning(disable:4819) -#define APP_ID "aab8b8f5a8cd4469a63042fcfafe7063" +#define APP_ID "" #define APP_TOKEN "" #include diff --git a/windows/APIExample/APIExample/zh-cn.ini b/windows/APIExample/APIExample/zh-cn.ini index cc3b14efa..a67ba62a4 100644 --- a/windows/APIExample/APIExample/zh-cn.ini +++ b/windows/APIExample/APIExample/zh-cn.ini @@ -1,7 +1,7 @@ [General] Common.Group.Doc=ĵϢ Common.Document.Website=ĵ -Common.FAQ.Website=ʴ +Common.FAQ.Website= Common.Register.Website=ע˻ Common.Demo.Website=demoַ Common.Basic.Scene= diff --git a/windows/APIExample/README.md b/windows/APIExample/README.md index 4421a8e99..55099468a 100644 --- a/windows/APIExample/README.md +++ b/windows/APIExample/README.md @@ -15,7 +15,7 @@ First, create a developer account at [Agora.io](https://dashboard.agora.io/signi * #define APP_ID _T("Your App ID") -Next, download the **Agora Video SDK** from [Agora.io SDK](https://www.agora.io/en/download/). Unzip the downloaded SDK package and copy the **sdk** to the project folder(the old one may be over written).Finally, Open APIExample.sln with your Vs 2013(or higher) and build all solution and run. +Next, download the **Agora Video SDK** from [Agora.io SDK](https://www.agora.io/en/download/). Unzip the downloaded SDK package and copy the **libs** to the project folder(where the APIExample.sln is located in).Finally, Open APIExample.sln with your Vs 2013(or higher) and build all solution and run. diff --git a/windows/APIExample/README.zh.md b/windows/APIExample/README.zh.md index 01de269a7..9ee7a5cd0 100644 --- a/windows/APIExample/README.zh.md +++ b/windows/APIExample/README.zh.md @@ -19,7 +19,7 @@ * #define APP_ID _T("Your App ID") -然后在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**,解压后将其中的 **libs** 复制到本项目目录下(并覆盖原有旧目录)。最后使用 Vs2017 打开 APIExample.sln,编译整个解决方案即可运行 +然后在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**,解压后将其中的 **libs** 复制到本项目目录下(APIExample.slin所在的目录)。最后使用 Vs2017 打开 APIExample.sln,编译整个解决方案即可运行 ##基础场景 From a06e4e016b78d91a46f27c52148a4d8447b88140 Mon Sep 17 00:00:00 2001 From: sbd021 Date: Wed, 24 Jun 2020 09:55:28 +0800 Subject: [PATCH 032/430] remove register button --- windows/APIExample/APIExample/APIExample.rc | Bin 23416 -> 23468 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/windows/APIExample/APIExample/APIExample.rc b/windows/APIExample/APIExample/APIExample.rc index 829f0c28754607ae41bfb11ee4434a3612c26e1e..51b7afc492113220f5b86aa736488915e70b6c4c 100644 GIT binary patch delta 187 zcmeydjd9I(#tpk1*o_!;7z`OqCLeT21+$GA%qQzQ+D?AtXaMG$GFSrn(vwY`?l7AJ z+3HUElUJzaAZgZ!hD8OhCGIn$@aR^lY1P6L_vBifVvST7%>=6=G9c*e9Uc= F2mtB6D%Su2 delta 159 zcmZ3po$<#u#tpk1*bNzU7z`OqCm(c31+$GAEG92>l%Bj#T8ZODPEVj(uX)mB2VJSj z8{CAz3d|S`U Date: Wed, 24 Jun 2020 10:17:41 +0800 Subject: [PATCH 033/430] modify readme --- windows/APIExample/README.md | 13 ++++++------- windows/APIExample/README.zh.md | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/windows/APIExample/README.md b/windows/APIExample/README.md index 55099468a..491b6bb57 100644 --- a/windows/APIExample/README.md +++ b/windows/APIExample/README.md @@ -19,10 +19,9 @@ Next, download the **Agora Video SDK** from [Agora.io SDK](https://www.agora.io/ -##Basic Scene +## Basic Scene - -###LiveBroadcasting +### LiveBroadcasting * change client role @@ -30,22 +29,22 @@ Next, download the **Agora Video SDK** from [Agora.io SDK](https://www.agora.io/ * join/leave channel * render local and remote video -##Advanced Scene +## Advanced Scene -###RTMP Streaming +### RTMP Streaming * Add publish stream url after join channel success * remove publish stream url before leave channel * show information returned by rtmp streaming callback -###Inject Stream Url +### Inject Stream Url * inject stream url after join channel success * show information returned by inject status callback * Receive 666 jonied callback after inject stream url succeed.You can mute video and audio of 666. Also,you can render it. * remove inject stream url before leave channel -###Video Metadata(Video SEI) +### Video Metadata(Video SEI) * You need enable video and joinchannel. * Send video SEI information. The maximum is 1024 byte. diff --git a/windows/APIExample/README.zh.md b/windows/APIExample/README.zh.md index 9ee7a5cd0..2b8ffa77e 100644 --- a/windows/APIExample/README.zh.md +++ b/windows/APIExample/README.zh.md @@ -22,31 +22,31 @@ 然后在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**,解压后将其中的 **libs** 复制到本项目目录下(APIExample.slin所在的目录)。最后使用 Vs2017 打开 APIExample.sln,编译整个解决方案即可运行 -##基础场景 +## 基础场景 -###直播互动 +### 直播互动 * 切换角色 * 支持1v1,1v3, 1v8, 1v15 * 进出频道 * 显示本地和远端视频 -##进阶场景 +## 进阶场景 -###旁路推流 +### 旁路推流 * 加入频道后添加rtmp推流地址 * 移除推流地址 * 推流回调处理状态信息显示 -###插入媒体流 +### 插入媒体流 * 加入频道后inject 媒体流 * 显示插入状态回调信息 * 插入成功,收到一个666加入回调。本地mute 666的视频和音频(也可以不mute) * 移除插入流 -###视频MetaData +### 视频MetaData * 加入频道,发送视频流 * 发送视频SEI信息,最大1024B From 7381c56f3c07b4fa9f7d0a261ad295352b57126c Mon Sep 17 00:00:00 2001 From: Chen-Alexander <1401429109@qq.com> Date: Wed, 24 Jun 2020 14:40:50 +0800 Subject: [PATCH 034/430] =?UTF-8?q?1=EF=BC=9Afix=20bugs.=202=EF=BC=9Aadd?= =?UTF-8?q?=20rawData=20module.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Android/APIExample/app/build.gradle | 1 + .../advanced/CustomRemoteVideoRender.java | 17 +- .../examples/advanced/ProcessRawData.java | 378 + .../examples/advanced/PushExternalVideo.java | 101 +- .../examples/advanced/QuickSwitchChannel.java | 4 +- .../examples/advanced/RTMPInjection.java | 17 +- .../examples/advanced/RTMPStreaming.java | 17 +- .../examples/advanced/StreamEncrypt.java | 100 +- .../examples/advanced/VideoMetadata.java | 4 +- .../examples/basic/JoinChannelVideo.java | 17 +- .../io/agora/api/example/utils/YUVUtils.java | 147 + .../res/layout/fragment_process_rawdata.xml | 44 + .../app/src/main/res/navigation/nav_graph.xml | 8 + Android/APIExample/lib-raw-data/.gitignore | 1 + .../APIExample/lib-raw-data/CMakeLists.txt | 44 + Android/APIExample/lib-raw-data/build.gradle | 53 + .../lib-raw-data/consumer-rules.pro | 0 .../lib-raw-data/proguard-rules.pro | 21 + .../lib-raw-data/src/main/AndroidManifest.xml | 1 + .../src/main/cpp/include/AgoraBase.h | 786 ++ .../src/main/cpp/include/IAgoraMediaEngine.h | 227 + .../src/main/cpp/include/IAgoraRtcChannel.h | 1203 +++ .../src/main/cpp/include/IAgoraRtcEngine.h | 7155 +++++++++++++++++ .../src/main/cpp/include/IAgoraService.h | 76 + .../src/main/cpp/include/VMUtil.h | 52 + ...vancedvideo_rawdata_MediaPreProcessing.cpp | 443 + ...advancedvideo_rawdata_MediaPreProcessing.h | 77 + .../rawdata/DecodeDataBuffer.java | 32 + .../rawdata/MediaDataAudioObserver.java | 14 + .../rawdata/MediaDataObserverPlugin.java | 299 + .../rawdata/MediaDataVideoObserver.java | 10 + .../rawdata/MediaPreProcessing.java | 64 + Android/APIExample/settings.gradle | 2 +- 33 files changed, 11215 insertions(+), 200 deletions(-) create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/ProcessRawData.java create mode 100644 Android/APIExample/app/src/main/java/io/agora/api/example/utils/YUVUtils.java create mode 100644 Android/APIExample/app/src/main/res/layout/fragment_process_rawdata.xml create mode 100644 Android/APIExample/lib-raw-data/.gitignore create mode 100644 Android/APIExample/lib-raw-data/CMakeLists.txt create mode 100644 Android/APIExample/lib-raw-data/build.gradle create mode 100644 Android/APIExample/lib-raw-data/consumer-rules.pro create mode 100644 Android/APIExample/lib-raw-data/proguard-rules.pro create mode 100644 Android/APIExample/lib-raw-data/src/main/AndroidManifest.xml create mode 100644 Android/APIExample/lib-raw-data/src/main/cpp/include/AgoraBase.h create mode 100755 Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraMediaEngine.h create mode 100755 Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcChannel.h create mode 100755 Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcEngine.h create mode 100644 Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraService.h create mode 100644 Android/APIExample/lib-raw-data/src/main/cpp/include/VMUtil.h create mode 100644 Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.cpp create mode 100644 Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.h create mode 100644 Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/DecodeDataBuffer.java create mode 100644 Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataAudioObserver.java create mode 100644 Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataObserverPlugin.java create mode 100644 Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataVideoObserver.java create mode 100644 Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaPreProcessing.java diff --git a/Android/APIExample/app/build.gradle b/Android/APIExample/app/build.gradle index 80481c791..017df74da 100644 --- a/Android/APIExample/app/build.gradle +++ b/Android/APIExample/app/build.gradle @@ -49,4 +49,5 @@ dependencies { implementation project(path: ':lib-stream-encrypt') implementation project(path: ':lib-push-externalvideo') + implementation project(path: ':lib-raw-data') } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java index 95d72cc82..1ba45221d 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java @@ -385,7 +385,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { /**custom remote video surfaceView @@ -425,10 +427,15 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() { + @Override + public void run() { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/ProcessRawData.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/ProcessRawData.java new file mode 100644 index 000000000..a0b94c5e1 --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/ProcessRawData.java @@ -0,0 +1,378 @@ +package io.agora.api.example.examples.advanced; + +import android.content.Context; +import android.graphics.Bitmap; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.SurfaceView; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.yanzhenjie.permission.AndPermission; +import com.yanzhenjie.permission.runtime.Permission; + +import io.agora.advancedvideo.rawdata.MediaDataAudioObserver; +import io.agora.advancedvideo.rawdata.MediaDataObserverPlugin; +import io.agora.advancedvideo.rawdata.MediaDataVideoObserver; +import io.agora.advancedvideo.rawdata.MediaPreProcessing; +import io.agora.api.example.R; +import io.agora.api.example.annotation.Example; +import io.agora.api.example.common.BaseFragment; +import io.agora.api.example.utils.YUVUtils; +import io.agora.rtc.Constants; +import io.agora.rtc.IRtcEngineEventHandler; +import io.agora.rtc.RtcEngine; +import io.agora.rtc.video.VideoCanvas; +import io.agora.rtc.video.VideoEncoderConfiguration; + +import static io.agora.rtc.video.VideoCanvas.RENDER_MODE_HIDDEN; +import static io.agora.rtc.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15; +import static io.agora.rtc.video.VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE; +import static io.agora.rtc.video.VideoEncoderConfiguration.STANDARD_BITRATE; +import static io.agora.rtc.video.VideoEncoderConfiguration.VD_640x360; + +@Example( + group = "ADVANCED", + name = "Process RawData", + actionId = R.id.action_mainFragment_to_ProcessRawData +) +public class ProcessRawData extends BaseFragment implements View.OnClickListener, MediaDataVideoObserver, + MediaDataAudioObserver { + private static final String TAG = ProcessRawData.class.getSimpleName(); + + private FrameLayout fl_local, fl_remote; + private Button join; + private EditText et_channel; + private RtcEngine engine; + private int myUid; + private boolean joined = false; + private MediaDataObserverPlugin mediaDataObserverPlugin; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // Check if the context is valid + Context context = getContext(); + if (context == null) { + return; + } + try { + /**Creates an RtcEngine instance. + * @param context The context of Android Activity + * @param appId The App ID issued to you by Agora. See + * How to get the App ID + * @param handler IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events.*/ + engine = RtcEngine.create(context.getApplicationContext(), getString(R.string.agora_app_id), iRtcEngineEventHandler); + } + catch (Exception e) { + e.printStackTrace(); + getActivity().onBackPressed(); + } + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_process_rawdata, container, false); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + join = view.findViewById(R.id.btn_join); + et_channel = view.findViewById(R.id.et_channel); + view.findViewById(R.id.btn_join).setOnClickListener(this); + fl_local = view.findViewById(R.id.fl_local); + fl_remote = view.findViewById(R.id.fl_remote); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + mediaDataObserverPlugin = MediaDataObserverPlugin.the(); + MediaPreProcessing.setCallback(mediaDataObserverPlugin); + MediaPreProcessing.setVideoCaptureByteBuffer(mediaDataObserverPlugin.byteBufferCapture); + mediaDataObserverPlugin.addVideoObserver(this); + } + + @Override + public void onDestroy() { + if (mediaDataObserverPlugin != null) { + mediaDataObserverPlugin.removeVideoObserver(this); + mediaDataObserverPlugin.removeAllBuffer(); + } + MediaPreProcessing.releasePoint(); + /**leaveChannel and Destroy the RtcEngine instance*/ + if (engine != null) { + engine.leaveChannel(); + } + handler.post(RtcEngine::destroy); + engine = null; + super.onDestroy(); + } + + @Override + public void onClick(View v) { + if (v.getId() == R.id.btn_join) { + if (!joined) { + // call when join button hit + String channelId = et_channel.getText().toString(); + // Check permission + if (AndPermission.hasPermissions(this, Permission.Group.STORAGE, Permission.Group.MICROPHONE, Permission.Group.CAMERA)) { + joinChannel(channelId); + return; + } + // Request permission + AndPermission.with(this).runtime().permission( + Permission.Group.STORAGE, + Permission.Group.MICROPHONE, + Permission.Group.CAMERA + ).onGranted(permissions -> + { + // Permissions Granted + joinChannel(channelId); + }).start(); + } else { + joined = false; + /**After joining a channel, the user must call the leaveChannel method to end the + * call before joining another channel. This method returns 0 if the user leaves the + * channel and releases all resources related to the call. This method call is + * asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. + * A successful leaveChannel method call triggers the following callbacks: + * 1:The local client: onLeaveChannel. + * 2:The remote client: onUserOffline, if the user leaving the channel is in the + * Communication channel, or is a BROADCASTER in the Live Broadcast profile. + * @returns 0: Success. + * < 0: Failure. + * PS: + * 1:If you call the destroy method immediately after calling the leaveChannel + * method, the leaveChannel process interrupts, and the SDK does not trigger + * the onLeaveChannel callback. + * 2:If you call the leaveChannel method during CDN live streaming, the SDK + * triggers the removeInjectStreamUrl method.*/ + engine.leaveChannel(); + join.setText(getString(R.string.join)); + } + } + } + + private void joinChannel(String channelId) { + // Check if the context is valid + Context context = getContext(); + if (context == null) { + return; + } + + // Create render view by RtcEngine + SurfaceView surfaceView = RtcEngine.CreateRendererView(context); + // Local video is on the top + surfaceView.setZOrderMediaOverlay(true); + // Add to the local container + fl_local.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + // Setup local video to render your local camera preview + engine.setupLocalVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, 0)); + // Set audio route to speaker + engine.setDefaultAudioRoutetoSpeakerphone(true); + + /** Sets the channel profile of the Agora RtcEngine. + CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile. + Use this profile in one-on-one calls or group calls, where all users can talk freely. + CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast + channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; + an audience can only receive streams.*/ + engine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING); + /**In the demo, the default is to enter as the anchor.*/ + engine.setClientRole(IRtcEngineEventHandler.ClientRole.CLIENT_ROLE_BROADCASTER); + // Enable video module + engine.enableVideo(); + // Setup video encoding configs + engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( + VD_640x360, + FRAME_RATE_FPS_15, + STANDARD_BITRATE, + ORIENTATION_MODE_ADAPTIVE + )); + + /**Please configure accessToken in the string_config file. + * A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see + * https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token + * A token generated at the server. This applies to scenarios with high-security requirements. For details, see + * https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/ + String accessToken = getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { + accessToken = null; + } + /** Allows a user to join a channel. + if you do not specify the uid, we will generate the uid for you*/ + int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0); + if (res != 0) { + // Usually happens with invalid parameters + // Error code description can be found at: + // en: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + // cn: https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html + showAlert(RtcEngine.getErrorDescription(Math.abs(res))); + return; + } + // Prevent repeated entry + join.setEnabled(false); + } + + /** + * IRtcEngineEventHandler is an abstract class providing default implementation. + * The SDK uses this class to report to the app on SDK runtime events. + */ + private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() { + /**Reports a warning during SDK runtime. + * Warning code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_warn_code.html*/ + @Override + public void onWarning(int warn) { + Log.w(TAG, String.format("onWarning code %d message %s", warn, RtcEngine.getErrorDescription(warn))); + } + + /**Reports an error during SDK runtime. + * Error code: https://docs.agora.io/en/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html*/ + @Override + public void onError(int err) { + Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err))); + } + + /**Occurs when a user leaves the channel. + * @param stats With this callback, the application retrieves the channel information, + * such as the call duration and statistics.*/ + @Override + public void onLeaveChannel(RtcStats stats) { + super.onLeaveChannel(stats); + Log.i(TAG, String.format("local user %d leaveChannel!", myUid)); + showLongToast(String.format("local user %d leaveChannel!", myUid)); + } + + /**Occurs when the local user joins a specified channel. + * The channel name assignment is based on channelName specified in the joinChannel method. + * If the uid is not specified when joinChannel is called, the server automatically assigns a uid. + * @param channel Channel name + * @param uid User ID + * @param elapsed Time elapsed (ms) from the user calling joinChannel until this callback is triggered*/ + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) { + Log.i(TAG, String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + showLongToast(String.format("onJoinChannelSuccess channel %s uid %d", channel, uid)); + myUid = uid; + joined = true; + handler.post(new Runnable() { + @Override + public void run() { + join.setEnabled(true); + join.setText(getString(R.string.leave)); + } + }); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. + * @param uid ID of the user whose audio state changes. + * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole + * until this callback is triggered.*/ + @Override + public void onUserJoined(int uid, int elapsed) { + super.onUserJoined(uid, elapsed); + Log.i(TAG, "onUserJoined->" + uid); + showLongToast(String.format("user %d joined!", uid)); + /**Check if the context is correct*/ + Context context = getContext(); + if (context == null) { + return; + } + handler.post(() -> + { + if (mediaDataObserverPlugin != null) { + mediaDataObserverPlugin.addDecodeBuffer(uid); + } + + /**Display remote video stream*/ + // Create render view by RtcEngine + SurfaceView surfaceView = RtcEngine.CreateRendererView(context); + if (fl_remote.getChildCount() > 0) { + fl_remote.removeAllViews(); + } + // Add to the remote container + fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); + // Setup remote video to render + engine.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); + }); + } + + /**Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * @param uid ID of the user whose audio state changes. + * @param reason Reason why the user goes offline: + * USER_OFFLINE_QUIT(0): The user left the current channel. + * USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data + * packet was received within a certain period of time. If a user quits the + * call and the message is not passed to the SDK (due to an unreliable channel), + * the SDK assumes the user dropped offline. + * USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast only.) The client role switched from + * the host to the audience.*/ + @Override + public void onUserOffline(int uid, int reason) { + Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); + showLongToast(String.format("user %d offline! reason:%d", uid, reason)); + handler.post(new Runnable() { + @Override + public void run() { + if (mediaDataObserverPlugin != null) { + mediaDataObserverPlugin.removeDecodeBuffer(uid); + } + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); + } + }; + + @Override + public void onCaptureVideoFrame(byte[] data, int frameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs) { + /**You can do some processing on the video frame here*/ + Log.e(TAG, "onCaptureVideoFrame0"); + Bitmap bmp = YUVUtils.blur(getContext(), YUVUtils.i420ToBitmap(width, height, rotation, bufferLength, data, yStride, uStride, vStride), 10); + // copy the new byte array + System.arraycopy(YUVUtils.bitmapToI420(width, height, bmp), 0, data, 0, bufferLength); + } + + @Override + public void onRenderVideoFrame(int uid, byte[] data, int frameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs) { + + } + + @Override + public void onRecordAudioFrame(byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + + } + + @Override + public void onPlaybackAudioFrame(byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + + } + + @Override + public void onPlaybackAudioFrameBeforeMixing(int uid, byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + + } + + @Override + public void onMixedAudioFrame(byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + + } +} diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java index d4b3a1cdd..4e9dda4a0 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java @@ -476,89 +476,6 @@ public void run() }); } - /**Since v2.9.0. - * This callback indicates the state change of the remote audio stream. - * PS: This callback does not work properly when the number of users (in the Communication profile) or - * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. - * @param uid ID of the user whose audio state changes. - * @param state State of the remote audio - * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due - * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), - * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). - * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. - * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, - * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), - * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). - * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to - * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). - * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to - * REMOTE_AUDIO_REASON_INTERNAL(0). - * @param reason The reason of the remote audio state change. - * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. - * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. - * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. - * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio - * stream or disables the audio module. - * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio - * stream or enables the audio module. - * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or - * disables the audio module. - * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream - * or enables the audio module. - * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. - * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method - * until the SDK triggers this callback.*/ - @Override - public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) - { - super.onRemoteAudioStateChanged(uid, state, reason, elapsed); - Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); - } - - /**Since v2.9.0. - * Occurs when the remote video state changes. - * PS: This callback does not work properly when the number of users (in the Communication - * profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. - * @param uid ID of the remote user whose video state changes. - * @param state State of the remote video: - * REMOTE_VIDEO_STATE_STOPPED(0): The remote video is in the default state, probably due - * to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5), - * or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7). - * REMOTE_VIDEO_STATE_STARTING(1): The first remote video packet is received. - * REMOTE_VIDEO_STATE_DECODING(2): The remote video stream is decoded and plays normally, - * probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), - * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6), - * or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9). - * REMOTE_VIDEO_STATE_FROZEN(3): The remote video is frozen, probably due to - * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8). - * REMOTE_VIDEO_STATE_FAILED(4): The remote video fails to start, probably due to - * REMOTE_VIDEO_STATE_REASON_INTERNAL(0). - * @param reason The reason of the remote video state change: - * REMOTE_VIDEO_STATE_REASON_INTERNAL(0): Internal reasons. - * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1): Network congestion. - * REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY(2): Network recovery. - * REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3): The local user stops receiving the remote - * video stream or disables the video module. - * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote - * video stream or enables the video module. - * REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5): The remote user stops sending the video - * stream or disables the video module. - * REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the video - * stream or enables the video module. - * REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. - * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8): The remote media stream falls back to the - * audio-only stream due to poor network conditions. - * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9): The remote media stream switches - * back to the video stream after the network conditions improve. - * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method until - * the SDK triggers this callback.*/ - @Override - public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) - { - super.onRemoteVideoStateChanged(uid, state, reason, elapsed); - Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); - } - /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. * @param uid ID of the user whose audio state changes. * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole @@ -571,7 +488,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { /**Display remote video stream*/ @@ -586,7 +505,6 @@ public void onUserJoined(int uid, int elapsed) ViewGroup.LayoutParams.MATCH_PARENT)); // Setup remote video to render engine.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); -// engine.muteRemoteVideoStream(uid, false); }); } @@ -605,10 +523,15 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() { + @Override + public void run() { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java index 0a818a103..4bf6a8e85 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/QuickSwitchChannel.java @@ -443,7 +443,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { if(uid != myUid) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java index 2dd5c2a0b..9caf50ebc 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPInjection.java @@ -482,7 +482,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { fl_remote.removeAllViews(); @@ -514,10 +516,15 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() { + @Override + public void run() { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java index f5d1dc27f..d2acecaec 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java @@ -540,7 +540,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { /**Display remote video stream*/ @@ -581,10 +583,15 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() { + @Override + public void run() { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java index 8c6ca5d7b..ab11224c2 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java @@ -290,89 +290,6 @@ public void run() }); } - /**Since v2.9.0. - * This callback indicates the state change of the remote audio stream. - * PS: This callback does not work properly when the number of users (in the Communication profile) or - * broadcasters (in the Live-broadcast profile) in the channel exceeds 17. - * @param uid ID of the user whose audio state changes. - * @param state State of the remote audio - * REMOTE_AUDIO_STATE_STOPPED(0): The remote audio is in the default state, probably due - * to REMOTE_AUDIO_REASON_LOCAL_MUTED(3), REMOTE_AUDIO_REASON_REMOTE_MUTED(5), - * or REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7). - * REMOTE_AUDIO_STATE_STARTING(1): The first remote audio packet is received. - * REMOTE_AUDIO_STATE_DECODING(2): The remote audio stream is decoded and plays normally, - * probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2), - * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4) or REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6). - * REMOTE_AUDIO_STATE_FROZEN(3): The remote audio is frozen, probably due to - * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1). - * REMOTE_AUDIO_STATE_FAILED(4): The remote audio fails to start, probably due to - * REMOTE_AUDIO_REASON_INTERNAL(0). - * @param reason The reason of the remote audio state change. - * REMOTE_AUDIO_REASON_INTERNAL(0): Internal reasons. - * REMOTE_AUDIO_REASON_NETWORK_CONGESTION(1): Network congestion. - * REMOTE_AUDIO_REASON_NETWORK_RECOVERY(2): Network recovery. - * REMOTE_AUDIO_REASON_LOCAL_MUTED(3): The local user stops receiving the remote audio - * stream or disables the audio module. - * REMOTE_AUDIO_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote audio - * stream or enables the audio module. - * REMOTE_AUDIO_REASON_REMOTE_MUTED(5): The remote user stops sending the audio stream or - * disables the audio module. - * REMOTE_AUDIO_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the audio stream - * or enables the audio module. - * REMOTE_AUDIO_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. - * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method - * until the SDK triggers this callback.*/ - @Override - public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) - { - super.onRemoteAudioStateChanged(uid, state, reason, elapsed); - Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason); - } - - /**Since v2.9.0. - * Occurs when the remote video state changes. - * PS: This callback does not work properly when the number of users (in the Communication - * profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17. - * @param uid ID of the remote user whose video state changes. - * @param state State of the remote video: - * REMOTE_VIDEO_STATE_STOPPED(0): The remote video is in the default state, probably due - * to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5), - * or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7). - * REMOTE_VIDEO_STATE_STARTING(1): The first remote video packet is received. - * REMOTE_VIDEO_STATE_DECODING(2): The remote video stream is decoded and plays normally, - * probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), - * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6), - * or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9). - * REMOTE_VIDEO_STATE_FROZEN(3): The remote video is frozen, probably due to - * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8). - * REMOTE_VIDEO_STATE_FAILED(4): The remote video fails to start, probably due to - * REMOTE_VIDEO_STATE_REASON_INTERNAL(0). - * @param reason The reason of the remote video state change: - * REMOTE_VIDEO_STATE_REASON_INTERNAL(0): Internal reasons. - * REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION(1): Network congestion. - * REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY(2): Network recovery. - * REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED(3): The local user stops receiving the remote - * video stream or disables the video module. - * REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED(4): The local user resumes receiving the remote - * video stream or enables the video module. - * REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED(5): The remote user stops sending the video - * stream or disables the video module. - * REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED(6): The remote user resumes sending the video - * stream or enables the video module. - * REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE(7): The remote user leaves the channel. - * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK(8): The remote media stream falls back to the - * audio-only stream due to poor network conditions. - * REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY(9): The remote media stream switches - * back to the video stream after the network conditions improve. - * @param elapsed Time elapsed (ms) from the local user calling the joinChannel method until - * the SDK triggers this callback.*/ - @Override - public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) - { - super.onRemoteVideoStateChanged(uid, state, reason, elapsed); - Log.i(TAG, "onRemoteVideoStateChanged->" + uid + ", state->" + state + ", reason->" + reason); - } - /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. * @param uid ID of the user whose audio state changes. * @param elapsed Time delay (ms) from the local user calling joinChannel/setClientRole @@ -385,7 +302,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { /**Display remote video stream*/ @@ -426,10 +345,15 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() { + @Override + public void run() { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java index 8521b7320..258e4f72b 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java @@ -454,7 +454,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { /**Display remote video stream*/ diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java index 657fc0d85..e6d0dc190 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java @@ -379,7 +379,9 @@ public void onUserJoined(int uid, int elapsed) showLongToast(String.format("user %d joined!", uid)); /**Check if the context is correct*/ Context context = getContext(); - if (context == null) return; + if (context == null) { + return; + } handler.post(() -> { /**Display remote video stream*/ @@ -420,10 +422,15 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + handler.post(new Runnable() { + @Override + public void run() { + /**Clear render view + Note: The video will stay at its last frame, to completely remove it you will need to + remove the SurfaceView from its parent*/ + engine.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); + } + }); } }; } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/utils/YUVUtils.java b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/YUVUtils.java new file mode 100644 index 000000000..eeb5a2e9f --- /dev/null +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/utils/YUVUtils.java @@ -0,0 +1,147 @@ +package io.agora.api.example.utils; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.ImageFormat; +import android.graphics.Matrix; +import android.graphics.Rect; +import android.graphics.YuvImage; +import android.renderscript.Allocation; +import android.renderscript.Element; +import android.renderscript.RenderScript; +import android.renderscript.ScriptIntrinsicBlur; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public class YUVUtils { + + public static void encodeI420(byte[] i420, int[] argb, int width, int height) { + final int frameSize = width * height; + + int yIndex = 0; // Y start index + int uIndex = frameSize; // U statt index + int vIndex = frameSize * 5 / 4; // V start index: w*h*5/4 + + int a, R, G, B, Y, U, V; + int index = 0; + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + a = (argb[index] & 0xff000000) >> 24; // is not used obviously + R = (argb[index] & 0xff0000) >> 16; + G = (argb[index] & 0xff00) >> 8; + B = (argb[index] & 0xff) >> 0; + + // well known RGB to YUV algorithm + Y = ((66 * R + 129 * G + 25 * B + 128) >> 8) + 16; + U = ((-38 * R - 74 * G + 112 * B + 128) >> 8) + 128; + V = ((112 * R - 94 * G - 18 * B + 128) >> 8) + 128; + + // I420(YUV420p) -> YYYYYYYY UU VV + i420[yIndex++] = (byte) ((Y < 0) ? 0 : ((Y > 255) ? 255 : Y)); + if (j % 2 == 0 && i % 2 == 0) { + i420[uIndex++] = (byte) ((U < 0) ? 0 : ((U > 255) ? 255 : U)); + i420[vIndex++] = (byte) ((V < 0) ? 0 : ((V > 255) ? 255 : V)); + } + index++; + } + } + } + + public static void encodeNV21(byte[] yuv420sp, int[] argb, int width, int height) { + final int frameSize = width * height; + + int yIndex = 0; + int uvIndex = frameSize; + + int a, R, G, B, Y, U, V; + int index = 0; + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + a = (argb[index] & 0xff000000) >> 24; // a is not used obviously + R = (argb[index] & 0xff0000) >> 16; + G = (argb[index] & 0xff00) >> 8; + B = (argb[index] & 0xff) >> 0; + + // well known RGB to YUV algorithm + Y = ((66 * R + 129 * G + 25 * B + 128) >> 8) + 16; + U = ((-38 * R - 74 * G + 112 * B + 128) >> 8) + 128; + V = ((112 * R - 94 * G - 18 * B + 128) >> 8) + 128; + + // NV21 has a plane of Y and interleaved planes of VU each sampled by a factor of 2 + // meaning for every 4 Y pixels there are 1 V and 1 U. Note the sampling is every other + // pixel AND every other scanline. + yuv420sp[yIndex++] = (byte) ((Y < 0) ? 0 : ((Y > 255) ? 255 : Y)); + if (j % 2 == 0 && index % 2 == 0) { + yuv420sp[uvIndex++] = (byte) ((V < 0) ? 0 : ((V > 255) ? 255 : V)); + yuv420sp[uvIndex++] = (byte) ((U < 0) ? 0 : ((U > 255) ? 255 : U)); + } + index++; + } + } + } + + public static void swapYU12toYUV420SP(byte[] yu12bytes, byte[] i420bytes, int width, int height, int yStride, int uStride, int vStride) { + System.arraycopy(yu12bytes, 0, i420bytes, 0, yStride * height); + int startPos = yStride * height; + int yv_start_pos_u = startPos; + int yv_start_pos_v = startPos + startPos / 4; + for (int i = 0; i < startPos / 4; i++) { + i420bytes[startPos + 2 * i + 0] = yu12bytes[yv_start_pos_v + i]; + i420bytes[startPos + 2 * i + 1] = yu12bytes[yv_start_pos_u + i]; + } + } + + public static Bitmap i420ToBitmap(int width, int height, int rotation, int bufferLength, byte[] buffer, int yStride, int uStride, int vStride) { + byte[] NV21 = new byte[bufferLength]; + swapYU12toYUV420SP(buffer, NV21, width, height, yStride, uStride, vStride); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + int[] strides = {yStride, yStride}; + YuvImage image = new YuvImage(NV21, ImageFormat.NV21, width, height, strides); + + image.compressToJpeg( + new Rect(0, 0, image.getWidth(), image.getHeight()), + 100, baos); + + // rotate picture when saving to file + Matrix matrix = new Matrix(); + matrix.postRotate(rotation); + byte[] bytes = baos.toByteArray(); + try { + baos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); + } + + public static Bitmap blur(Context context, Bitmap image, float radius) { + RenderScript rs = RenderScript.create(context); + Bitmap outputBitmap = Bitmap.createBitmap(image.getWidth(), image.getHeight(), Bitmap.Config.ARGB_8888); + Allocation in = Allocation.createFromBitmap(rs, image); + Allocation out = Allocation.createFromBitmap(rs, outputBitmap); + ScriptIntrinsicBlur intrinsicBlur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); + intrinsicBlur.setRadius(radius); + intrinsicBlur.setInput(in); + intrinsicBlur.forEach(out); + + out.copyTo(outputBitmap); + image.recycle(); + rs.destroy(); + + return outputBitmap; + } + + public static byte[] bitmapToI420(int inputWidth, int inputHeight, Bitmap scaled) { + int[] argb = new int[inputWidth * inputHeight]; + scaled.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight); + byte[] yuv = new byte[inputWidth * inputHeight * 3 / 2]; + YUVUtils.encodeI420(yuv, argb, inputWidth, inputHeight); + scaled.recycle(); + return yuv; + } + +} diff --git a/Android/APIExample/app/src/main/res/layout/fragment_process_rawdata.xml b/Android/APIExample/app/src/main/res/layout/fragment_process_rawdata.xml new file mode 100644 index 000000000..786967999 --- /dev/null +++ b/Android/APIExample/app/src/main/res/layout/fragment_process_rawdata.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml index 8c0439824..bad39e6ac 100755 --- a/Android/APIExample/app/src/main/res/navigation/nav_graph.xml +++ b/Android/APIExample/app/src/main/res/navigation/nav_graph.xml @@ -39,6 +39,9 @@ + + diff --git a/Android/APIExample/lib-raw-data/.gitignore b/Android/APIExample/lib-raw-data/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/Android/APIExample/lib-raw-data/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Android/APIExample/lib-raw-data/CMakeLists.txt b/Android/APIExample/lib-raw-data/CMakeLists.txt new file mode 100644 index 000000000..268f125e4 --- /dev/null +++ b/Android/APIExample/lib-raw-data/CMakeLists.txt @@ -0,0 +1,44 @@ +# For more information about using CMake with Android Studio, read the +# documentation: https://d.android.com/studio/projects/add-native-code.html + +# Sets the minimum version of CMake required to build the native library. + +cmake_minimum_required(VERSION 3.4.1) + +# Creates and names a library, sets it as either STATIC +# or SHARED, and provides the relative paths to its source code. +# You can define multiple libraries, and CMake builds them for you. +# Gradle automatically packages shared libraries with your APK. + +add_library( # Sets the name of the library. + apm-plugin-raw-data + + # Sets the library as a shared library. + SHARED + + # Provides a relative path to your source file(s). + src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.cpp) + +# Searches for a specified prebuilt library and stores the path as a +# variable. Because CMake includes system libraries in the search path by +# default, you only need to specify the name of the public NDK library +# you want to add. CMake verifies that the library exists before +# completing its build. + +find_library( # Sets the name of the path variable. + log-lib + + # Specifies the name of the NDK library that + # you want CMake to locate. + log) + +# Specifies libraries CMake should link to your target library. You +# can link multiple libraries, such as libraries you define in this +# build script, prebuilt third-party libraries, or system libraries. + +target_link_libraries( # Specifies the target library. + apm-plugin-raw-data + + # Links the target library to the log library + # included in the NDK. + ${log-lib}) \ No newline at end of file diff --git a/Android/APIExample/lib-raw-data/build.gradle b/Android/APIExample/lib-raw-data/build.gradle new file mode 100644 index 000000000..e04fd9311 --- /dev/null +++ b/Android/APIExample/lib-raw-data/build.gradle @@ -0,0 +1,53 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.2" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + + externalNativeBuild { + cmake { + cppFlags "-std=c++11" + arguments "-DANDROID_STL=c++_static", + "-DANDROID_PLATFORM=android-15", + "-DANDROID_TOOLCHAIN=clang", + "-DANDROID_STL_FORCE_FEATURES=OFF", + "-DANDROID_ARM_NEON=TRUE" + } + } + + ndk { + abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86" + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/Android/APIExample/lib-raw-data/consumer-rules.pro b/Android/APIExample/lib-raw-data/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/Android/APIExample/lib-raw-data/proguard-rules.pro b/Android/APIExample/lib-raw-data/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/Android/APIExample/lib-raw-data/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/Android/APIExample/lib-raw-data/src/main/AndroidManifest.xml b/Android/APIExample/lib-raw-data/src/main/AndroidManifest.xml new file mode 100644 index 000000000..97d8ccdc0 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/include/AgoraBase.h b/Android/APIExample/lib-raw-data/src/main/cpp/include/AgoraBase.h new file mode 100644 index 000000000..955d13d70 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/include/AgoraBase.h @@ -0,0 +1,786 @@ +// Agora Engine SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +#ifndef AGORA_BASE_H +#define AGORA_BASE_H + +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#include +#define AGORA_CALL __cdecl +#if defined(AGORARTC_EXPORT) +#define AGORA_API extern "C" __declspec(dllexport) +#else +#define AGORA_API extern "C" __declspec(dllimport) +#endif +#elif defined(__APPLE__) +#include +#define AGORA_API __attribute__((visibility("default"))) extern "C" +#define AGORA_CALL +#elif defined(__ANDROID__) || defined(__linux__) +#define AGORA_API extern "C" __attribute__((visibility("default"))) +#define AGORA_CALL +#else +#define AGORA_API extern "C" +#define AGORA_CALL +#endif + +namespace agora { +namespace util { + +template +class AutoPtr { + typedef T value_type; + typedef T* pointer_type; +public: + AutoPtr(pointer_type p=0) + :ptr_(p) + {} + ~AutoPtr() { + if (ptr_) + ptr_->release(); + } + operator bool() const { return ptr_ != (pointer_type)0; } + value_type& operator*() const { + return *get(); + } + + pointer_type operator->() const { + return get(); + } + + pointer_type get() const { + return ptr_; + } + + pointer_type release() { + pointer_type tmp = ptr_; + ptr_ = 0; + return tmp; + } + + void reset(pointer_type ptr = 0) { + if (ptr != ptr_ && ptr_) + ptr_->release(); + ptr_ = ptr; + } + template + bool queryInterface(C1* c, C2 iid) { + pointer_type p = NULL; + if (c && !c->queryInterface(iid, (void**)&p)) + { + reset(p); + } + return p != NULL; + } +private: + AutoPtr(const AutoPtr&); + AutoPtr& operator=(const AutoPtr&); +private: + pointer_type ptr_; +}; +class IString { +protected: + virtual ~IString(){} +public: + virtual bool empty() const = 0; + virtual const char* c_str() = 0; + virtual const char* data() = 0; + virtual size_t length() = 0; + virtual void release() = 0; +}; +typedef AutoPtr AString; + +}//namespace util + +enum INTERFACE_ID_TYPE +{ + AGORA_IID_AUDIO_DEVICE_MANAGER = 1, + AGORA_IID_VIDEO_DEVICE_MANAGER = 2, + AGORA_IID_RTC_ENGINE_PARAMETER = 3, + AGORA_IID_MEDIA_ENGINE = 4, + AGORA_IID_SIGNALING_ENGINE = 8, +}; + + /** Warning code. + */ +enum WARN_CODE_TYPE +{ + /** 8: The specified view is invalid. Specify a view when using the video call function. + */ + WARN_INVALID_VIEW = 8, + /** 16: Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected. + */ + WARN_INIT_VIDEO = 16, + /** 20: The request is pending, usually due to some module not being ready, and the SDK postponed processing the request. + */ + WARN_PENDING = 20, + /** 103: No channel resources are available. Maybe because the server cannot allocate any channel resource. + */ + WARN_NO_AVAILABLE_CHANNEL = 103, + /** 104: A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server. + */ + WARN_LOOKUP_CHANNEL_TIMEOUT = 104, + /** **DEPRECATED** 105: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. + + Deprecated as of v2.4.1. Use CONNECTION_CHANGED_REJECTED_BY_SERVER(10) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + */ + WARN_LOOKUP_CHANNEL_REJECTED = 105, + /** 106: A timeout occurs when opening the channel. Once the specific channel is found, the SDK opens the channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server. + */ + WARN_OPEN_CHANNEL_TIMEOUT = 106, + /** 107: The server rejects the request to open the channel. The server cannot process this request or the request is illegal. + */ + WARN_OPEN_CHANNEL_REJECTED = 107, + + // sdk: 100~1000 + /** 111: A timeout occurs when switching to the live video. + */ + WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111, + /** 118: A timeout occurs when setting the client role in the live broadcast profile. + */ + WARN_SET_CLIENT_ROLE_TIMEOUT = 118, + /** 121: The ticket to open the channel is invalid. + */ + WARN_OPEN_CHANNEL_INVALID_TICKET = 121, + /** 122: Try connecting to another server. + */ + WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122, + WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131, + WARN_CHANNEL_CONNECTION_IP_CHANGED = 132, + WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133, + /** 701: An error occurs in opening the audio mixing file. + */ + WARN_AUDIO_MIXING_OPEN_ERROR = 701, + /** 1014: Audio Device Module: a warning occurs in the playback device. + */ + WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014, + /** 1016: Audio Device Module: a warning occurs in the recording device. + */ + WARN_ADM_RUNTIME_RECORDING_WARNING = 1016, + /** 1019: Audio Device Module: no valid audio data is collected. + */ + WARN_ADM_RECORD_AUDIO_SILENCE = 1019, + /** 1020: Audio Device Module: the playback device fails. + */ + WARN_ADM_PLAYOUT_MALFUNCTION = 1020, + /** 1021: Audio Device Module: the recording device fails. + */ + WARN_ADM_RECORD_MALFUNCTION = 1021, + /** 1025: The audio playback or recording is interrupted by system events (such as a phone call). + */ + WARN_ADM_CALL_INTERRUPTION = 1025, + /** 1029: During a call, the audio session category should be set to + * AVAudioSessionCategoryPlayAndRecord, and RtcEngine monitors this value. + * If the audio session category is set to other values, this warning code + * is triggered and RtcEngine will forcefully set it back to + * AVAudioSessionCategoryPlayAndRecord. + */ + WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD = 1029, + /** + */ + WARN_ADM_IOS_SAMPLERATE_CHANGE = 1030, + /** 1031: Audio Device Module: the recorded audio voice is too low. + */ + WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031, + /** 1032: Audio Device Module: the playback audio voice is too low. + */ + WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032, + /** 1040: Audio device module: An exception occurs with the audio drive. + * Solutions: + * - Disable or re-enable the audio device. + * - Re-enable your device. + * - Update the sound card drive. + */ + WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040, + /** 1051: Audio Device Module: howling is detected. + */ + WARN_APM_HOWLING = 1051, + /** 1052: Audio Device Module: the device is in the glitch state. + */ + WARN_ADM_GLITCH_STATE = 1052, + /** 1053: Audio Device Module: the underlying audio settings have changed. + */ + WARN_ADM_IMPROPER_SETTINGS = 1053, + /** + */ + WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, + /** 1323: Audio device module: No available playback device. + * Solution: Plug in the audio device. + */ + WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, + /** Audio device module: The capture device is released improperly. + * Solutions: + * - Disable or re-enable the audio device. + * - Re-enable your device. + * - Update the sound card drive. + */ + WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324, + /** 1610: Super-resolution warning: the original video dimensions of the remote user exceed 640 × 480. + */ + WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION = 1610, + /** 1611: Super-resolution warning: another user is using super resolution. + */ + WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION = 1611, + /** 1612: The device is not supported. + */ + WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED = 1612, + + WARN_RTM_LOGIN_TIMEOUT = 2005, + WARN_RTM_KEEP_ALIVE_TIMEOUT = 2009 +}; + +/** Error code. +*/ +enum ERROR_CODE_TYPE +{ + /** 0: No error occurs. + */ + ERR_OK = 0, + //1~1000 + /** 1: A general error occurs (no specified reason). + */ + ERR_FAILED = 1, + /** 2: An invalid parameter is used. For example, the specific channel name includes illegal characters. + */ + ERR_INVALID_ARGUMENT = 2, + /** 3: The SDK module is not ready. Possible solutions: + + - Check the audio device. + - Check the completeness of the application. + - Re-initialize the RTC engine. + */ + ERR_NOT_READY = 3, + /** 4: The SDK does not support this function. + */ + ERR_NOT_SUPPORTED = 4, + /** 5: The request is rejected. + */ + ERR_REFUSED = 5, + /** 6: The buffer size is not big enough to store the returned data. + */ + ERR_BUFFER_TOO_SMALL = 6, + /** 7: The SDK is not initialized before calling this method. + */ + ERR_NOT_INITIALIZED = 7, + /** 9: No permission exists. Check if the user has granted access to the audio or video device. + */ + ERR_NO_PERMISSION = 9, + /** 10: An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (more than 10 seconds) for the SDK to process. + */ + ERR_TIMEDOUT = 10, + /** 11: The request is canceled. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_CANCELED = 11, + /** 12: The method is called too often. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_TOO_OFTEN = 12, + /** 13: The SDK fails to bind to the network socket. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_BIND_SOCKET = 13, + /** 14: The network is unavailable. This is for internal SDK use only, and it does not return to the application through any method or callback. + */ + ERR_NET_DOWN = 14, + /** 15: No network buffers are available. This is for internal SDK internal use only, and it does not return to the application through any method or callback. + */ + ERR_NET_NOBUFS = 15, + /** 17: The request to join the channel is rejected. This error usually occurs when the user is already in the channel, and still calls the method to join the channel, for example, \ref agora::rtc::IRtcEngine::joinChannel "joinChannel". + */ + ERR_JOIN_CHANNEL_REJECTED = 17, + /** 18: The request to leave the channel is rejected. + + This error usually occurs: + + - When the user has left the channel and still calls \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, stop calling \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel". + - When the user has not joined the channel and still calls \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, no extra operation is needed. + */ + ERR_LEAVE_CHANNEL_REJECTED = 18, + /** 19: Resources are occupied and cannot be reused. + */ + ERR_ALREADY_IN_USE = 19, + /** 20: The SDK gives up the request due to too many requests. + */ + ERR_ABORTED = 20, + /** 21: In Windows, specific firewall settings can cause the SDK to fail to initialize and crash. + */ + ERR_INIT_NET_ENGINE = 21, + /** 22: The application uses too much of the system resources and the SDK fails to allocate the resources. + */ + ERR_RESOURCE_LIMITED = 22, + /** 101: The specified App ID is invalid. Please try to rejoin the channel with a valid App ID. + */ + ERR_INVALID_APP_ID = 101, + /** 102: The specified channel name is invalid. Please try to rejoin the channel with a valid channel name. + */ + ERR_INVALID_CHANNEL_NAME = 102, + /** **DEPRECATED** 109: Deprecated as of v2.4.1. Use CONNECTION_CHANGED_TOKEN_EXPIRED(9) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + + The token expired due to one of the following reasons: + + - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the Token to access the Agora service within five minutes after the Token is generated. If the user does not access the Agora service after five minutes, this Token is no longer valid. + - Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel. + */ + ERR_TOKEN_EXPIRED = 109, + /** **DEPRECATED** 110: Deprecated as of v2.4.1. Use CONNECTION_CHANGED_INVALID_TOKEN(8) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + + The token is invalid due to one of the following reasons: + + - The App Certificate for the project is enabled in Console, but the user is still using the App ID. Once the App Certificate is enabled, the user must use a token. + - The uid is mandatory, and users must set the same uid as the one set in the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + */ + ERR_INVALID_TOKEN = 110, + /** 111: The internet connection is interrupted. This applies to the Agora Web SDK only. + */ + ERR_CONNECTION_INTERRUPTED = 111, // only used in web sdk + /** 112: The internet connection is lost. This applies to the Agora Web SDK only. + */ + ERR_CONNECTION_LOST = 112, // only used in web sdk + /** 113: The user is not in the channel when calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" or \ref agora::rtc::IRtcEngine::getUserInfoByUserAccount "getUserInfoByUserAccount" method. + */ + ERR_NOT_IN_CHANNEL = 113, + /** 114: The size of the sent data is over 1024 bytes when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + */ + ERR_SIZE_TOO_LARGE = 114, + /** 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + */ + ERR_BITRATE_LIMIT = 115, + /** 116: Too many data streams (over 5 streams) are created when the user calls the \ref agora::rtc::IRtcEngine::createDataStream "createDataStream" method. + */ + ERR_TOO_MANY_DATA_STREAMS = 116, + /** 117: The data stream transmission timed out. + */ + ERR_STREAM_MESSAGE_TIMEOUT = 117, + /** 119: Switching roles fail. Please try to rejoin the channel. + */ + ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119, + /** 120: Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel. + */ + ERR_DECRYPTION_FAILED = 120, + /** 123: The client is banned by the server. + */ + ERR_CLIENT_IS_BANNED_BY_SERVER = 123, + /** 124: Incorrect watermark file parameter. + */ + ERR_WATERMARK_PARAM = 124, + /** 125: Incorrect watermark file path. + */ + ERR_WATERMARK_PATH = 125, + /** 126: Incorrect watermark file format. + */ + ERR_WATERMARK_PNG = 126, + /** 127: Incorrect watermark file information. + */ + ERR_WATERMARKR_INFO = 127, + /** 128: Incorrect watermark file data format. + */ + ERR_WATERMARK_ARGB = 128, + /** 129: An error occurs in reading the watermark file. + */ + ERR_WATERMARK_READ = 129, + /** 130: Encryption is enabled when the user calls the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method (CDN live streaming does not support encrypted streams). + */ + ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130, + /** 134: The user account is invalid. */ + ERR_INVALID_USER_ACCOUNT = 134, + + /** 151: CDN related errors. Remove the original URL address and add a new one by calling the \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods. + */ + ERR_PUBLISH_STREAM_CDN_ERROR = 151, + /** 152: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. + */ + ERR_PUBLISH_STREAM_NUM_REACH_LIMIT = 152, + /** 153: The host manipulates other hosts' URLs. Check your app logic. + */ + ERR_PUBLISH_STREAM_NOT_AUTHORIZED = 153, + /** 154: An error occurs in Agora's streaming server. Call the addPublishStreamUrl method to publish the streaming again. + */ + ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR = 154, + /** 155: The server fails to find the stream. + */ + ERR_PUBLISH_STREAM_NOT_FOUND = 155, + /** 156: The format of the RTMP stream URL is not supported. Check whether the URL format is correct. + */ + ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED = 156, + + //signaling: 400~600 + /** + */ + ERR_LOGOUT_OTHER = 400, // + /** 401: The user logged out. + */ + ERR_LOGOUT_USER = 401, // logout by user + /** 402: Network failure. + */ + ERR_LOGOUT_NET = 402, // network failure + /** 403: Logged in another device. + */ + ERR_LOGOUT_KICKED = 403, // login in other device + /** + */ + ERR_LOGOUT_PACKET = 404, // + /** 405: The token expired. + */ + ERR_LOGOUT_TOKEN_EXPIRED = 405, // token expired + /** + */ + ERR_LOGOUT_OLDVERSION = 406, // + /** + */ + ERR_LOGOUT_TOKEN_WRONG = 407, + /** + */ + ERR_LOGOUT_ALREADY_LOGOUT = 408, + /** + */ + ERR_LOGIN_OTHER = 420, + /** + */ + ERR_LOGIN_NET = 421, + /** + */ + ERR_LOGIN_FAILED = 422, + /** + */ + ERR_LOGIN_CANCELED = 423, + /** + */ + ERR_LOGIN_TOKEN_EXPIRED = 424, + /** + */ + ERR_LOGIN_OLD_VERSION = 425, + /** + */ + ERR_LOGIN_TOKEN_WRONG = 426, + /** + */ + ERR_LOGIN_TOKEN_KICKED = 427, + /** + */ + ERR_LOGIN_ALREADY_LOGIN = 428, + /** + */ + ERR_JOIN_CHANNEL_OTHER = 440, + /** + */ + ERR_SEND_MESSAGE_OTHER = 440, + /** + */ + ERR_SEND_MESSAGE_TIMEOUT = 441, + /** + */ + ERR_QUERY_USERNUM_OTHER = 450, + /** + */ + ERR_QUERY_USERNUM_TIMEOUT = 451, + /** + */ + ERR_QUERY_USERNUM_BYUSER = 452, + /** + */ + ERR_LEAVE_CHANNEL_OTHER = 460, + /** + */ + ERR_LEAVE_CHANNEL_KICKED = 461, + /** + */ + ERR_LEAVE_CHANNEL_BYUSER = 462, + /** + */ + ERR_LEAVE_CHANNEL_LOGOUT = 463, + /** + */ + ERR_LEAVE_CHANNEL_DISCONNECTED = 464, + /** + */ + ERR_INVITE_OTHER = 470, + /** + */ + ERR_INVITE_REINVITE = 471, + /** + */ + ERR_INVITE_NET = 472, + /** + */ + ERR_INVITE_PEER_OFFLINE = 473, + ERR_INVITE_TIMEOUT = 474, + ERR_INVITE_CANT_RECV = 475, + + + //1001~2000 + /** 1001: Fails to load the media engine. + */ + ERR_LOAD_MEDIA_ENGINE = 1001, + /** 1002: Fails to start the call after enabling the media engine. + */ + ERR_START_CALL = 1002, + /** **DEPRECATED** 1003: Fails to start the camera. + + Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE(4) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + */ + ERR_START_CAMERA = 1003, + /** 1004: Fails to start the video rendering module. + */ + ERR_START_VIDEO_RENDER = 1004, + /** 1005: A general error occurs in the Audio Device Module (no specified reason). Check if the audio device is used by another application, or try rejoining the channel. + */ + ERR_ADM_GENERAL_ERROR = 1005, + /** 1006: Audio Device Module: An error occurs in using the Java resources. + */ + ERR_ADM_JAVA_RESOURCE = 1006, + /** 1007: Audio Device Module: An error occurs in setting the sampling frequency. + */ + ERR_ADM_SAMPLE_RATE = 1007, + /** 1008: Audio Device Module: An error occurs in initializing the playback device. + */ + ERR_ADM_INIT_PLAYOUT = 1008, + /** 1009: Audio Device Module: An error occurs in starting the playback device. + */ + ERR_ADM_START_PLAYOUT = 1009, + /** 1010: Audio Device Module: An error occurs in stopping the playback device. + */ + ERR_ADM_STOP_PLAYOUT = 1010, + /** 1011: Audio Device Module: An error occurs in initializing the recording device. + */ + ERR_ADM_INIT_RECORDING = 1011, + /** 1012: Audio Device Module: An error occurs in starting the recording device. + */ + ERR_ADM_START_RECORDING = 1012, + /** 1013: Audio Device Module: An error occurs in stopping the recording device. + */ + ERR_ADM_STOP_RECORDING = 1013, + /** 1015: Audio Device Module: A playback error occurs. Check your playback device and try rejoining the channel. + */ + ERR_ADM_RUNTIME_PLAYOUT_ERROR = 1015, + /** 1017: Audio Device Module: A recording error occurs. + */ + ERR_ADM_RUNTIME_RECORDING_ERROR = 1017, + /** 1018: Audio Device Module: Fails to record. + */ + ERR_ADM_RECORD_AUDIO_FAILED = 1018, + /** 1022: Audio Device Module: An error occurs in initializing the + * loopback device. + */ + ERR_ADM_INIT_LOOPBACK = 1022, + /** 1023: Audio Device Module: An error occurs in starting the loopback + * device. + */ + ERR_ADM_START_LOOPBACK = 1023, + /** 1027: Audio Device Module: No recording permission exists. Check if the + * recording permission is granted. + */ + ERR_ADM_NO_PERMISSION = 1027, + /** 1033: Audio device module: The device is occupied. + */ + ERR_ADM_RECORD_AUDIO_IS_ACTIVE = 1033, + /** 1101: Audio device module: A fatal exception occurs. + */ + ERR_ADM_ANDROID_JNI_JAVA_RESOURCE = 1101, + /** 1108: Audio device module: The recording frequency is lower than 50. + * 0 indicates that the recording is not yet started. We recommend + * checking your recording permission. + */ + ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY = 1108, + /** 1109: The playback frequency is lower than 50. 0 indicates that the + * playback is not yet started. We recommend checking if you have created + * too many AudioTrack instances. + */ + ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY = 1109, + /** 1111: Audio device module: AudioRecord fails to start up. A ROM system + * error occurs. We recommend the following options to debug: + * - Restart your App. + * - Restart your cellphone. + * - Check your recording permission. + */ + ERR_ADM_ANDROID_JNI_JAVA_START_RECORD = 1111, + /** 1112: Audio device module: AudioTrack fails to start up. A ROM system + * error occurs. We recommend the following options to debug: + * - Restart your App. + * - Restart your cellphone. + * - Check your playback permission. + */ + ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK = 1112, + /** 1115: Audio device module: AudioRecord returns error. The SDK will + * automatically restart AudioRecord. */ + ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR = 1115, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE = 1151, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER = 1153, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD = 1156, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER = 1157, + /** **DEPRECATED** */ + ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD = 1160, + /** 1201: Audio device module: The current device does not support audio + * input, possibly because you have mistakenly configured the audio session + * category, or because some other app is occupying the input device. We + * recommend terminating all background apps and re-joining the channel. */ + ERR_ADM_IOS_INPUT_NOT_AVAILABLE = 1201, + /** 1206: Audio device module: Cannot activate the Audio Session.*/ + ERR_ADM_IOS_ACTIVATE_SESSION_FAIL = 1206, + /** 1210: Audio device module: Fails to initialize the audio device, + * normally because the audio device parameters are wrongly set.*/ + ERR_ADM_IOS_VPIO_INIT_FAIL = 1210, + /** 1213: Audio device module: Fails to re-initialize the audio device, + * normally because the audio device parameters are wrongly set.*/ + ERR_ADM_IOS_VPIO_REINIT_FAIL = 1213, + /** 1214: Fails to re-start up the Audio Unit, possibly because the audio + * session category is not compatible with the settings of the Audio Unit. + */ + ERR_ADM_IOS_VPIO_RESTART_FAIL = 1214, + ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL = 1219, + /** **DEPRECATED** */ + ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO = 1221, + /** 1301: Audio device module: An audio driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system.*/ + ERR_ADM_WIN_CORE_INIT = 1301, + /** 1303: Audio device module: A recording driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system. */ + ERR_ADM_WIN_CORE_INIT_RECORDING = 1303, + /** 1306: Audio device module: A playout driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system. */ + ERR_ADM_WIN_CORE_INIT_PLAYOUT = 1306, + /** 1307: Audio device module: No audio device is available. Solutions: + * Plug in a proper audio device. */ + ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL = 1307, + /** 1309: Audio device module: An audio driver abnomality or a + * compatibility issue occurs. Solutions: Disable and restart the audio + * device, or reboot the system. */ + ERR_ADM_WIN_CORE_START_RECORDING = 1309, + /** 1311: Audio device module: Insufficient system memory or poor device + * performance. Solutions: Reboot the system or replace the device. + */ + ERR_ADM_WIN_CORE_CREATE_REC_THREAD = 1311, + /** 1314: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver.*/ + ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP = 1314, + /** 1319: Audio device module: Insufficient system memory or poor device + * performance. Solutions: Reboot the system or replace the device. */ + ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD = 1319, + /** 1320: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Replace the device. */ + ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP = 1320, + /** 1322: Audio device module: No audio sampling device is available. + * Solutions: Plug in a proper recording device. */ + ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, + /** 1323: Audio device module: No audio playout device is available. + * Solutions: Plug in a proper playback device.*/ + ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, + /** 1351: Audio device module: An audio driver abnormality or a + * compatibility issue occurs. Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT = 1351, + /** 1353: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_RECORDING = 1353, + /** 1354: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_MICROPHONE = 1354, + /** 1355: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_PLAYOUT = 1355, + /** 1356: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_INIT_SPEAKER = 1356, + /** 1357: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver. */ + ERR_ADM_WIN_WAVE_START_RECORDING = 1357, + /** 1358: Audio device module: An audio driver abnormality occurs. + * Solutions: + * - Disable and then re-enable the audio device. + * - Reboot the system. + * - Upgrade your audio card driver.*/ + ERR_ADM_WIN_WAVE_START_PLAYOUT = 1358, + /** 1359: Audio Device Module: No recording device exists. + */ + ERR_ADM_NO_RECORDING_DEVICE = 1359, + /** 1360: Audio Device Module: No playback device exists. + */ + ERR_ADM_NO_PLAYOUT_DEVICE = 1360, + + // VDM error code starts from 1500 + /** 1501: Video Device Module: The camera is unauthorized. + */ + ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501, + + // VDM error code starts from 1500 + /** **DEPRECATED** 1502: Video Device Module: The camera in use. + + Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY(3) in the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead. + */ + ERR_VDM_WIN_DEVICE_IN_USE = 1502, + + // VCM error code starts from 1600 + /** 1600: Video Device Module: An unknown error occurs. + */ + ERR_VCM_UNKNOWN_ERROR = 1600, + /** 1601: Video Device Module: An error occurs in initializing the video encoder. + */ + ERR_VCM_ENCODER_INIT_ERROR = 1601, + /** 1602: Video Device Module: An error occurs in encoding. + */ + ERR_VCM_ENCODER_ENCODE_ERROR = 1602, + /** 1603: Video Device Module: An error occurs in setting the video encoder. + */ + ERR_VCM_ENCODER_SET_ERROR = 1603, +}; + + /** Output log filter level. */ +enum LOG_FILTER_TYPE +{ +/** 0: Do not output any log information. */ + LOG_FILTER_OFF = 0, + /** 0x080f: Output all log information. + Set your log filter as debug if you want to get the most complete log file. */ + LOG_FILTER_DEBUG = 0x080f, + /** 0x000f: Output CRITICAL, ERROR, WARNING, and INFO level log information. + We recommend setting your log filter as this level. + */ + LOG_FILTER_INFO = 0x000f, + /** 0x000e: Outputs CRITICAL, ERROR, and WARNING level log information. + */ + LOG_FILTER_WARN = 0x000e, + /** 0x000c: Outputs CRITICAL and ERROR level log information. */ + LOG_FILTER_ERROR = 0x000c, + /** 0x0008: Outputs CRITICAL level log information. */ + LOG_FILTER_CRITICAL = 0x0008, + LOG_FILTER_MASK = 0x80f, +}; +} // namespace agora + +#endif diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraMediaEngine.h b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraMediaEngine.h new file mode 100755 index 000000000..5b0b7a531 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraMediaEngine.h @@ -0,0 +1,227 @@ +#ifndef AGORA_MEDIA_ENGINE_H +#define AGORA_MEDIA_ENGINE_H +#if defined _WIN32 || defined __CYGWIN__ +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +namespace agora +{ +namespace media +{ + +enum MEDIA_SOURCE_TYPE { + AUDIO_PLAYOUT_SOURCE = 0, + AUDIO_RECORDING_SOURCE = 1, +}; + +class IAudioFrameObserver +{ +public: + enum AUDIO_FRAME_TYPE { + FRAME_TYPE_PCM16 = 0, //PCM 16bit little endian + }; + struct AudioFrame { + AUDIO_FRAME_TYPE type; + int samples; //number of samples in this frame + int bytesPerSample; //number of bytes per sample: 2 for PCM16 + int channels; //number of channels (data are interleaved if stereo) + int samplesPerSec; //sampling rate + void* buffer; //data buffer + int64_t renderTimeMs; + int avsync_type; + }; +public: + virtual bool onRecordAudioFrame(AudioFrame& audioFrame) = 0; + virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) = 0; + virtual bool onMixedAudioFrame(AudioFrame& audioFrame) = 0; + virtual bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, AudioFrame& audioFrame) = 0; +}; + +class IVideoFrameObserver +{ +public: + enum VIDEO_FRAME_TYPE { + FRAME_TYPE_YUV420 = 0, //YUV 420 format + FRAME_TYPE_YUV422 = 1, //YUV 422P format + FRAME_TYPE_RGBA = 2, //RGBA + }; + struct VideoFrame { + VIDEO_FRAME_TYPE type; + int width; //width of video frame + int height; //height of video frame + int yStride; //stride of Y data buffer + int uStride; //stride of U data buffer + int vStride; //stride of V data buffer + void* yBuffer; //Y data buffer + void* uBuffer; //U data buffer + void* vBuffer; //V data buffer + int rotation; // rotation of this frame (0, 90, 180, 270) + int64_t renderTimeMs; + int avsync_type; + }; +public: + virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) = 0; + virtual bool onPreEncodeVideoFrame(VideoFrame& videoFrame) { return true; } + virtual bool onRenderVideoFrame(unsigned int uid, VideoFrame& videoFrame) = 0; + virtual VIDEO_FRAME_TYPE getVideoFormatPreference() { return FRAME_TYPE_YUV420; } + virtual bool getRotationApplied() { return false; } + virtual bool getMirrorApplied() { return false; } + virtual bool getSmoothRenderingEnabled(){ return false; } +}; + +class IVideoFrame +{ +public: + enum PLANE_TYPE { + Y_PLANE = 0, + U_PLANE = 1, + V_PLANE = 2, + NUM_OF_PLANES = 3 + }; + enum VIDEO_TYPE { + VIDEO_TYPE_UNKNOWN = 0, + VIDEO_TYPE_I420 = 1, + VIDEO_TYPE_IYUV = 2, + VIDEO_TYPE_RGB24 = 3, + VIDEO_TYPE_ABGR = 4, + VIDEO_TYPE_ARGB = 5, + VIDEO_TYPE_ARGB4444 = 6, + VIDEO_TYPE_RGB565 = 7, + VIDEO_TYPE_ARGB1555 = 8, + VIDEO_TYPE_YUY2 = 9, + VIDEO_TYPE_YV12 = 10, + VIDEO_TYPE_UYVY = 11, + VIDEO_TYPE_MJPG = 12, + VIDEO_TYPE_NV21 = 13, + VIDEO_TYPE_NV12 = 14, + VIDEO_TYPE_BGRA = 15, + VIDEO_TYPE_RGBA = 16, + VIDEO_TYPE_I422 = 17, + }; + virtual void release() = 0; + virtual const unsigned char* buffer(PLANE_TYPE type) const = 0; + + // Copy frame: If required size is bigger than allocated one, new buffers of + // adequate size will be allocated. + // Return value: 0 on success ,-1 on error. + virtual int copyFrame(IVideoFrame** dest_frame) const = 0; + + // Convert frame + // Input: + // - src_frame : Reference to a source frame. + // - dst_video_type : Type of output video. + // - dst_sample_size : Required only for the parsing of MJPG. + // - dst_frame : Pointer to a destination frame. + // Return value: 0 if OK, < 0 otherwise. + // It is assumed that source and destination have equal height. + virtual int convertFrame(VIDEO_TYPE dst_video_type, int dst_sample_size, unsigned char* dst_frame) const = 0; + + // Get allocated size per plane. + virtual int allocated_size(PLANE_TYPE type) const = 0; + + // Get allocated stride per plane. + virtual int stride(PLANE_TYPE type) const = 0; + + // Get frame width. + virtual int width() const = 0; + + // Get frame height. + virtual int height() const = 0; + + // Get frame timestamp (90kHz). + virtual unsigned int timestamp() const = 0; + + // Get render time in milliseconds. + virtual int64_t render_time_ms() const = 0; + + // Return true if underlying plane buffers are of zero size, false if not. + virtual bool IsZeroSize() const = 0; + + virtual VIDEO_TYPE GetVideoType() const = 0; +}; + +class IExternalVideoRenderCallback +{ +public: + virtual void onViewSizeChanged(int width, int height) = 0; + virtual void onViewDestroyed() = 0; +}; + +struct ExternalVideoRenerContext +{ + IExternalVideoRenderCallback* renderCallback; + void* view; + int renderMode; + int zOrder; + float left; + float top; + float right; + float bottom; +}; + +class IExternalVideoRender +{ +public: + virtual void release() = 0; + virtual int initialize() = 0; + virtual int deliverFrame(const IVideoFrame& videoFrame, int rotation, bool mirrored) = 0; +}; + +class IExternalVideoRenderFactory +{ +public: + virtual IExternalVideoRender* createRenderInstance(const ExternalVideoRenerContext& context) = 0; +}; + +struct ExternalVideoFrame +{ + enum VIDEO_BUFFER_TYPE + { + VIDEO_BUFFER_RAW_DATA = 1, + }; + + enum VIDEO_PIXEL_FORMAT + { + VIDEO_PIXEL_UNKNOWN = 0, + VIDEO_PIXEL_I420 = 1, + VIDEO_PIXEL_BGRA = 2, + + VIDEO_PIXEL_NV12 = 8, + VIDEO_PIXEL_I422 = 16, + }; + + VIDEO_BUFFER_TYPE type; + VIDEO_PIXEL_FORMAT format; + void* buffer; + int stride; + int height; + int cropLeft; + int cropTop; + int cropRight; + int cropBottom; + int rotation; + long long timestamp; +}; + +class IMediaEngine { +public: + virtual void release() = 0; + virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0; + virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0; + virtual int registerVideoRenderFactory(IExternalVideoRenderFactory* factory) = 0; + virtual int pushAudioFrame(MEDIA_SOURCE_TYPE type, IAudioFrameObserver::AudioFrame *frame, bool wrap) = 0; + virtual int pushAudioFrame(IAudioFrameObserver::AudioFrame *frame) = 0; + virtual int pullAudioFrame(IAudioFrameObserver::AudioFrame *frame) = 0; + + virtual int setExternalVideoSource(bool enable, bool useTexture) = 0; + virtual int pushVideoFrame(ExternalVideoFrame *frame) = 0; +}; + +} //media + +} //agora + +#endif //AGORA_MEDIA_ENGINE_H diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcChannel.h b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcChannel.h new file mode 100755 index 000000000..b19c71c86 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcChannel.h @@ -0,0 +1,1203 @@ +// +// AgoraRtcEngine SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +#ifndef IAgoraRtcChannel_h +#define IAgoraRtcChannel_h +#include "IAgoraRtcEngine.h" + +namespace agora { +namespace rtc { +/** The channel media options. */ +struct ChannelMediaOptions { + /** Determines whether to subscribe to audio streams when the user joins the channel: + - true: (Default) Subscribe. + - false: Do not subscribe. + + This member serves a similar function to the \ref agora::rtc::IChannel::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method. After joining the channel, + you can call the `muteAllRemoteAudioStreams` method to set whether to subscribe to audio streams in the channel. + */ + bool autoSubscribeAudio; + /** Determines whether to subscribe to video streams when the user joins the channel: + - true: (Default) Subscribe. + - false: Do not subscribe. + + This member serves a similar function to the \ref agora::rtc::IChannel::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method. After joining the channel, + you can call the `muteAllRemoteVideoStreams` method to set whether to subscribe to video streams in the channel. + */ + bool autoSubscribeVideo; + ChannelMediaOptions() + : autoSubscribeAudio(true) + , autoSubscribeVideo(true) + {} +}; +/** The IChannel class. */ +class IChannel; +/** The IChannelEventHandler class. */ +class IChannelEventHandler +{ +public: + virtual ~IChannelEventHandler() {} + /** Reports the warning code of `IChannel`. + + @param rtcChannel IChannel + @param warn The warning code: #WARN_CODE_TYPE + @param msg The warning message. + + */ + virtual void onChannelWarning(IChannel *rtcChannel, int warn, const char* msg) { + (void)rtcChannel; + (void)warn; + (void)msg; + } + /** Reports the error code of `IChannel`. + + @param rtcChannel IChannel + @param err The error code: #ERROR_CODE_TYPE + @param msg The error message. + */ + virtual void onChannelError(IChannel *rtcChannel, int err, const char* msg) { + (void)rtcChannel; + (void)err; + (void)msg; + } + /** Occurs when a user joins a channel. + + This callback notifies the application that a user joins a specified channel. + + @param rtcChannel IChannel + @param uid The user ID. If the `uid` is not specified in the \ref IChannel::joinChannel "joinChannel" method, the server automatically assigns a `uid`. + + @param elapsed Time elapsed (ms) from the local user calling \ref IChannel::joinChannel "joinChannel" until this callback is triggered. + */ + virtual void onJoinChannelSuccess(IChannel *rtcChannel, uid_t uid, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)elapsed; + } + /** Occurs when a user rejoins the channel after being disconnected due to network problems. + + @param rtcChannel IChannel + @param uid The user ID. + @param elapsed Time elapsed (ms) from the local user starting to reconnect until this callback is triggered. + + */ + virtual void onRejoinChannelSuccess(IChannel *rtcChannel, uid_t uid, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)elapsed; + } + /** Occurs when a user leaves the channel. + + This callback notifies the application that a user leaves the channel when the application calls the \ref agora::rtc::IChannel::leaveChannel "leaveChannel" method. + + The application retrieves information, such as the call duration and statistics. + + @param rtcChannel IChannel + @param stats The call statistics: RtcStats. + */ + virtual void onLeaveChannel(IChannel *rtcChannel, const RtcStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa. + + This callback notifies the application of a user role switch when the application calls the \ref IChannel::setClientRole "setClientRole" method. + + The SDK triggers this callback when the local user switches the user role by calling the \ref IChannel::setClientRole "setClientRole" method after joining the channel. + + @param rtcChannel IChannel + @param oldRole Role that the user switches from: #CLIENT_ROLE_TYPE. + @param newRole Role that the user switches to: #CLIENT_ROLE_TYPE. + */ + virtual void onClientRoleChanged(IChannel *rtcChannel, CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) { + (void)rtcChannel; + (void)oldRole; + (void)newRole; + } + /** Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel. + + - Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users. + - Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend limiting the number of hosts to 17. + + The SDK triggers this callback under one of the following circumstances: + - A remote user/host joins the channel by calling the \ref agora::rtc::IChannel::joinChannel "joinChannel" method. + - A remote user switches the user role to the host by calling the \ref agora::rtc::IChannel::setClientRole "setClientRole" method after joining the channel. + - A remote user/host rejoins the channel after a network interruption. + - The host injects an online media stream into the channel by calling the \ref agora::rtc::IChannel::addInjectStreamUrl "addInjectStreamUrl" method. + + @note In the Live-broadcast profile: + - The host receives this callback when another host joins the channel. + - The audience in the channel receives this callback when a new host joins the channel. + - When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams. + + @param rtcChannel IChannel + @param uid User ID of the user or host joining the channel. + @param elapsed Time delay (ms) from the local user calling the \ref IChannel::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onUserJoined(IChannel *rtcChannel, uid_t uid, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)elapsed; + } + /** Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + + Reasons why the user is offline: + + - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel. + - Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using a signaling system for more reliable offline detection. + + @param rtcChannel IChannel + @param uid User ID of the user leaving the channel or going offline. + @param reason Reason why the user is offline: #USER_OFFLINE_REASON_TYPE. + */ + virtual void onUserOffline(IChannel *rtcChannel, uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + (void)rtcChannel; + (void)uid; + (void)reason; + } + /** Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. + + The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the \ref IChannel::joinChannel "joinChannel" method, whether or not it is in the channel. + + This callback is different from \ref agora::rtc::IChannelEventHandler::onConnectionInterrupted "onConnectionInterrupted": + + - The SDK triggers the \ref agora::rtc::IChannelEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. + - The SDK triggers the \ref agora::rtc::IChannelEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. + + If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. + + @param rtcChannel IChannel + */ + virtual void onConnectionLost(IChannel *rtcChannel) { + (void)rtcChannel; + } + /** Occurs when the token expires. + + After a token is specified by calling the \ref IChannel::joinChannel "joinChannel" method, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server. + + This callback notifies the application to generate a new token. Call the \ref IChannel::renewToken "renewToken" method to renew the token. + + @param rtcChannel IChannel + */ + virtual void onRequestToken(IChannel *rtcChannel) { + (void)rtcChannel; + } + /** Occurs when the token expires in 30 seconds. + + The user becomes offline if the token used in the \ref IChannel::joinChannel "joinChannel" method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the \ref IChannel::renewToken "renewToken" method to pass the new token to the SDK. + + @param rtcChannel IChannel + @param token Token that expires in 30 seconds. + */ + virtual void onTokenPrivilegeWillExpire(IChannel *rtcChannel, const char* token) { + (void)rtcChannel; + (void)token; + } + /** Reports the statistics of the current call. + + The SDK triggers this callback once every two seconds after the user joins the channel. + + @param rtcChannel IChannel + @param stats Statistics of the RtcEngine: RtcStats. + */ + virtual void onRtcStats(IChannel *rtcChannel, const RtcStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Reports the last mile network quality of each user in the channel once every two seconds. + + Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times. + + @param rtcChannel IChannel + @param uid User ID. The network quality of the user with this @p uid is reported. If @p uid is 0, the local network quality is reported. + @param txQuality Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. @p txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the Live-broadcast profile, but may be inadequate for resolutions higher than 1280 × 720. See #QUALITY_TYPE. + @param rxQuality Downlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE. + */ + virtual void onNetworkQuality(IChannel *rtcChannel, uid_t uid, int txQuality, int rxQuality) { + (void)rtcChannel; + (void)uid; + (void)txQuality; + (void)rxQuality; + } + /** Reports the statistics of the video stream from each remote user/host. + * + * The SDK triggers this callback once every two seconds for each remote + * user/host. If a channel includes multiple remote users, the SDK + * triggers this callback as many times. + * + * @param rtcChannel IChannel + * @param stats Statistics of the remote video stream. See + * RemoteVideoStats. + */ + virtual void onRemoteVideoStats(IChannel *rtcChannel, const RemoteVideoStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Reports the statistics of the audio stream from each remote user/host. + + This callback replaces the \ref agora::rtc::IChannelEventHandler::onAudioQuality "onAudioQuality" callback. + + The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. + + @param rtcChannel IChannel + @param stats The statistics of the received remote audio streams. See RemoteAudioStats. + */ + virtual void onRemoteAudioStats(IChannel *rtcChannel, const RemoteAudioStats& stats) { + (void)rtcChannel; + (void)stats; + } + /** Occurs when the remote audio state changes. + * + * This callback indicates the state change of the remote audio stream. + * + * @param rtcChannel IChannel + * @param uid ID of the remote user whose audio state changes. + * @param state State of the remote audio. See #REMOTE_AUDIO_STATE. + * @param reason The reason of the remote audio state change. + * See #REMOTE_AUDIO_STATE_REASON. + * @param elapsed Time elapsed (ms) from the local user calling the + * \ref IChannel::joinChannel "joinChannel" method until the SDK + * triggers this callback. + */ + virtual void onRemoteAudioStateChanged(IChannel *rtcChannel, uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + /** Reports which user is the loudest speaker. + + If the user enables the audio volume indication by calling the \ref IChannel::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method, this callback returns the @p uid of the active speaker detected by the audio volume detection module of the SDK. + + @note + - To receive this callback, you need to call the \ref IChannel::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. + - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. + + @param rtcChannel IChannel + @param uid User ID of the active speaker. A @p uid of 0 represents the local user. + */ + virtual void onActiveSpeaker(IChannel *rtcChannel, uid_t uid) { + (void)rtcChannel; + (void)uid; + } + /** Occurs when the video size or rotation of a specified user changes. + + @param rtcChannel IChannel + @param uid User ID of the remote user or local user (0) whose video size or rotation changes. + @param width New width (pixels) of the video. + @param height New height (pixels) of the video. + @param rotation New rotation of the video [0 to 360). + */ + virtual void onVideoSizeChanged(IChannel *rtcChannel, uid_t uid, int width, int height, int rotation) { + (void)rtcChannel; + (void)uid; + (void)width; + (void)height; + (void)rotation; + } + /** Occurs when the remote video state changes. + * + * @param rtcChannel IChannel + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video. See #REMOTE_VIDEO_STATE. + * @param reason The reason of the remote video state change. See + * #REMOTE_VIDEO_STATE_REASON. + * @param elapsed Time elapsed (ms) from the local user calling the + * \ref agora::rtc::IChannel::joinChannel "joinChannel" method until the + * SDK triggers this callback. + */ + virtual void onRemoteVideoStateChanged(IChannel *rtcChannel, uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) { + (void)rtcChannel; + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + /** Occurs when the local user receives the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method. + + @param rtcChannel IChannel + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param data The data received by the local user. + @param length Length of the data in bytes. + */ + virtual void onStreamMessage(IChannel *rtcChannel, uid_t uid, int streamId, const char* data, size_t length) { + (void)rtcChannel; + (void)uid; + (void)streamId; + (void)data; + (void)length; + } + /** Occurs when the local user does not receive the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method. + + @param rtcChannel IChannel + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param code Error code: #ERROR_CODE_TYPE. + @param missed Number of lost messages. + @param cached Number of incoming cached messages when the data stream is interrupted. + */ + virtual void onStreamMessageError(IChannel *rtcChannel, uid_t uid, int streamId, int code, int missed, int cached) { + (void)rtcChannel; + (void)uid; + (void)streamId; + (void)code; + (void)missed; + (void)cached; + } + /** Occurs when the state of the media stream relay changes. + * + * The SDK returns the state of the current media relay with any error + * message. + * @param rtcChannel IChannel + * @param state The state code in #CHANNEL_MEDIA_RELAY_STATE. + * @param code The error code in #CHANNEL_MEDIA_RELAY_ERROR. + */ + virtual void onChannelMediaRelayStateChanged(IChannel *rtcChannel, CHANNEL_MEDIA_RELAY_STATE state,CHANNEL_MEDIA_RELAY_ERROR code) { + (void)rtcChannel; + (void)state; + (void)code; + } + /** Reports events during the media stream relay. + * @param rtcChannel IChannel + * @param code The event code in #CHANNEL_MEDIA_RELAY_EVENT. + */ + virtual void onChannelMediaRelayEvent(IChannel *rtcChannel, CHANNEL_MEDIA_RELAY_EVENT code) { + (void)rtcChannel; + (void)code; + } + /** + Occurs when the state of the RTMP streaming changes. + + The SDK triggers this callback to report the result of the local user calling the \ref agora::rtc::IChannel::addPublishStreamUrl "addPublishStreamUrl" or \ref agora::rtc::IChannel::removePublishStreamUrl "removePublishStreamUrl" method. + + This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the *errCode* parameter. + + @param rtcChannel IChannel + @param url The RTMP URL address. + @param state The RTMP streaming state. See: #RTMP_STREAM_PUBLISH_STATE. + @param errCode The detailed error information for streaming. See: #RTMP_STREAM_PUBLISH_ERROR. + */ + virtual void onRtmpStreamingStateChanged(IChannel *rtcChannel, const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { + (void)rtcChannel; + (void) url; + (RTMP_STREAM_PUBLISH_STATE) state; + (RTMP_STREAM_PUBLISH_ERROR) errCode; + } + /** Occurs when the publisher's transcoding is updated. + + When the `LiveTranscoding` class in the \ref agora::rtc::IChannel::setLiveTranscoding "setLiveTranscoding" method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information to the local host. + + @note If you call the `setLiveTranscoding` method to set the LiveTranscoding class for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + + @param rtcChannel IChannel + */ + virtual void onTranscodingUpdated(IChannel *rtcChannel) { + (void)rtcChannel; + } + /** Occurs when a voice or video stream URL address is added to a live broadcast. + + @param rtcChannel IChannel + @param url The URL address of the externally injected stream. + @param uid User ID. + @param status State of the externally injected stream: #INJECT_STREAM_STATUS. + */ + virtual void onStreamInjectedStatus(IChannel *rtcChannel, const char* url, uid_t uid, int status) { + (void)rtcChannel; + (void)url; + (void)uid; + (void)status; + } + /** Occurs when the remote media stream falls back to audio-only stream + * due to poor network conditions or switches back to the video stream + * after the network conditions improve. + * + * If you call + * \ref IChannel::setRemoteSubscribeFallbackOption + * "setRemoteSubscribeFallbackOption" and set + * @p option as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this + * callback when the remote media stream falls back to audio-only mode due + * to poor uplink conditions, or when the remote media stream switches + * back to the video after the uplink network condition improves. + * + * @note Once the remote media stream switches to the low stream due to + * poor network conditions, you can monitor the stream switch between a + * high and low stream in the RemoteVideoStats callback. + * @param rtcChannel IChannel + * @param uid ID of the remote user sending the stream. + * @param isFallbackOrRecover Whether the remotely subscribed media stream + * falls back to audio-only or switches back to the video: + * - true: The remotely subscribed media stream falls back to audio-only + * due to poor network conditions. + * - false: The remotely subscribed media stream switches back to the + * video stream after the network conditions improved. + */ + virtual void onRemoteSubscribeFallbackToAudioOnly(IChannel *rtcChannel, uid_t uid, bool isFallbackOrRecover) { + (void)rtcChannel; + (void)uid; + (void)isFallbackOrRecover; + } + /** Occurs when the connection state between the SDK and the server changes. + + @param rtcChannel IChannel + @param state See #CONNECTION_STATE_TYPE. + @param reason See #CONNECTION_CHANGED_REASON_TYPE. + */ + virtual void onConnectionStateChanged(IChannel *rtcChannel, + CONNECTION_STATE_TYPE state, + CONNECTION_CHANGED_REASON_TYPE reason) { + (void)rtcChannel; + (void)state; + (void)reason; + } +}; + +/** The IChannel class. */ +class IChannel +{ +public: + virtual ~IChannel() {} + /** Releases all IChannel resources. + + @return + - 0: Success. + - < 0: Failure. + - `ERR_NOT_INITIALIZED (7)`: The SDK is not initialized before calling this method. + */ + virtual int release() = 0; + /** Sets the channel event handler. + + After setting the channel event handler, you can listen for channel events and receive the statistics of the corresponding `IChannel` object. + + @param channelEh The event handler of the `IChannel` object. For details, see IChannelEventHandler. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setChannelEventHandler(IChannelEventHandler *channelEh) = 0; + /** Joins the channel with a user ID. + + This method differs from the `joinChannel` method in the `IRtcEngine` class in the following aspects: + + | IChannel::joinChannel | IRtcEngine::joinChannel | + |------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| + | Does not contain the `channelId` parameter, because `channelId` is specified when creating the `IChannel` object. | Contains the `channelId` parameter, which specifies the channel to join. | + | Contains the `options` parameter, which decides whether to subscribe to all streams before joining the channel. | Does not contain the `options` parameter. By default, users subscribe to all streams when joining the channel. | + | Users can join multiple channels simultaneously by creating multiple `IChannel` objects and calling the `joinChannel` method of each object. | Users can join only one channel. | + | By default, the SDK does not publish any stream after the user joins the channel. You need to call the publish method to do that. | By default, the SDK publishes streams once the user joins the channel. | + + @note + - If you are already in a channel, you cannot rejoin it with the same `uid`. + - We recommend using different UIDs for different channels. + - If you want to join the same channel from different devices, ensure that the UIDs in all devices are different. + - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the `IChannel` object. + + @param token The token for authentication: + - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-temporary-token). + - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-token). + @param info (Optional) Additional information about the channel. This parameter can be set as null. Other users in the channel do not receive this information. + @param uid The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If `uid` is not assigned (or set as `0`), the SDK assigns a `uid` and reports it in the \ref agora::rtc::IChannelEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. The app must maintain this user ID. + @param options The channel media options: ChannelMediaOptions. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannel(const char* token, + const char* info, + uid_t uid, + const ChannelMediaOptions& options) = 0; + /** Joins the channel with a user account. + + After the user successfully joins the channel, the SDK triggers the following callbacks: + + - The local client: \ref agora::rtc::IChannelEventHandler::onLocalUserRegistered "onLocalUserRegistered" and \ref agora::rtc::IChannelEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" . + The remote client: \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" and \ref agora::rtc::IChannelEventHandler::onUserInfoUpdated "onUserInfoUpdated" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. + + @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. + If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + + @param token The token generated at your server: + - For low-security requirements: You can use the temporary token generated at Console. For details, see [Get a temporary toke](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-temporary-token). + - For high-security requirements: Set it as the token generated at your server. For details, see [Get a token](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-token). + @param channelId The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: + The 26 lowercase English letters: a to z. + - The 26 uppercase English letters: A to Z. + - The 10 numbers: 0 to 9. + - The space. + - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + - The 26 lowercase English letters: a to z. + - The 26 uppercase English letters: A to Z. + - The 10 numbers: 0 to 9. + - The space. + - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannelWithUserAccount(const char* token, + const char* userAccount, + const ChannelMediaOptions& options) = 0; + /** Allows a user to leave a channel, such as hanging up or exiting a call. + + After joining a channel, the user must call the *leaveChannel* method to end the call before joining another channel. + + This method returns 0 if the user leaves the channel and releases all resources related to the call. + + This method call is asynchronous, and the user has not left the channel when the method call returns. Once the user leaves the channel, the SDK triggers the \ref IChannelEventHandler::onLeaveChannel "onLeaveChannel" callback. + + A successful \ref agora::rtc::IChannel::leaveChannel "leaveChannel" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IChannelEventHandler::onLeaveChannel "onLeaveChannel" + - The remote client: \ref agora::rtc::IChannelEventHandler::onUserOffline "onUserOffline" , if the user leaving the channel is in the Communication channel, or is a BROADCASTER in the Live Broadcast profile. + + @note + - If you call the \ref IChannel::release "release" method immediately after the *leaveChannel* method, the *leaveChannel* process interrupts, and the \ref IChannelEventHandler::onLeaveChannel "onLeaveChannel" callback is not triggered. + - If you call the *leaveChannel* method during a CDN live streaming, the SDK triggers the \ref IChannel::removePublishStreamUrl "removePublishStreamUrl" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int leaveChannel() = 0; + + /** Publishes the local stream to the channel. + + You must keep the following restrictions in mind when calling this method. Otherwise, the SDK returns the #ERR_REFUSED (5): + - This method publishes one stream only to the channel corresponding to the current `IChannel` object. + - In a Live Broadcast channel, only a broadcaster can call this method. To switch the client role, call \ref agora::rtc::IChannel::setClientRole "setClientRole" of the current `IChannel` object. + - You can publish a stream to only one channel at a time. For details on joining multiple channels, see the advanced guide *Join Multiple Channels*. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_REFUSED (5): The method call is refused. + */ + virtual int publish() = 0; + + /** Stops publishing a stream to the channel. + + If you call this method in a channel where you are not publishing streams, the SDK returns #ERR_REFUSED (5). + + @return + - 0: Success. + - < 0: Failure. + - #ERR_REFUSED (5): The method call is refused. + */ + virtual int unpublish() = 0; + + /** Gets the channel ID of the current `IChannel` object. + + @return + - The channel ID of the current `IChannel` object, if the method call succeeds. + - The empty string "", if the method call fails. + */ + virtual const char *channelId() = 0; + /** Retrieves the current call ID. + + When a user joins a channel on a client, a `callId` is generated to identify the call from the client. + Feedback methods, such as \ref IChannel::rate "rate" and \ref IChannel::complain "complain", must be called after the call ends to submit feedback to the SDK. + + The \ref `rate` and `complain` methods require the `callId` parameter retrieved from the `getCallId` method during a call. `callId` is passed as an argument into the `rate` and `complain` methods after the call ends. + + @param callId The current call ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getCallId(agora::util::AString& callId) = 0; + /** Gets a new token when the current token expires after a period of time. + + The `token` expires after a period of time once the token schema is enabled when: + + - The SDK triggers the \ref IChannelEventHandler::onTokenPrivilegeWillExpire "onTokenPrivilegeWillExpire" callback, or + - The \ref IChannelEventHandler::onConnectionStateChanged "onConnectionStateChanged" reports CONNECTION_CHANGED_TOKEN_EXPIRED(9). + + The application should call this method to get the new `token`. Failure to do so will result in the SDK disconnecting from the server. + + @param token Pointer to the new token. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int renewToken(const char* token) = 0; + /** Enables built-in encryption with an encryption password before users join a channel. + + All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel. + + If an encryption password is not specified, the encryption functionality will be disabled. + + @note + - Do not use this method for CDN live streaming. + - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. + + @param secret Pointer to the encryption password. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionSecret(const char* secret) = 0; + /** Sets the built-in encryption mode. + + The Agora SDK supports built-in encryption, which is set to the `aes-128-xts` mode by default. Call this method to use other encryption modes. + + All users in the same channel must use the same encryption mode and password. + + Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. + + @note Call the \ref IChannel::setEncryptionSecret "setEncryptionSecret" method to enable the built-in encryption function before calling this method. + + @param encryptionMode The set encryption mode: + - "aes-128-xts": (Default) 128-bit AES encryption, XTS mode. + - "aes-128-ecb": 128-bit AES encryption, ECB mode. + - "aes-256-xts": 256-bit AES encryption, XTS mode. + - "": When encryptionMode is set as NULL, the encryption mode is set as "aes-128-xts" by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionMode(const char* encryptionMode) = 0; + /** Registers a packet observer. + + The Agora SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission. + + @note + - The size of the packet sent to the network after processing should not exceed 1200 bytes, otherwise, the packet may fail to be sent. + - Ensure that both receivers and senders call this method, otherwise, you may meet undefined behaviors such as no voice and black screen. + - When you use CDN live streaming, recording or storage functions, Agora doesn't recommend calling this method. + + @param observer The registered packet observer. See IPacketObserver. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerPacketObserver(IPacketObserver* observer) = 0; + /** Registers the metadata observer. + + Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the \ref agora::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback. + This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. + + @note + - Call this method before the joinChannel method. + - This method applies to the Live-broadcast channel profile. + + @param observer The IMetadataObserver class. See the definition of IMetadataObserver for details. + @param type See \ref IMetadataObserver::METADATA_TYPE "METADATA_TYPE". The SDK supports VIDEO_METADATA (0) only for now. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerMediaMetadataObserver(IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type) = 0; + /** Sets the role of the user, such as a host or an audience (default), before joining a channel in a live broadcast. + + This method can be used to switch the user role in a live broadcast after the user joins a channel. + + In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful \ref agora::rtc::IChannel::setClientRole "setClientRole" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IChannelEventHandler::onClientRoleChanged "onClientRoleChanged" + - The remote client: \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" or \ref agora::rtc::IChannelEventHandler::onUserOffline "onUserOffline" (BECOME_AUDIENCE) + + @note + This method applies only to the Live-broadcast profile. + + @param role Sets the role of the user. See #CLIENT_ROLE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setClientRole(CLIENT_ROLE_TYPE role) = 0; + /** Prioritizes a remote user's stream. + + Use this method with the \ref IChannel::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. + If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. + + @note The Agora SDK supports setting `serPriority` as high for one user only. + + @param uid The ID of the remote user. + @param userPriority Sets the priority of the remote user. See #PRIORITY_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteUserPriority(uid_t uid, PRIORITY_TYPE userPriority) = 0; + /** Sets the sound position and gain of a remote user. + + When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the + local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, + such as Battle Royale games. + + @note + - For this method to work, enable stereo panning for remote users by calling the \ref agora::rtc::IChannel::enableSoundPositionIndication "enableSoundPositionIndication" method before joining a channel. + - This method requires hardware support. For the best sound positioning, we recommend using a stereo speaker. + + @param uid The ID of the remote user. + @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: + - 0.0: the remote sound comes from the front. + - -1.0: the remote sound comes from the left. + - 1.0: the remote sound comes from the right. + @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). + The smaller the value, the less the gain. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVoicePosition(int uid, double pan, double gain) = 0; + /** Updates the display mode of the video view of a remote user. + + After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. + This method affects only the video view that the local user sees. + + @note + - Call this method after calling the \ref IChannel::setupRemoteVideo "setupRemoteVideo" method to initialize the remote video view. + - During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user. + + @param userId The ID of the remote user. + @param renderMode The rendering mode of the remote video view. See #RENDER_MODE_TYPE. + @param mirrorMode + - The mirror mode of the remote video view. See #VIDEO_MIRROR_MODE_TYPE. + - **Note**: The SDK disables the mirror mode by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** Stops/Resumes receiving all remote users' audio streams by default. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams by default: + - true: Stops receiving all remote users' audio streams by default. + - false: (Default) Receives all remote users' audio streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteAudioStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' video streams by default. + + @param mute Sets whether to receive/stop receiving all remote users' video streams by default: + - true: Stop receiving all remote users' video streams by default. + - false: (Default) Receive all remote users' video streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' audio streams. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams. + - true: Stops receiving all remote users' audio streams. + - false: (Default) Receives all remote users' audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteAudioStreams(bool mute) = 0; + /** Adjust the playback volume of the specified remote user. + + After joining a channel, call \ref agora::rtc::IChannel::adjustPlaybackSignalVolume "adjustPlaybackSignalVolume" to adjust the playback volume of different remote users, + or adjust multiple times for one remote user. + + @note + - Call this method after joining a channel. + - This method adjusts the playback volume, which is the mixed volume for the specified remote user. + - This method can only adjust the playback volume of one specified remote user at a time. If you want to adjust the playback volume of several remote users, + call the method multiple times, once for each remote user. + + @param uid The user ID, which should be the same as the `uid` of \ref agora::rtc::IChannel::joinChannel "joinChannel" + @param volume The playback volume of the voice. The value ranges from 0 to 100: + - 0: Mute. + - 100: Original volume. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustUserPlaybackSignalVolume(uid_t userId, int volume) = 0; + /** Stops/Resumes receiving a specified remote user's audio stream. + + @note If you called the \ref agora::rtc::IChannel::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method and set `mute` as `true` to stop + receiving all remote users' audio streams, call the m`uteAllRemoteAudioStreams` method and set `mute` as `false` before calling this method. + The `muteAllRemoteAudioStreams` method sets all remote audio streams, while the `muteRemoteAudioStream` method sets a specified remote audio stream. + + @param userId The user ID of the specified remote user sending the audio. + @param mute Sets whether to receive/stop receiving a specified remote user's audio stream: + - true: Stops receiving the specified remote user's audio stream. + - false: (Default) Receives the specified remote user's audio stream. + + @return + - 0: Success. + - < 0: Failure. + + */ + virtual int muteRemoteAudioStream(uid_t userId, bool mute) = 0; + /** Stops/Resumes receiving all video stream from a specified remote user. + + @param mute Sets whether to receive/stop receiving all remote users' video streams: + - true: Stop receiving all remote users' video streams. + - false: (Default) Receive all remote users' video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving the video stream from a specified remote user. + + @note If you called the \ref agora::rtc::IChannel::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method and + set `mute` as `true` to stop receiving all remote video streams, call the `muteAllRemoteVideoStreams` method and + set `mute` as `false` before calling this method. + + @param userId The user ID of the specified remote user. + @param mute Sets whether to stop/resume receiving the video stream from a specified remote user: + - true: Stop receiving the specified remote user's video stream. + - false: (Default) Receive the specified remote user's video stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteRemoteVideoStream(uid_t userId, bool mute) = 0; + /** Sets the remote user's video stream type received by the local user when the remote user sends dual streams. + + This method allows the application to adjust the corresponding video-stream type based on the size of the video window to reduce the bandwidth and resources. + + - If the remote user enables the dual-stream mode by calling the \ref agora::rtc::IChannel::enableDualStreamMode "enableDualStreamMode" method, + the SDK receives the high-stream video by default. + - If the dual-stream mode is not enabled, the SDK receives the high-stream video by default. + + The method result returns in the \ref agora::rtc::IChannelEventHandler::onApiCallExecuted "onApiCallExecuted" callback. + The SDK receives the high-stream video by default to reduce the bandwidth. If needed, users may use this method to switch to the low-stream video. + By default, the aspect ratio of the low-stream video is the same as the high-stream video. Once the resolution of the high-stream video is set, + the system automatically sets the resolution, frame rate, and bitrate of the low-stream video. + + @param userId The ID of the remote user sending the video stream. + @param streamType Sets the video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVideoStreamType(uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + /** Sets the default video-stream type for the video received by the local user when the remote user sends dual streams. + + - If the dual-stream mode is enabled by calling the \ref agora::rtc::IChannel::enableDualStreamMode "enableDualStreamMode" method, + the user receives the high-stream video by default. The `setRemoteDefaultVideoStreamType` method allows the application to adjust the corresponding video-stream type according to the size of the video window, reducing the bandwidth and resources. + - If the dual-stream mode is not enabled, the user receives the high-stream video by default. + + The result after calling this method is returned in the \ref agora::rtc::IChannelEventHandler::onApiCallExecuted "onApiCallExecuted" callback. + The Agora SDK receives the high-stream video by default to reduce the bandwidth. If needed, users can switch to the low-stream video through this method. + + @param streamType Sets the default video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + /** Creates a data stream. + + Each user can create up to five data streams during the lifecycle of the IChannel. + + @note Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. + + @param streamId The ID of the created data stream. + @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds: + - true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, + an error is reported to the application. + - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for + any delay or missing data stream. + @param ordered Sets whether or not the recipients receive the data stream in the sent order: + - true: The recipients receive the data stream in the sent order. + - false: The recipients do not receive the data stream in the sent order. + + @return + - Returns 0: Success. + - < 0: Failure. + */ + virtual int createDataStream(int* streamId, bool reliable, bool ordered) = 0; + /** Sends data stream messages to all users in a channel. + + The SDK has the following restrictions on this method: + - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB. + - Each client can send up to 6 kB of data per second. + - Each user can have up to five data streams simultaneously. + + A successful \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method call triggers + the \ref agora::rtc::IChannelEventHandler::onStreamMessage "onStreamMessage" callback on the remote client, from which the remote user gets the stream message. + + A failed \ref agora::rtc::IChannel::sendStreamMessage "sendStreamMessage" method call triggers + the \ref agora::rtc::IChannelEventHandler::onStreamMessageError "onStreamMessage" callback on the remote client. + + @note This method applies only to the Communication profile or to the hosts in the Live-broadcast profile. + If an audience in the Live-broadcast profile calls this method, the audience may be switched to a host. + + @param streamId The ID of the sent data stream, returned in the \ref IChannel::createDataStream "createDataStream" method. + @param data The sent data. + @param length The length of the sent data. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0; + /** Publishes the local stream to a specified CDN live RTMP address. (CDN live only.) + + The SDK returns the result of this method call in the \ref IChannelEventHandler::onStreamPublished "onStreamPublished" callback. + + The \ref agora::rtc::IChannel::addPublishStreamUrl "addPublishStreamUrl" method call triggers + the \ref agora::rtc::IChannelEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client + to report the state of adding a local stream to the CDN. + + @note + - Ensure that the user joins the channel before calling this method. + - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites). + - This method adds only one stream RTMP URL address each time it is called. + + @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. + @param transcodingEnabled Sets whether transcoding is enabled/disabled: + - true: Enable transcoding. To [transcode](https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#transcoding) the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. If you set this parameter as `true`, ensure that you call the \ref IChannel::setLiveTranscoding "setLiveTranscoding" method before this method. + - false: Disable transcoding. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0. + - #ERR_NOT_INITIALIZED (7): You have not initialized `IChannel` when publishing the stream. + */ + virtual int addPublishStreamUrl(const char *url, bool transcodingEnabled) = 0; + /** Removes an RTMP stream from the CDN. + + This method removes the RTMP URL address (added by the \ref IChannel::addPublishStreamUrl "addPublishStreamUrl" method) from a CDN live stream. + The SDK returns the result of this method call in the \ref IChannelEventHandler::onStreamUnpublished "onStreamUnpublished" callback. + + The \ref agora::rtc::IChannel::removePublishStreamUrl "removePublishStreamUrl" method call triggers + the \ref agora::rtc::IChannelEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of removing an RTMP stream from the CDN. + + @note + - This method removes only one RTMP URL address each time it is called. + - The RTMP URL address must not contain special characters, such as Chinese language characters. + + @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removePublishStreamUrl(const char *url) = 0; + /** Sets the video layout and audio settings for CDN live. (CDN live only.) + + The SDK triggers the \ref agora::rtc::IChannelEventHandler::onTranscodingUpdated "onTranscodingUpdated" callback when you + call the `setLiveTranscoding` method to update the transcoding setting. + + @note + - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites). + - If you call the `setLiveTranscoding` method to update the transcoding setting for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + + @param transcoding Sets the CDN live audio/video transcoding settings. See LiveTranscoding. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLiveTranscoding(const LiveTranscoding &transcoding) = 0; + /** Adds a voice or video stream URL address to a live broadcast. + + The \ref IChannelEventHandler::onStreamPublished "onStreamPublished" callback returns the inject status. + If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. + This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. + + The \ref agora::rtc::IChannel::addInjectStreamUrl "addInjectStreamUrl" method call triggers the following callbacks: + - The local client: + - \ref agora::rtc::IChannelEventHandler::onStreamInjectedStatus "onStreamInjectedStatus" , with the state of the injecting the online stream. + - \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + - The remote client: + - \ref agora::rtc::IChannelEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + + @note + - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites). + - This method applies to the Native SDK v2.4.1 and later. + + @param url The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV. + - Supported FLV audio codec type: AAC. + - Supported FLV video codec type: H264 (AVC). + @param config The InjectStreamConfig object that contains the configuration of the added voice or video stream. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid. + - #ERR_NOT_READY (3): The user is not in the channel. + - #ERR_NOT_SUPPORTED (4): The channel profile is not live broadcast. Call the \ref agora::rtc::IChannel::setChannelProfile "setChannelProfile" method and set the channel profile to live broadcast before calling this method. + - #ERR_NOT_INITIALIZED (7): The SDK is not initialized. Ensure that the IChannel object is initialized before calling this method. + */ + virtual int addInjectStreamUrl(const char* url, const InjectStreamConfig& config) = 0; + /** Removes the voice or video stream URL address from a live broadcast. + + This method removes the URL address (added by the \ref IChannel::addInjectStreamUrl "addInjectStreamUrl" method) from the live broadcast. + + @note If this method is called successfully, the SDK triggers the \ref IChannelEventHandler::onUserOffline "onUserOffline" callback and returns a stream uid of 666. + + @param url Pointer to the URL address of the added stream to be removed. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removeInjectStreamUrl(const char* url) = 0; + /** Starts to relay media streams across channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" and + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callbacks, and these callbacks return the + * state and events of the media stream relay. + * - If the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback returns + * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the broadcaster starts + * sending data to the destination channel. + * - If the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream + * relay. + * + * @note + * - Call this method after the \ref joinChannel() "joinChannel" method. + * - This method takes effect only when you are a broadcaster in a + * Live-broadcast channel. + * - After a successful method call, if you want to call this method + * again, ensure that you call the + * \ref stopChannelMediaRelay() "stopChannelMediaRelay" method to quit the + * current relay. + * - Contact sales-us@agora.io before implementing this function. + * - We do not support string user accounts in this API. + * + * @param configuration The configuration of the media stream relay: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int startChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Updates the channels for media stream relay. After a successful + * \ref startChannelMediaRelay() "startChannelMediaRelay" method call, if + * you want to relay the media stream to more channels, or leave the + * current relay channel, you can call the + * \ref updateChannelMediaRelay() "updateChannelMediaRelay" method. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback with the + * #RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code. + * + * @note + * Call this method after the + * \ref startChannelMediaRelay() "startChannelMediaRelay" method to update + * the destination channel. + * + * @param configuration The media stream relay configuration: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int updateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Stops the media stream relay. + * + * Once the relay stops, the broadcaster quits all the destination + * channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback. If the callback returns + * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the broadcaster successfully + * stops the relay. + * + * @note + * If the method call fails, the SDK triggers the + * \ref agora::rtc::IChannelEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback with the + * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or + * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the + * channel by calling the \ref leaveChannel() "leaveChannel" method, and + * the media stream relay automatically stops. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int stopChannelMediaRelay() = 0; + /** Gets the current connection state of the SDK. + + @return #CONNECTION_STATE_TYPE. + */ + virtual CONNECTION_STATE_TYPE getConnectionState() = 0; +}; +/** The IRtcEngine2 class. */ +class IRtcEngine2 : public IRtcEngine +{ +public: + + /** Creates and gets an `IChannel` object. + + To join more than one channel, call this method multiple times to create as many `IChannel` objects as needed, and + call the \ref agora::rtc::IChannel::joinChannel "joinChannel" method of each created `IChannel` object. + + After joining multiple channels, you can simultaneously subscribe to streams of all the channels, but publish a stream in only one channel at one time. + @param channelId The unique channel name for an Agora RTC session. It must be in the string format and not exceed 64 bytes in length. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @note + - This parameter does not have a default value. You must set it. + - Do not set it as the empty string "". Otherwise, the SDK returns #ERR_REFUSED (5). + + @return + - The `IChannel` object, if the method call succeeds. + - An empty pointer NULL, if the method call fails. + - #ERR_REFUSED(5), if you set channelId as the empty string "". + */ + virtual IChannel* createChannel(const char *channelId) = 0; + +}; + + +} +} + + +#endif diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcEngine.h b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcEngine.h new file mode 100755 index 000000000..ebc52f39c --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraRtcEngine.h @@ -0,0 +1,7155 @@ +// +// AgoraRtcEngine SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +/** + @defgroup createAgoraRtcEngine Create an AgoraRtcEngine + */ + +#ifndef AGORA_RTC_ENGINE_H +#define AGORA_RTC_ENGINE_H +#include "AgoraBase.h" +#include "IAgoraService.h" + +namespace agora { +namespace rtc { + typedef unsigned int uid_t; + typedef void* view_t; +/** Maximum length of the device ID. +*/ +enum MAX_DEVICE_ID_LENGTH_TYPE +{ + /** The maximum length of the device ID is 512 bytes. + */ + MAX_DEVICE_ID_LENGTH = 512 +}; +/** Maximum length of user account. + */ +enum MAX_USER_ACCOUNT_LENGTH_TYPE +{ + /** The maximum length of user account is 255 bytes. + */ + MAX_USER_ACCOUNT_LENGTH = 256 +}; +/** Maximum length of channel ID. + */ +enum MAX_CHANNEL_ID_LENGTH_TYPE +{ + /** The maximum length of channel id is 64 bytes. + */ + MAX_CHANNEL_ID_LENGTH = 65 +}; +/** Formats of the quality report. +*/ +enum QUALITY_REPORT_FORMAT_TYPE +{ + /** 0: The quality report in JSON format, + */ + QUALITY_REPORT_JSON = 0, + /** 1: The quality report in HTML format. + */ + QUALITY_REPORT_HTML = 1, +}; + +enum MEDIA_ENGINE_EVENT_CODE_TYPE +{ + /** 0: For internal use only. + */ + MEDIA_ENGINE_RECORDING_ERROR = 0, + /** 1: For internal use only. + */ + MEDIA_ENGINE_PLAYOUT_ERROR = 1, + /** 2: For internal use only. + */ + MEDIA_ENGINE_RECORDING_WARNING = 2, + /** 3: For internal use only. + */ + MEDIA_ENGINE_PLAYOUT_WARNING = 3, + /** 10: For internal use only. + */ + MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH = 10, + /** 12: For internal use only. + */ + MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS = 12, + /** 13: For internal use only. + */ + MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS = 13, + /** 14: For internal use only. + */ + MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED = 14, + /** 15: For internal use only. + */ + MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED = 15, + // media engine role changed + /** 20: For internal use only. + */ + MEDIA_ENGINE_ROLE_BROADCASTER_SOLO = 20, + /** 21: For internal use only. + */ + MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE = 21, + /** 22: For internal use only. + */ + MEDIA_ENGINE_ROLE_AUDIENCE = 22, + /** 23: For internal use only. + */ + MEDIA_ENGINE_ROLE_COMM_PEER = 23, + /** 24: For internal use only. + */ + MEDIA_ENGINE_ROLE_GAME_PEER = 24, + // iOS adm sample rate changed + /** 110: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART = 110, + /** 111: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART = 111, + /** 112: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS = 112, + /** 113: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS = 113, + // audio mix state + /** 710: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY = 710, + /** 711: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED = 711, + /** 712: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART = 712, + /** 713: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED = 713, + /** 714: For internal use only. + */ + MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR = 714, + //Mixing error codes + /** 701: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN = 701, + /** 702: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT = 702, + /** 703: The audio mixing file playback is interrupted. For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF = 703, + /** 0: For internal use only. + */ + MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR = 0, +}; + +/** The states of the local user's audio mixing file. +*/ +enum AUDIO_MIXING_STATE_TYPE{ + /** 710: The audio mixing file is playing. + */ + AUDIO_MIXING_STATE_PLAYING = 710, + /** 711: The audio mixing file pauses playing. + */ + AUDIO_MIXING_STATE_PAUSED = 711, + /** 713: The audio mixing file stops playing. + */ + AUDIO_MIXING_STATE_STOPPED = 713, + /** 714: An exception occurs when playing the audio mixing file. See #AUDIO_MIXING_ERROR_TYPE. + */ + AUDIO_MIXING_STATE_FAILED = 714, +}; + +/** The error codes of the local user's audio mixing file. +*/ +enum AUDIO_MIXING_ERROR_TYPE{ + /** 701: The SDK cannot open the audio mixing file. + */ + AUDIO_MIXING_ERROR_CAN_NOT_OPEN = 701, + /** 702: The SDK opens the audio mixing file too frequently. + */ + AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL = 702, + /** 703: The audio mixing file playback is interrupted. + */ + AUDIO_MIXING_ERROR_INTERRUPTED_EOF = 703, + /** 0: The SDK can open the audio mixing file. + */ + AUDIO_MIXING_ERROR_OK = 0, +}; + +/** Media device states. + */ +enum MEDIA_DEVICE_STATE_TYPE +{ + /** 1: The device is active. + */ + MEDIA_DEVICE_STATE_ACTIVE = 1, + /** 2: The device is disabled. + */ + MEDIA_DEVICE_STATE_DISABLED = 2, + /** 4: The device is not present. + */ + MEDIA_DEVICE_STATE_NOT_PRESENT = 4, + /** 8: The device is unplugged. + */ + MEDIA_DEVICE_STATE_UNPLUGGED = 8 +}; + +/** Media device types. + */ +enum MEDIA_DEVICE_TYPE +{ + /** -1: Unknown device type. + */ + UNKNOWN_AUDIO_DEVICE = -1, + /** 0: Audio playback device. + */ + AUDIO_PLAYOUT_DEVICE = 0, + /** 1: Audio recording device. + */ + AUDIO_RECORDING_DEVICE = 1, + /** 2: Video renderer. + */ + VIDEO_RENDER_DEVICE = 2, + /** 3: Video capturer. + */ + VIDEO_CAPTURE_DEVICE = 3, + /** 4: Application audio playback device. + */ + AUDIO_APPLICATION_PLAYOUT_DEVICE = 4, +}; + +/** Local video state types + */ +enum LOCAL_VIDEO_STREAM_STATE +{ + /** Initial state */ + LOCAL_VIDEO_STREAM_STATE_STOPPED = 0, + /** The capturer starts successfully. */ + LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1, + /** The first video frame is successfully encoded. */ + LOCAL_VIDEO_STREAM_STATE_ENCODING = 2, + /** The local video fails to start. */ + LOCAL_VIDEO_STREAM_STATE_FAILED = 3 +}; + +/** Local video state error codes + */ +enum LOCAL_VIDEO_STREAM_ERROR { + /** The local video is normal. */ + LOCAL_VIDEO_STREAM_ERROR_OK = 0, + /** No specified reason for the local video failure. */ + LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1, + /** No permission to use the local video capturing device. */ + LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, + /** The local video capturing device is in use. */ + LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3, + /** The local video capture fails. Check whether the capturing device is working properly. */ + LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4, + /** The local video encoding fails. */ + LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5 +}; + +/** Local audio state types. + */ +enum LOCAL_AUDIO_STREAM_STATE +{ + /** 0: The local audio is in the initial state. + */ + LOCAL_AUDIO_STREAM_STATE_STOPPED = 0, + /** 1: The recording device starts successfully. + */ + LOCAL_AUDIO_STREAM_STATE_RECORDING = 1, + /** 2: The first audio frame encodes successfully. + */ + LOCAL_AUDIO_STREAM_STATE_ENCODING = 2, + /** 3: The local audio fails to start. + */ + LOCAL_AUDIO_STREAM_STATE_FAILED = 3 +}; + +/** Local audio state error codes. + */ +enum LOCAL_AUDIO_STREAM_ERROR +{ + /** 0: The local audio is normal. + */ + LOCAL_AUDIO_STREAM_ERROR_OK = 0, + /** 1: No specified reason for the local audio failure. + */ + LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1, + /** 2: No permission to use the local audio device. + */ + LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, + /** 3: The microphone is in use. + */ + LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3, + /** 4: The local audio recording fails. Check whether the recording device + * is working properly. + */ + LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4, + /** 5: The local audio encoding fails. + */ + LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5 +}; + +/** Audio recording qualities. +*/ +enum AUDIO_RECORDING_QUALITY_TYPE +{ + /** 0: Low quality. The sample rate is 32 kHz, and the file size is around + * 1.2 MB after 10 minutes of recording. + */ + AUDIO_RECORDING_QUALITY_LOW = 0, + /** 1: Medium quality. The sample rate is 32 kHz, and the file size is + * around 2 MB after 10 minutes of recording. + */ + AUDIO_RECORDING_QUALITY_MEDIUM = 1, + /** 2: High quality. The sample rate is 32 kHz, and the file size is + * around 3.75 MB after 10 minutes of recording. + */ + AUDIO_RECORDING_QUALITY_HIGH = 2, +}; + +/** Network quality types. */ +enum QUALITY_TYPE +{ + /** 0: The network quality is unknown. */ + QUALITY_UNKNOWN = 0, + /** 1: The network quality is excellent. */ + QUALITY_EXCELLENT = 1, + /** 2: The network quality is quite good, but the bitrate may be slightly lower than excellent. */ + QUALITY_GOOD = 2, + /** 3: Users can feel the communication slightly impaired. */ + QUALITY_POOR = 3, + /** 4: Users cannot communicate smoothly. */ + QUALITY_BAD = 4, + /** 5: The network is so bad that users can barely communicate. */ + QUALITY_VBAD = 5, + /** 6: The network is down and users cannot communicate at all. */ + QUALITY_DOWN = 6, + /** 7: Users cannot detect the network quality. (Not in use.) */ + QUALITY_UNSUPPORTED = 7, + /** 8: Detecting the network quality. */ + QUALITY_DETECTING = 8, +}; + +/** Video display modes. */ +enum RENDER_MODE_TYPE +{ + /** +1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. + */ + RENDER_MODE_HIDDEN = 1, + /** +2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black. + */ + RENDER_MODE_FIT = 2, + /** **DEPRECATED** 3: This mode is deprecated. + */ + RENDER_MODE_ADAPTIVE = 3, +}; + +/** Video mirror modes. */ +enum VIDEO_MIRROR_MODE_TYPE +{ + /** 0: (Default) The SDK enables the mirror mode. + */ + VIDEO_MIRROR_MODE_AUTO = 0,//determined by SDK + /** 1: Enable mirror mode. */ + VIDEO_MIRROR_MODE_ENABLED = 1,//enabled mirror + /** 2: Disable mirror mode. */ + VIDEO_MIRROR_MODE_DISABLED = 2,//disable mirror +}; + +/** **DEPRECATED** Video profiles. */ +enum VIDEO_PROFILE_TYPE +{ + /** 0: 160 × 120, frame rate 15 fps, bitrate 65 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_120P = 0, + /** 2: 120 × 120, frame rate 15 fps, bitrate 50 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_120P_3 = 2, + /** 10: 320×180, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_180P = 10, + /** 12: 180 × 180, frame rate 15 fps, bitrate 100 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_180P_3 = 12, + /** 13: 240 × 180, frame rate 15 fps, bitrate 120 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_180P_4 = 13, + /** 20: 320 × 240, frame rate 15 fps, bitrate 200 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_240P = 20, + /** 22: 240 × 240, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_240P_3 = 22, + /** 23: 424 × 240, frame rate 15 fps, bitrate 220 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_240P_4 = 23, + /** 30: 640 × 360, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P = 30, + /** 32: 360 × 360, frame rate 15 fps, bitrate 260 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_3 = 32, + /** 33: 640 × 360, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_4 = 33, + /** 35: 360 × 360, frame rate 30 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_6 = 35, + /** 36: 480 × 360, frame rate 15 fps, bitrate 320 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_7 = 36, + /** 37: 480 × 360, frame rate 30 fps, bitrate 490 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_360P_8 = 37, + /** 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_LANDSCAPE_360P_9 = 38, + /** 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_LANDSCAPE_360P_10 = 39, + /** 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_LANDSCAPE_360P_11 = 100, + /** 40: 640 × 480, frame rate 15 fps, bitrate 500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P = 40, + /** 42: 480 × 480, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_3 = 42, + /** 43: 640 × 480, frame rate 30 fps, bitrate 750 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_4 = 43, + /** 45: 480 × 480, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_6 = 45, + /** 47: 848 × 480, frame rate 15 fps, bitrate 610 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_8 = 47, + /** 48: 848 × 480, frame rate 30 fps, bitrate 930 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_9 = 48, + /** 49: 640 × 480, frame rate 10 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_480P_10 = 49, + /** 50: 1280 × 720, frame rate 15 fps, bitrate 1130 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P = 50, + /** 52: 1280 × 720, frame rate 30 fps, bitrate 1710 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P_3 = 52, + /** 54: 960 × 720, frame rate 15 fps, bitrate 910 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P_5 = 54, + /** 55: 960 × 720, frame rate 30 fps, bitrate 1380 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_720P_6 = 55, + /** 60: 1920 × 1080, frame rate 15 fps, bitrate 2080 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1080P = 60, + /** 62: 1920 × 1080, frame rate 30 fps, bitrate 3150 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62, + /** 64: 1920 × 1080, frame rate 60 fps, bitrate 4780 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64, + /** 66: 2560 × 1440, frame rate 30 fps, bitrate 4850 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1440P = 66, + /** 67: 2560 × 1440, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67, + /** 70: 3840 × 2160, frame rate 30 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_4K = 70, + /** 72: 3840 × 2160, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_LANDSCAPE_4K_3 = 72, + /** 1000: 120 × 160, frame rate 15 fps, bitrate 65 Kbps. */ + VIDEO_PROFILE_PORTRAIT_120P = 1000, + /** 1002: 120 × 120, frame rate 15 fps, bitrate 50 Kbps. */ + VIDEO_PROFILE_PORTRAIT_120P_3 = 1002, + /** 1010: 180 × 320, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_PORTRAIT_180P = 1010, + /** 1012: 180 × 180, frame rate 15 fps, bitrate 100 Kbps. */ + VIDEO_PROFILE_PORTRAIT_180P_3 = 1012, + /** 1013: 180 × 240, frame rate 15 fps, bitrate 120 Kbps. */ + VIDEO_PROFILE_PORTRAIT_180P_4 = 1013, + /** 1020: 240 × 320, frame rate 15 fps, bitrate 200 Kbps. */ + VIDEO_PROFILE_PORTRAIT_240P = 1020, + /** 1022: 240 × 240, frame rate 15 fps, bitrate 140 Kbps. */ + VIDEO_PROFILE_PORTRAIT_240P_3 = 1022, + /** 1023: 240 × 424, frame rate 15 fps, bitrate 220 Kbps. */ + VIDEO_PROFILE_PORTRAIT_240P_4 = 1023, + /** 1030: 360 × 640, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P = 1030, + /** 1032: 360 × 360, frame rate 15 fps, bitrate 260 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_3 = 1032, + /** 1033: 360 × 640, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_4 = 1033, + /** 1035: 360 × 360, frame rate 30 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_6 = 1035, + /** 1036: 360 × 480, frame rate 15 fps, bitrate 320 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_7 = 1036, + /** 1037: 360 × 480, frame rate 30 fps, bitrate 490 Kbps. */ + VIDEO_PROFILE_PORTRAIT_360P_8 = 1037, + /** 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_PORTRAIT_360P_9 = 1038, + /** 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_PORTRAIT_360P_10 = 1039, + /** 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps. + @note Live broadcast profile only. + */ + VIDEO_PROFILE_PORTRAIT_360P_11 = 1100, + /** 1040: 480 × 640, frame rate 15 fps, bitrate 500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P = 1040, + /** 1042: 480 × 480, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_3 = 1042, + /** 1043: 480 × 640, frame rate 30 fps, bitrate 750 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_4 = 1043, + /** 1045: 480 × 480, frame rate 30 fps, bitrate 600 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_6 = 1045, + /** 1047: 480 × 848, frame rate 15 fps, bitrate 610 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_8 = 1047, + /** 1048: 480 × 848, frame rate 30 fps, bitrate 930 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_9 = 1048, + /** 1049: 480 × 640, frame rate 10 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_PORTRAIT_480P_10 = 1049, + /** 1050: 720 × 1280, frame rate 15 fps, bitrate 1130 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P = 1050, + /** 1052: 720 × 1280, frame rate 30 fps, bitrate 1710 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P_3 = 1052, + /** 1054: 720 × 960, frame rate 15 fps, bitrate 910 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P_5 = 1054, + /** 1055: 720 × 960, frame rate 30 fps, bitrate 1380 Kbps. */ + VIDEO_PROFILE_PORTRAIT_720P_6 = 1055, + /** 1060: 1080 × 1920, frame rate 15 fps, bitrate 2080 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1080P = 1060, + /** 1062: 1080 × 1920, frame rate 30 fps, bitrate 3150 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062, + /** 1064: 1080 × 1920, frame rate 60 fps, bitrate 4780 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064, + /** 1066: 1440 × 2560, frame rate 30 fps, bitrate 4850 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1440P = 1066, + /** 1067: 1440 × 2560, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067, + /** 1070: 2160 × 3840, frame rate 30 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_4K = 1070, + /** 1072: 2160 × 3840, frame rate 60 fps, bitrate 6500 Kbps. */ + VIDEO_PROFILE_PORTRAIT_4K_3 = 1072, + /** Default 640 × 360, frame rate 15 fps, bitrate 400 Kbps. */ + VIDEO_PROFILE_DEFAULT = VIDEO_PROFILE_LANDSCAPE_360P, +}; + +/** Audio profiles. + +Sets the sample rate, bitrate, encoding mode, and the number of channels:*/ +enum AUDIO_PROFILE_TYPE // sample rate, bit rate, mono/stereo, speech/music codec +{ + /** + 0: Default audio profile. + + - In the Communication profile, the default value is #AUDIO_PROFILE_SPEECH_STANDARD; + - In the Live-broadcast profile, the default value is #AUDIO_PROFILE_MUSIC_STANDARD. + */ + AUDIO_PROFILE_DEFAULT = 0, // use default settings + /** + 1: A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps. + */ + AUDIO_PROFILE_SPEECH_STANDARD = 1, // 32Khz, 18Kbps, mono, speech + /** + 2: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 48 Kbps. + */ + AUDIO_PROFILE_MUSIC_STANDARD = 2, // 48Khz, 48Kbps, mono, music + /** + 3: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 56 Kbps. + */ + AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, // 48Khz, 56Kbps, stereo, music + /** + 4: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 128 Kbps. + */ + AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, // 48Khz, 128Kbps, mono, music + /** + 5: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 192 Kbps. + */ + AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, // 48Khz, 192Kbps, stereo, music + /** + 6: A sample rate of 16 KHz, audio encoding, mono, and Acoustic Echo Cancellation (AES) enabled. + */ + AUDIO_PROFILE_IOT = 6, + AUDIO_PROFILE_NUM = 7, +}; + +/** Audio application scenarios. +*/ +enum AUDIO_SCENARIO_TYPE // set a suitable scenario for your app type +{ + /** 0: Default. */ + AUDIO_SCENARIO_DEFAULT = 0, + /** 1: Entertainment scenario, supporting voice during gameplay. */ + AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT = 1, + /** 2: Education scenario, prioritizing smoothness and stability. */ + AUDIO_SCENARIO_EDUCATION = 2, + /** 3: Live gaming scenario, enabling the gaming audio effects in the speaker mode in a live broadcast scenario. Choose this scenario for high-fidelity music playback. */ + AUDIO_SCENARIO_GAME_STREAMING = 3, + /** 4: Showroom scenario, optimizing the audio quality with external professional equipment. */ + AUDIO_SCENARIO_SHOWROOM = 4, + /** 5: Gaming scenario. */ + AUDIO_SCENARIO_CHATROOM_GAMING = 5, + /** 6: Applicable to the IoT scenario. */ + AUDIO_SCENARIO_IOT = 6, + AUDIO_SCENARIO_NUM = 7, +}; + + /** The channel profile of the Agora RtcEngine. + */ +enum CHANNEL_PROFILE_TYPE +{ + /** (Default) The Communication profile. Use this profile in one-on-one calls or group calls, where all users can talk freely. + */ + CHANNEL_PROFILE_COMMUNICATION = 0, + /** The Live-Broadcast profile. Users in a live-broadcast channel have a role as either broadcaster or audience. + A broadcaster can both send and receive streams; an audience can only receive streams. + */ + CHANNEL_PROFILE_LIVE_BROADCASTING = 1, + /** 2: The Gaming profile. This profile uses a codec with a lower bitrate and consumes less power. Applies to the gaming scenario, where all game players can talk freely. + */ + CHANNEL_PROFILE_GAME = 2, +}; + +/** Client roles in a live broadcast. */ +enum CLIENT_ROLE_TYPE +{ + /** 1: Host */ + CLIENT_ROLE_BROADCASTER = 1, + /** 2: Audience */ + CLIENT_ROLE_AUDIENCE = 2, +}; + +/** Reasons for a user being offline. */ +enum USER_OFFLINE_REASON_TYPE +{ + /** 0: The user quits the call. */ + USER_OFFLINE_QUIT = 0, + /** 1: The SDK times out and the user drops offline because no data packet is received within a certain period of time. If the user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. */ + USER_OFFLINE_DROPPED = 1, + /** 2: (Live broadcast only.) The client role switched from the host to the audience. */ + USER_OFFLINE_BECOME_AUDIENCE = 2, +}; +/** + States of the RTMP streaming. + */ +enum RTMP_STREAM_PUBLISH_STATE +{ + /** The RTMP streaming has not started or has ended. This state is also triggered after you remove an RTMP address from the CDN by calling removePublishStreamUrl. + */ + RTMP_STREAM_PUBLISH_STATE_IDLE = 0, + /** The SDK is connecting to Agora's streaming server and the RTMP server. This state is triggered after you call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. + */ + RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1, + /** The RTMP streaming publishes. The SDK successfully publishes the RTMP streaming and returns this state. + */ + RTMP_STREAM_PUBLISH_STATE_RUNNING = 2, + /** The RTMP streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP streaming and returns this state. + + - If the SDK successfully resumes the streaming, #RTMP_STREAM_PUBLISH_STATE_RUNNING (2) returns. + - If the streaming does not resume within 60 seconds or server errors occur, #RTMP_STREAM_PUBLISH_STATE_FAILURE (4) returns. You can also reconnect to the server by calling the \ref IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods. + */ + RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3, + /** The RTMP streaming fails. See the errCode parameter for the detailed error information. You can also call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the RTMP streaming again. + */ + RTMP_STREAM_PUBLISH_STATE_FAILURE = 4, +}; + +/** + Error codes of the RTMP streaming. + */ +enum RTMP_STREAM_PUBLISH_ERROR +{ + /** The RTMP streaming publishes successfully. */ + RTMP_STREAM_PUBLISH_ERROR_OK = 0, + /** Invalid argument used. If, for example, you do not call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method to configure the LiveTranscoding parameters before calling the addPublishStreamUrl method, the SDK returns this error. Check whether you set the parameters in the *setLiveTranscoding* method properly. */ + RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1, + /** The RTMP streaming is encrypted and cannot be published. */ + RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2, + /** Timeout for the RTMP streaming. Call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the streaming again. */ + RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3, + /** An error occurs in Agora's streaming server. Call the addPublishStreamUrl method to publish the streaming again. */ + RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4, + /** An error occurs in the RTMP server. */ + RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5, + /** The RTMP streaming publishes too frequently. */ + RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6, + /** The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */ + RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7, + /** The host manipulates other hosts' URLs. Check your app logic. */ + RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8, + /** Agora's server fails to find the RTMP streaming. */ + RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9, + /** The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. */ + RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10, +}; + +/** States of importing an external video stream in a live broadcast. */ +enum INJECT_STREAM_STATUS +{ + /** 0: The external video stream imported successfully. */ + INJECT_STREAM_STATUS_START_SUCCESS = 0, + /** 1: The external video stream already exists. */ + INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1, + /** 2: The external video stream to be imported is unauthorized. */ + INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2, + /** 3: Import external video stream timeout. */ + INJECT_STREAM_STATUS_START_TIMEDOUT = 3, + /** 4: Import external video stream failed. */ + INJECT_STREAM_STATUS_START_FAILED = 4, + /** 5: The external video stream stopped importing successfully. */ + INJECT_STREAM_STATUS_STOP_SUCCESS = 5, + /** 6: No external video stream is found. */ + INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6, + /** 7: The external video stream to be stopped importing is unauthorized. */ + INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7, + /** 8: Stop importing external video stream timeout. */ + INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8, + /** 9: Stop importing external video stream failed. */ + INJECT_STREAM_STATUS_STOP_FAILED = 9, + /** 10: The external video stream is corrupted. */ + INJECT_STREAM_STATUS_BROKEN = 10, +}; +/** Remote video stream types. */ +enum REMOTE_VIDEO_STREAM_TYPE +{ + /** 0: High-stream video. */ + REMOTE_VIDEO_STREAM_HIGH = 0, + /** 1: Low-stream video. */ + REMOTE_VIDEO_STREAM_LOW = 1, +}; + +/** Use modes of the \ref media::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" callback. */ +enum RAW_AUDIO_FRAME_OP_MODE_TYPE +{ + /** 0: Read-only mode: Users only read the \ref agora::media::IAudioFrameObserver::AudioFrame "AudioFrame" data without modifying anything. For example, when users acquire the data with the Agora SDK, then push the RTMP streams. */ + RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0, + /** 1: Write-only mode: Users replace the \ref agora::media::IAudioFrameObserver::AudioFrame "AudioFrame" data with their own data and pass the data to the SDK for encoding. For example, when users acquire the data. */ + RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY = 1, + /** 2: Read and write mode: Users read the data from \ref agora::media::IAudioFrameObserver::AudioFrame "AudioFrame", modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change. */ + RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2, +}; + +/** Audio-sample rates. */ +enum AUDIO_SAMPLE_RATE_TYPE +{ + /** 32000: 32 kHz */ + AUDIO_SAMPLE_RATE_32000 = 32000, + /** 44100: 44.1 kHz */ + AUDIO_SAMPLE_RATE_44100 = 44100, + /** 48000: 48 kHz */ + AUDIO_SAMPLE_RATE_48000 = 48000, +}; + +/** Video codec profile types. */ +enum VIDEO_CODEC_PROFILE_TYPE +{ /** 66: Baseline video codec profile. Generally used in video calls on mobile phones. */ + VIDEO_CODEC_PROFILE_BASELINE = 66, + /** 77: Main video codec profile. Generally used in mainstream electronics such as MP4 players, portable video players, PSP, and iPads. */ + VIDEO_CODEC_PROFILE_MAIN = 77, + /** 100: (Default) High video codec profile. Generally used in high-resolution broadcasts or television. */ + VIDEO_CODEC_PROFILE_HIGH = 100, +}; + +/** Video codec types */ +enum VIDEO_CODEC_TYPE { + /** Standard VP8 */ + VIDEO_CODEC_VP8 = 1, + /** Standard H264 */ + VIDEO_CODEC_H264 = 2, + /** Enhanced VP8 */ + VIDEO_CODEC_EVP = 3, + /** Enhanced H264 */ + VIDEO_CODEC_E264 = 4, +}; + +/** Audio equalization band frequencies. */ +enum AUDIO_EQUALIZATION_BAND_FREQUENCY +{ + /** 0: 31 Hz */ + AUDIO_EQUALIZATION_BAND_31 = 0, + /** 1: 62 Hz */ + AUDIO_EQUALIZATION_BAND_62 = 1, + /** 2: 125 Hz */ + AUDIO_EQUALIZATION_BAND_125 = 2, + /** 3: 250 Hz */ + AUDIO_EQUALIZATION_BAND_250 = 3, + /** 4: 500 Hz */ + AUDIO_EQUALIZATION_BAND_500 = 4, + /** 5: 1 kHz */ + AUDIO_EQUALIZATION_BAND_1K = 5, + /** 6: 2 kHz */ + AUDIO_EQUALIZATION_BAND_2K = 6, + /** 7: 4 kHz */ + AUDIO_EQUALIZATION_BAND_4K = 7, + /** 8: 8 kHz */ + AUDIO_EQUALIZATION_BAND_8K = 8, + /** 9: 16 kHz */ + AUDIO_EQUALIZATION_BAND_16K = 9, +}; + +/** Audio reverberation types. */ +enum AUDIO_REVERB_TYPE +{ + /** 0: The level of the dry signal (db). The value is between -20 and 10. */ + AUDIO_REVERB_DRY_LEVEL = 0, // (dB, [-20,10]), the level of the dry signal + /** 1: The level of the early reflection signal (wet signal) (dB). The value is between -20 and 10. */ + AUDIO_REVERB_WET_LEVEL = 1, // (dB, [-20,10]), the level of the early reflection signal (wet signal) + /** 2: The room size of the reflection. The value is between 0 and 100. */ + AUDIO_REVERB_ROOM_SIZE = 2, // ([0,100]), the room size of the reflection + /** 3: The length of the initial delay of the wet signal (ms). The value is between 0 and 200. */ + AUDIO_REVERB_WET_DELAY = 3, // (ms, [0,200]), the length of the initial delay of the wet signal in ms + /** 4: The reverberation strength. The value is between 0 and 100. */ + AUDIO_REVERB_STRENGTH = 4, // ([0,100]), the strength of the reverberation +}; + +/** Local voice changer options. */ +enum VOICE_CHANGER_PRESET { + /** 0: The original voice (no local voice change). + */ + VOICE_CHANGER_OFF = 0, //Turn off the voice changer + /** 1: An old man's voice. + */ + VOICE_CHANGER_OLDMAN = 1, + /** 2: A little boy's voice. + */ + VOICE_CHANGER_BABYBOY = 2, + /** 3: A little girl's voice. + */ + VOICE_CHANGER_BABYGIRL = 3, + /** 4: The voice of a growling bear. + */ + VOICE_CHANGER_ZHUBAJIE = 4, + /** 5: Ethereal vocal effects. + */ + VOICE_CHANGER_ETHEREAL = 5, + /** 6: Hulk's voice. + */ + VOICE_CHANGER_HULK = 6 +}; + +/** Local voice reverberation presets. */ +enum AUDIO_REVERB_PRESET { + /** 0: The original voice (no local voice reverberation). + */ + AUDIO_REVERB_OFF = 0, // Turn off audio reverb + /** 1: Pop music. + */ + AUDIO_REVERB_POPULAR = 1, + /** 2: R&B. + */ + AUDIO_REVERB_RNB = 2, + /** 3: Rock music. + */ + AUDIO_REVERB_ROCK = 3, + /** 4: Hip-hop. + */ + AUDIO_REVERB_HIPHOP = 4, + /** 5: Pop concert. + */ + AUDIO_REVERB_VOCAL_CONCERT = 5, + /** 6: Karaoke. + */ + AUDIO_REVERB_KTV = 6, + /** 7: Recording studio. + */ + AUDIO_REVERB_STUDIO = 7 +}; +/** Audio codec profile types. The default value is LC_ACC. */ +enum AUDIO_CODEC_PROFILE_TYPE +{ + /** 0: LC-AAC, which is the low-complexity audio codec type. */ + AUDIO_CODEC_PROFILE_LC_AAC = 0, + /** 1: HE-AAC, which is the high-efficiency audio codec type. */ + AUDIO_CODEC_PROFILE_HE_AAC = 1, +}; + +/** Remote audio states. + */ +enum REMOTE_AUDIO_STATE +{ + /** 0: The remote audio is in the default state, probably due to + * #REMOTE_AUDIO_REASON_LOCAL_MUTED (3), + * #REMOTE_AUDIO_REASON_REMOTE_MUTED (5), or + * #REMOTE_AUDIO_REASON_REMOTE_OFFLINE (7). + */ + REMOTE_AUDIO_STATE_STOPPED = 0, // Default state, audio is started or remote user disabled/muted audio stream + /** 1: The first remote audio packet is received. + */ + REMOTE_AUDIO_STATE_STARTING = 1, // The first audio frame packet has been received + /** 2: The remote audio stream is decoded and plays normally, probably + * due to #REMOTE_AUDIO_REASON_NETWORK_RECOVERY (2), + * #REMOTE_AUDIO_REASON_LOCAL_UNMUTED (4), or + * #REMOTE_AUDIO_REASON_REMOTE_UNMUTED (6). + */ + REMOTE_AUDIO_STATE_DECODING = 2, // The first remote audio frame has been decoded or fronzen state ends + /** 3: The remote audio is frozen, probably due to + * #REMOTE_AUDIO_REASON_NETWORK_CONGESTION (1). + */ + REMOTE_AUDIO_STATE_FROZEN = 3, // Remote audio is frozen, probably due to network issue + /** 4: The remote audio fails to start, probably due to + * #REMOTE_AUDIO_REASON_INTERNAL (0). + */ + REMOTE_AUDIO_STATE_FAILED = 4, // Remote audio play failed +}; + +/** Remote audio state reasons. + */ +enum REMOTE_AUDIO_STATE_REASON +{ + /** 0: Internal reasons. + */ + REMOTE_AUDIO_REASON_INTERNAL = 0, + /** 1: Network congestion. + */ + REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1, + /** 2: Network recovery. + */ + REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2, + /** 3: The local user stops receiving the remote audio stream or + * disables the audio module. + */ + REMOTE_AUDIO_REASON_LOCAL_MUTED = 3, + /** 4: The local user resumes receiving the remote audio stream or + * enables the audio module. + */ + REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4, + /** 5: The remote user stops sending the audio stream or disables the + * audio module. + */ + REMOTE_AUDIO_REASON_REMOTE_MUTED = 5, + /** 6: The remote user resumes sending the audio stream or enables the + * audio module. + */ + REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6, + /** 7: The remote user leaves the channel. + */ + REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7, +}; + +/** Remote video states. */ +// enum REMOTE_VIDEO_STATE +// { +// // REMOTE_VIDEO_STATE_STOPPED is not used at this version. Ignore this value. +// // REMOTE_VIDEO_STATE_STOPPED = 0, // Default state, video is started or remote user disabled/muted video stream +// /** 1: The remote video is playing. */ +// REMOTE_VIDEO_STATE_RUNNING = 1, // Running state, remote video can be displayed normally +// /** 2: The remote video is frozen. */ +// REMOTE_VIDEO_STATE_FROZEN = 2, // Remote video is frozen, probably due to network issue. +// }; + +/** The state of the remote video. */ +enum REMOTE_VIDEO_STATE { + /** 0: The remote video is in the default state, probably due to #REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED (3), #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5), or #REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE (7). + */ + REMOTE_VIDEO_STATE_STOPPED = 0, + + /** 1: The first remote video packet is received. + */ + REMOTE_VIDEO_STATE_STARTING = 1, + + /** 2: The remote video stream is decoded and plays normally, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), #REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED (4), #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6), or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY (9). + */ + REMOTE_VIDEO_STATE_DECODING = 2, + + /** 3: The remote video is frozen, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION (1) or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK (8). + */ + REMOTE_VIDEO_STATE_FROZEN = 3, + + /** 4: The remote video fails to start, probably due to #REMOTE_VIDEO_STATE_REASON_INTERNAL (0). + */ + REMOTE_VIDEO_STATE_FAILED = 4 +}; + +/** The reason of the remote video state change. */ +enum REMOTE_VIDEO_STATE_REASON { + /** 0: Internal reasons. + */ + REMOTE_VIDEO_STATE_REASON_INTERNAL = 0, + + /** 1: Network congestion. + */ + REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1, + + /** 2: Network recovery. + */ + REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2, + + /** 3: The local user stops receiving the remote video stream or disables the video module. + */ + REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3, + + /** 4: The local user resumes receiving the remote video stream or enables the video module. + */ + REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4, + + /** 5: The remote user stops sending the video stream or disables the video module. + */ + REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5, + + /** 6: The remote user resumes sending the video stream or enables the video module. + */ + REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6, + + /** 7: The remote user leaves the channel. + */ + REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7, + + /** 8: The remote media stream falls back to the audio-only stream due to poor network conditions. + */ + REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8, + + /** 9: The remote media stream switches back to the video stream after the network conditions improve. + */ + REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9 + +}; + +/** Video frame rates. */ +enum FRAME_RATE +{ + /** 1: 1 fps */ + FRAME_RATE_FPS_1 = 1, + /** 7: 7 fps */ + FRAME_RATE_FPS_7 = 7, + /** 10: 10 fps */ + FRAME_RATE_FPS_10 = 10, + /** 15: 15 fps */ + FRAME_RATE_FPS_15 = 15, + /** 24: 24 fps */ + FRAME_RATE_FPS_24 = 24, + /** 30: 30 fps */ + FRAME_RATE_FPS_30 = 30, + /** 60: 60 fps (Windows and macOS only) */ + FRAME_RATE_FPS_60 = 60, +}; + +/** Video output orientation modes. + */ +enum ORIENTATION_MODE { + /** 0: (Default) Adaptive mode. + + The video encoder adapts to the orientation mode of the video input device. + + - If the width of the captured video from the SDK is greater than the height, the encoder sends the video in landscape mode. The encoder also sends the rotational information of the video, and the receiver uses the rotational information to rotate the received video. + - When you use a custom video source, the output video from the encoder inherits the orientation of the original video. If the original video is in portrait mode, the output video from the encoder is also in portrait mode. The encoder also sends the rotational information of the video to the receiver. + */ + ORIENTATION_MODE_ADAPTIVE = 0, + /** 1: Landscape mode. + + The video encoder always sends the video in landscape mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming. + */ + ORIENTATION_MODE_FIXED_LANDSCAPE = 1, + /** 2: Portrait mode. + + The video encoder always sends the video in portrait mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming. + */ + ORIENTATION_MODE_FIXED_PORTRAIT = 2, +}; + +/** Video degradation preferences when the bandwidth is a constraint. */ +enum DEGRADATION_PREFERENCE { + /** 0: (Default) Degrade the frame rate in order to maintain the video quality. */ + MAINTAIN_QUALITY = 0, + /** 1: Degrade the video quality in order to maintain the frame rate. */ + MAINTAIN_FRAMERATE = 1, + /** 2: (For future use) Maintain a balance between the frame rate and video quality. */ + MAINTAIN_BALANCED = 2, +}; + +/** Stream fallback options. */ +enum STREAM_FALLBACK_OPTIONS +{ + /** 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed. */ + STREAM_FALLBACK_OPTION_DISABLED = 0, + /** 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-stream (low resolution and low bitrate) video. You can set this option only in the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. Nothing happens when you set this in the \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" method. */ + STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW = 1, + /** 2: Under poor uplink network conditions, the locally published video stream falls back to audio only. + + Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network conditions worsen.*/ + STREAM_FALLBACK_OPTION_AUDIO_ONLY = 2, +}; + + /** Camera capturer configuration. + */ + enum CAPTURER_OUTPUT_PREFERENCE + { + /** 0: (Default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality. + */ + CAPTURER_OUTPUT_PREFERENCE_AUTO = 0, + /** 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". + */ + CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1, + /** 2: Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing. + */ + CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2, + }; + +/** The priority of the remote user. + */ +enum PRIORITY_TYPE +{ + /** 50: The user's priority is high. + */ + PRIORITY_HIGH = 50, + /** 100: (Default) The user's priority is normal. + */ + PRIORITY_NORMAL = 100, +}; + +/** Connection states. */ +enum CONNECTION_STATE_TYPE +{ + /** 1: The SDK is disconnected from Agora's edge server. + + - This is the initial state before calling the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + - The SDK also enters this state when the application calls the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + */ + CONNECTION_STATE_DISCONNECTED = 1, + /** 2: The SDK is connecting to Agora's edge server. + + - When the application calls the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method, the SDK starts to establish a connection to the specified channel, triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, and switches to the #CONNECTION_STATE_CONNECTING state. + - When the SDK successfully joins the channel, it triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_CONNECTED state. + - After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. + */ + CONNECTION_STATE_CONNECTING = 2, + /** 3: The SDK is connected to Agora's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel. + + If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers: + - The \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback (deprecated). + - The \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_RECONNECTING state. + */ + CONNECTION_STATE_CONNECTED = 3, + /** 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. + + - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora's edge server, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback, stays in the #CONNECTION_STATE_RECONNECTING state, and keeps rejoining the channel. + - If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, switches to the #CONNECTION_STATE_FAILED state, and stops rejoining the channel. + */ + CONNECTION_STATE_RECONNECTING = 4, + /** 5: The SDK fails to connect to Agora's edge server or join the channel. + + You must call the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method to leave this state, and call the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method again to rejoin the channel. + + If the SDK is banned from joining the channel by Agora's edge server (through the RESTful API), the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionBanned "onConnectionBanned" (deprecated) and \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callbacks. + */ + CONNECTION_STATE_FAILED = 5, +}; + +/** Reasons for a connection state change. */ +enum CONNECTION_CHANGED_REASON_TYPE +{ + /** 0: The SDK is connecting to Agora's edge server. */ + CONNECTION_CHANGED_CONNECTING = 0, + /** 1: The SDK has joined the channel successfully. */ + CONNECTION_CHANGED_JOIN_SUCCESS = 1, + /** 2: The connection between the SDK and Agora's edge server is interrupted. */ + CONNECTION_CHANGED_INTERRUPTED = 2, + /** 3: The connection between the SDK and Agora's edge server is banned by Agora's edge server. */ + CONNECTION_CHANGED_BANNED_BY_SERVER = 3, + /** 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. */ + CONNECTION_CHANGED_JOIN_FAILED = 4, + /** 5: The SDK has left the channel. */ + CONNECTION_CHANGED_LEAVE_CHANNEL = 5, + /** 6: The connection failed since Appid is not valid. */ + CONNECTION_CHANGED_INVALID_APP_ID = 6, + /** 7: The connection failed since channel name is not valid. */ + CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7, + /** 8: The connection failed since token is not valid, possibly because: + + - The App Certificate for the project is enabled in Console, but you do not use Token when joining the channel. If you enable the App Certificate, you must use a token to join the channel. + - The uid that you specify in the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method is different from the uid that you pass for generating the token. + */ + CONNECTION_CHANGED_INVALID_TOKEN = 8, + /** 9: The connection failed since token is expired. */ + CONNECTION_CHANGED_TOKEN_EXPIRED = 9, + /** 10: The connection is rejected by server. */ + CONNECTION_CHANGED_REJECTED_BY_SERVER = 10, + /** 11: The connection changed to reconnecting since SDK has set a proxy server. */ + CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11, + /** 12: When SDK is in connection failed, the renew token operation will make it connecting. */ + CONNECTION_CHANGED_RENEW_TOKEN = 12, + /** 13: The IP Address of SDK client has changed. i.e., Network type or IP/Port changed by network operator might change client IP address. */ + CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13, + /** 14: Timeout for the keep-alive of the connection between the SDK and Agora's edge server. The connection state changes to CONNECTION_STATE_RECONNECTING(4). */ + CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14, +}; + +/** Network type. */ +enum NETWORK_TYPE +{ + /** -1: The network type is unknown. */ + NETWORK_TYPE_UNKNOWN = -1, + /** 0: The SDK disconnects from the network. */ + NETWORK_TYPE_DISCONNECTED = 0, + /** 1: The network type is LAN. */ + NETWORK_TYPE_LAN = 1, + /** 2: The network type is Wi-Fi(including hotspots). */ + NETWORK_TYPE_WIFI = 2, + /** 3: The network type is mobile 2G. */ + NETWORK_TYPE_MOBILE_2G = 3, + /** 4: The network type is mobile 3G. */ + NETWORK_TYPE_MOBILE_3G = 4, + /** 5: The network type is mobile 4G. */ + NETWORK_TYPE_MOBILE_4G = 5, +}; + +/** States of the last-mile network probe test. */ +enum LASTMILE_PROBE_RESULT_STATE { + /** 1: The last-mile network probe test is complete. */ + LASTMILE_PROBE_RESULT_COMPLETE = 1, + /** 2: The last-mile network probe test is incomplete and the bandwidth estimation is not available, probably due to limited test resources. */ + LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2, + /** 3: The last-mile network probe test is not carried out, probably due to poor network conditions. */ + LASTMILE_PROBE_RESULT_UNAVAILABLE = 3 +}; +/** Audio output routing. */ +enum AUDIO_ROUTE_TYPE { + /** Default. + */ + AUDIO_ROUTE_DEFAULT = -1, + /** Headset. + */ + AUDIO_ROUTE_HEADSET = 0, + /** Earpiece. + */ + AUDIO_ROUTE_EARPIECE = 1, + /** Headset with no microphone. + */ + AUDIO_ROUTE_HEADSET_NO_MIC = 2, + /** Speakerphone. + */ + AUDIO_ROUTE_SPEAKERPHONE = 3, + /** Loudspeaker. + */ + AUDIO_ROUTE_LOUDSPEAKER = 4, + /** Bluetooth headset. + */ + AUDIO_ROUTE_BLUETOOTH = 5 +}; + +#if (defined(__APPLE__) && TARGET_OS_IOS) +/** Audio session restriction. */ +enum AUDIO_SESSION_OPERATION_RESTRICTION { + /** No restriction, the SDK has full control of the audio session operations. */ + AUDIO_SESSION_OPERATION_RESTRICTION_NONE = 0, + /** The SDK does not change the audio session category. */ + AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY = 1, + /** The SDK does not change any setting of the audio session (category, mode, categoryOptions). */ + AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION = 1 << 1, + /** The SDK keeps the audio session active when leaving a channel. */ + AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION = 1 << 2, + /** The SDK does not configure the audio session anymore. */ + AUDIO_SESSION_OPERATION_RESTRICTION_ALL = 1 << 7, +}; +#endif + +#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) +enum CAMERA_DIRECTION { + /** The rear camera. */ + CAMERA_REAR = 0, + /** The front camera. */ + CAMERA_FRONT = 1, +}; +#endif + +/** The uplink or downlink last-mile network probe test result. */ +struct LastmileProbeOneWayResult { + /** The packet loss rate (%). */ + unsigned int packetLossRate; + /** The network jitter (ms). */ + unsigned int jitter; + /* The estimated available bandwidth (Kbps). */ + unsigned int availableBandwidth; +}; + +/** The uplink and downlink last-mile network probe test result. */ +struct LastmileProbeResult{ + /** The state of the probe test. */ + LASTMILE_PROBE_RESULT_STATE state; + /** The uplink last-mile network probe test result. */ + LastmileProbeOneWayResult uplinkReport; + /** The downlink last-mile network probe test result. */ + LastmileProbeOneWayResult downlinkReport; + /** The round-trip delay time (ms). */ + unsigned int rtt; +}; + +/** Configurations of the last-mile network probe test. */ +struct LastmileProbeConfig { + /** Sets whether or not to test the uplink network. Some users, for example, the audience in a Live-broadcast channel, do not need such a test: + - true: test. + - false: do not test. */ + bool probeUplink; + /** Sets whether or not to test the downlink network: + - true: test. + - false: do not test. */ + bool probeDownlink; + /** The expected maximum sending bitrate (Kbps) of the local user. The value ranges between 100 and 5000. We recommend setting this parameter according to the bitrate value set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". */ + unsigned int expectedUplinkBitrate; + /** The expected maximum receiving bitrate (Kbps) of the local user. The value ranges between 100 and 5000. */ + unsigned int expectedDownlinkBitrate; +}; + +/** Properties of the audio volume information. + + An array containing the user ID and volume information for each speaker. + */ +struct AudioVolumeInfo +{ + /** + User ID of the speaker. The uid of the local user is 0. + */ + uid_t uid; + /** The volume of the speaker. The volume ranges between 0 (lowest volume) and 255 (highest volume). + */ + unsigned int volume; + /** Voice activity status of the local user. + * - 0: The local user is not speaking. + * - 1: The local user is speaking. + * + * @note + * - The `vad` parameter cannot report the voice activity status of the remote users. In the remote users' callback, `vad` = 0. + * - Ensure that you set `report_vad`(true) in the \ref agora::rtc::IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method to enable the voice activity detection of the local user. + */ + unsigned int vad; + /** The channel ID, which indicates which channel the speaker is in. + */ + const char * channelId; +}; + +/** Statistics of the channel. + */ +struct RtcStats +{ + /** + Call duration (s), represented by an aggregate value. + */ + unsigned int duration; + /** + Total number of bytes transmitted, represented by an aggregate value. + */ + unsigned int txBytes; + /** + Total number of bytes received, represented by an aggregate value. + */ + unsigned int rxBytes; + /** Total number of audio bytes sent (bytes), represented + * by an aggregate value. + */ + unsigned int txAudioBytes; + /** Total number of video bytes sent (bytes), represented + * by an aggregate value. + */ + unsigned int txVideoBytes; + /** Total number of audio bytes received (bytes) before + * network countermeasures, represented by an aggregate value. + */ + unsigned int rxAudioBytes; + /** Total number of video bytes received (bytes), + * represented by an aggregate value. + */ + unsigned int rxVideoBytes; + + /** + Transmission bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short txKBitRate; + /** + Receive bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short rxKBitRate; + /** + Audio receive bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short rxAudioKBitRate; + /** + Audio transmission bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short txAudioKBitRate; + /** + Video receive bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short rxVideoKBitRate; + /** + Video transmission bitrate (Kbps), represented by an instantaneous value. + */ + unsigned short txVideoKBitRate; + /** Client-server latency (ms) + */ + unsigned short lastmileDelay; + /** The packet loss rate (%) from the local client to Agora's edge server, + * before using the anti-packet-loss method. + */ + unsigned short txPacketLossRate; + /** The packet loss rate (%) from Agora's edge server to the local client, + * before using the anti-packet-loss method. + */ + unsigned short rxPacketLossRate; + /** Number of users in the channel. + + - Communication profile: The number of users in the channel. + - Live broadcast profile: + + - If the local user is an audience: The number of users in the channel = The number of hosts in the channel + 1. + - If the user is a host: The number of users in the channel = The number of hosts in the channel. + */ + unsigned int userCount; + /** + Application CPU usage (%). + */ + double cpuAppUsage; + /** + System CPU usage (%). + */ + double cpuTotalUsage; + /** The round-trip time delay from the client to the local router. + */ + int gatewayRtt; + /** + The memory usage ratio of the app (%). + @note This value is for reference only. Due to system limitations, you may not get the value of this member. + */ + double memoryAppUsageRatio; + /** + The memory usage ratio of the system (%). + @note This value is for reference only. Due to system limitations, you may not get the value of this member. + */ + double memoryTotalUsageRatio; + /** + The memory usage of the app (KB). + @note This value is for reference only. Due to system limitations, you may not get the value of this member. + */ + int memoryAppUsageInKbytes; + RtcStats() + : duration(0) + , txBytes(0) + , rxBytes(0) + , txAudioBytes(0) + , txVideoBytes(0) + , rxAudioBytes(0) + , rxVideoBytes(0) + , txKBitRate(0) + , rxKBitRate(0) + , rxAudioKBitRate(0) + , txAudioKBitRate(0) + , rxVideoKBitRate(0) + , txVideoKBitRate(0) + , lastmileDelay(0) + , txPacketLossRate(0) + , rxPacketLossRate(0) + , userCount(0) + , cpuAppUsage(0) + , cpuTotalUsage(0) + , gatewayRtt(0) + , memoryAppUsageRatio(0) + , memoryTotalUsageRatio(0) + , memoryAppUsageInKbytes(0) {} +}; + +/** Quality change of the local video in terms of target frame rate and target bit rate since last count. + */ +enum QUALITY_ADAPT_INDICATION { + /** The quality of the local video stays the same. */ + ADAPT_NONE = 0, + /** The quality improves because the network bandwidth increases. */ + ADAPT_UP_BANDWIDTH = 1, + /** The quality worsens because the network bandwidth decreases. */ + ADAPT_DOWN_BANDWIDTH = 2, +}; + +/** The error code in CHANNEL_MEDIA_RELAY_ERROR. */ +enum CHANNEL_MEDIA_RELAY_ERROR { + /** 0: The state is normal. + */ + RELAY_OK = 0, + /** 1: An error occurs in the server response. + */ + RELAY_ERROR_SERVER_ERROR_RESPONSE = 1, + /** 2: No server response. You can call the + * \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method to + * leave the channel. + */ + RELAY_ERROR_SERVER_NO_RESPONSE = 2, + /** 3: The SDK fails to access the service, probably due to limited + * resources of the server. + */ + RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3, + /** 4: Fails to send the relay request. + */ + RELAY_ERROR_FAILED_JOIN_SRC = 4, + /** 5: Fails to accept the relay request. + */ + RELAY_ERROR_FAILED_JOIN_DEST = 5, + /** 6: The server fails to receive the media stream. + */ + RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6, + /** 7: The server fails to send the media stream. + */ + RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7, + /** 8: The SDK disconnects from the server due to poor network + * connections. You can call the \ref agora::rtc::IRtcEngine::leaveChannel + * "leaveChannel" method to leave the channel. + */ + RELAY_ERROR_SERVER_CONNECTION_LOST = 8, + /** 9: An internal error occurs in the server. + */ + RELAY_ERROR_INTERNAL_ERROR = 9, + /** 10: The token of the source channel has expired. + */ + RELAY_ERROR_SRC_TOKEN_EXPIRED = 10, + /** 11: The token of the destination channel has expired. + */ + RELAY_ERROR_DEST_TOKEN_EXPIRED = 11, +}; + +/** The event code in CHANNEL_MEDIA_RELAY_EVENT. */ +enum CHANNEL_MEDIA_RELAY_EVENT { + /** 0: The user disconnects from the server due to poor network + * connections. + */ + RELAY_EVENT_NETWORK_DISCONNECTED = 0, + /** 1: The network reconnects. + */ + RELAY_EVENT_NETWORK_CONNECTED = 1, + /** 2: The user joins the source channel. + */ + RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2, + /** 3: The user joins the destination channel. + */ + RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3, + /** 4: The SDK starts relaying the media stream to the destination channel. + */ + RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4, + /** 5: The server receives the video stream from the source channel. + */ + RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5, + /** 6: The server receives the audio stream from the source channel. + */ + RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6, + /** 7: The destination channel is updated. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7, + /** 8: The destination channel update fails due to internal reasons. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8, + /** 9: The destination channel does not change, which means that the + * destination channel fails to be updated. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9, + /** 10: The destination channel name is NULL. + */ + RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10, + /** 11: The video profile is sent to the server. + */ + RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11, +}; + +/** The state code in CHANNEL_MEDIA_RELAY_STATE. */ +enum CHANNEL_MEDIA_RELAY_STATE { + /** 0: The SDK is initializing. + */ + RELAY_STATE_IDLE = 0, + /** 1: The SDK tries to relay the media stream to the destination channel. + */ + RELAY_STATE_CONNECTING = 1, + /** 2: The SDK successfully relays the media stream to the destination + * channel. + */ + RELAY_STATE_RUNNING = 2, + /** 3: A failure occurs. See the details in code. + */ + RELAY_STATE_FAILURE = 3, +}; + +/** Statistics of the local video stream. + */ +struct LocalVideoStats +{ + /** Bitrate (Kbps) sent in the reported interval, which does not include + * the bitrate of the retransmission video after packet loss. + */ + int sentBitrate; + /** Frame rate (fps) sent in the reported interval, which does not include + * the frame rate of the retransmission video after packet loss. + */ + int sentFrameRate; + /** The encoder output frame rate (fps) of the local video. + */ + int encoderOutputFrameRate; + /** The render output frame rate (fps) of the local video. + */ + int rendererOutputFrameRate; + /** The target bitrate (Kbps) of the current encoder. This value is estimated by the SDK based on the current network conditions. + */ + int targetBitrate; + /** The target frame rate (fps) of the current encoder. + */ + int targetFrameRate; + /** Quality change of the local video in terms of target frame rate and + * target bit rate in this reported interval. See #QUALITY_ADAPT_INDICATION. + */ + QUALITY_ADAPT_INDICATION qualityAdaptIndication; + /** The encoding bitrate (Kbps), which does not include the bitrate of the + * re-transmission video after packet loss. + */ + int encodedBitrate; + /** The width of the encoding frame (px). + */ + int encodedFrameWidth; + /** The height of the encoding frame (px). + */ + int encodedFrameHeight; + /** The value of the sent frames, represented by an aggregate value. + */ + int encodedFrameCount; + /** The codec type of the local video: + * - VIDEO_CODEC_VP8 = 1: VP8. + * - VIDEO_CODEC_H264 = 2: (Default) H.264. + */ + VIDEO_CODEC_TYPE codecType; +}; + +/** Statistics of the remote video stream. + */ +struct RemoteVideoStats +{ + /** + User ID of the remote user sending the video streams. + */ + uid_t uid; + /** **DEPRECATED** Time delay (ms). + */ + int delay; +/** + Width (pixels) of the video stream. + */ + int width; + /** + Height (pixels) of the video stream. + */ + int height; + /** + Bitrate (Kbps) received since the last count. + */ + int receivedBitrate; + /** The decoder output frame rate (fps) of the remote video. + */ + int decoderOutputFrameRate; + /** The render output frame rate (fps) of the remote video. + */ + int rendererOutputFrameRate; + /** Packet loss rate (%) of the remote video stream after using the anti-packet-loss method. + */ + int packetLossRate; + REMOTE_VIDEO_STREAM_TYPE rxStreamType; + /** + The total freeze time (ms) of the remote video stream after the remote user joins the channel. + In a video session where the frame rate is set to no less than 5 fps, video freeze occurs when + the time interval between two adjacent renderable video frames is more than 500 ms. + */ + int totalFrozenTime; + /** + The total video freeze time as a percentage (%) of the total time when the video is available. + */ + int frozenRate; +}; + +/** Audio statistics of the local user */ +struct LocalAudioStats +{ + /** The number of channels. + */ + int numChannels; + /** The sample rate (Hz). + */ + int sentSampleRate; + /** The average sending bitrate (Kbps). + */ + int sentBitrate; +}; + +/** Audio statistics of a remote user */ +struct RemoteAudioStats +{ + /** User ID of the remote user sending the audio streams. + * + */ + uid_t uid; + /** Audio quality received by the user: #QUALITY_TYPE. + */ + int quality; + /** Network delay (ms) from the sender to the receiver. + */ + int networkTransportDelay; + /** Network delay (ms) from the receiver to the jitter buffer. + */ + int jitterBufferDelay; + /** The audio frame loss rate in the reported interval. + */ + int audioLossRate; + /** The number of channels. + */ + int numChannels; + /** The sample rate (Hz) of the received audio stream in the reported + * interval. + */ + int receivedSampleRate; + /** The average bitrate (Kbps) of the received audio stream in the + * reported interval. */ + int receivedBitrate; + /** The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In a session, audio freeze occurs when the audio frame loss rate reaches 4%. + * Agora uses 2 seconds as an audio piece unit to calculate the audio freeze time. The total audio freeze time = The audio freeze number × 2 seconds + */ + int totalFrozenTime; + /** The total audio freeze time as a percentage (%) of the total time when the audio is available. */ + int frozenRate; +}; + +/** + * Video dimensions. + */ +struct VideoDimensions { + /** Width (pixels) of the video. */ + int width; + /** Height (pixels) of the video. */ + int height; + VideoDimensions() + : width(640), height(480) + {} + VideoDimensions(int w, int h) + : width(w), height(h) + {} +}; + +/** (Recommended) The standard bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. + + In this mode, the bitrates differ between the live broadcast and communication profiles: + + - Communication profile: The video bitrate is the same as the base bitrate. + - Live broadcast profile: The video bitrate is twice the base bitrate. + + */ +const int STANDARD_BITRATE = 0; + +/** The compatible bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. + + The bitrate remains the same regardless of the channel profile. If you choose this mode in the Live-broadcast profile, the video frame rate may be lower than the set value. + */ +const int COMPATIBLE_BITRATE = -1; + +/** Use the default minimum bitrate. + */ +const int DEFAULT_MIN_BITRATE = -1; + +/** Video encoder configurations. + */ +struct VideoEncoderConfiguration { + /** The video frame dimensions (px) used to specify the video quality and measured by the total number of pixels along a frame's width and height: VideoDimensions. The default value is 640 x 360. + */ + VideoDimensions dimensions; + /** The frame rate of the video: #FRAME_RATE. The default value is 15. + + Note that we do not recommend setting this to a value greater than 30. + */ + FRAME_RATE frameRate; + /** The minimum frame rate of the video. The default value is -1. + */ + int minFrameRate; + /** The video encoding bitrate (Kbps). + + Choose one of the following options: + + - #STANDARD_BITRATE: (Recommended) The standard bitrate. + - The Communication profile: the encoding bitrate equals the base bitrate. + - The Live-broadcast profile: the encoding bitrate is twice the base bitrate. + - #COMPATIBLE_BITRATE: The compatible bitrate: the bitrate stays the same regardless of the profile. + + The Communication profile prioritizes smoothness, while the Live-broadcast profile prioritizes video quality (requiring a higher bitrate). We recommend setting the bitrate mode as #STANDARD_BITRATE to address this difference. + + The following table lists the recommended video encoder configurations, where the base bitrate applies to the Communication profile. Set your bitrate based on this table. If you set a bitrate beyond the proper range, the SDK automatically sets it to within the range. + + | Resolution | Frame Rate (fps) | Base Bitrate (Kbps, for Communication) | Live Bitrate (Kbps, for Live Broadcast)| + |------------------------|------------------|----------------------------------------|----------------------------------------| + | 160 × 120 | 15 | 65 | 130 | + | 120 × 120 | 15 | 50 | 100 | + | 320 × 180 | 15 | 140 | 280 | + | 180 × 180 | 15 | 100 | 200 | + | 240 × 180 | 15 | 120 | 240 | + | 320 × 240 | 15 | 200 | 400 | + | 240 × 240 | 15 | 140 | 280 | + | 424 × 240 | 15 | 220 | 440 | + | 640 × 360 | 15 | 400 | 800 | + | 360 × 360 | 15 | 260 | 520 | + | 640 × 360 | 30 | 600 | 1200 | + | 360 × 360 | 30 | 400 | 800 | + | 480 × 360 | 15 | 320 | 640 | + | 480 × 360 | 30 | 490 | 980 | + | 640 × 480 | 15 | 500 | 1000 | + | 480 × 480 | 15 | 400 | 800 | + | 640 × 480 | 30 | 750 | 1500 | + | 480 × 480 | 30 | 600 | 1200 | + | 848 × 480 | 15 | 610 | 1220 | + | 848 × 480 | 30 | 930 | 1860 | + | 640 × 480 | 10 | 400 | 800 | + | 1280 × 720 | 15 | 1130 | 2260 | + | 1280 × 720 | 30 | 1710 | 3420 | + | 960 × 720 | 15 | 910 | 1820 | + | 960 × 720 | 30 | 1380 | 2760 | + | 1920 × 1080 | 15 | 2080 | 4160 | + | 1920 × 1080 | 30 | 3150 | 6300 | + | 1920 × 1080 | 60 | 4780 | 6500 | + | 2560 × 1440 | 30 | 4850 | 6500 | + | 2560 × 1440 | 60 | 6500 | 6500 | + | 3840 × 2160 | 30 | 6500 | 6500 | + | 3840 × 2160 | 60 | 6500 | 6500 | + + */ + int bitrate; + /** The minimum encoding bitrate (Kbps). + + The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, Agora does not recommend changing this value. + + @note This parameter applies only to the Live-broadcast profile. + */ + int minBitrate; + /** The video orientation mode of the video: #ORIENTATION_MODE. + */ + ORIENTATION_MODE orientationMode; + /** The video encoding degradation preference under limited bandwidth: #DEGRADATION_PREFERENCE. + */ + DEGRADATION_PREFERENCE degradationPreference; + /** Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See #VIDEO_MIRROR_MODE_TYPE + + @note: The SDK disables the mirror mode by default. + */ + VIDEO_MIRROR_MODE_TYPE mirrorMode; + + VideoEncoderConfiguration( + const VideoDimensions& d, FRAME_RATE f, + int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO) + : dimensions(d), frameRate(f), minFrameRate(-1), bitrate(b), + minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m), + degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr) + {} + VideoEncoderConfiguration( + int width, int height, FRAME_RATE f, + int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO) + : dimensions(width, height), frameRate(f), + minFrameRate(-1), bitrate(b), + minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m), + degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr) + {} + VideoEncoderConfiguration() + : dimensions(640, 480) + , frameRate(FRAME_RATE_FPS_15) + , minFrameRate(-1) + , bitrate(STANDARD_BITRATE) + , minBitrate(DEFAULT_MIN_BITRATE) + , orientationMode(ORIENTATION_MODE_ADAPTIVE) + , degradationPreference(MAINTAIN_QUALITY) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + {} +}; + +/** The video properties of the user displaying the video in the CDN live. Agora supports a maximum of 17 transcoding users in a CDN streaming channel. +*/ +typedef struct TranscodingUser { + /** User ID of the user displaying the video in the CDN live. + */ + uid_t uid; + +/** Horizontal position (pixel) of the video frame relative to the top left corner. +*/ + int x; + /** Vertical position (pixel) of the video frame relative to the top left corner. + */ + int y; + /** Width (pixel) of the video frame. The default value is 360. + */ + int width; + /** Height (pixel) of the video frame. The default value is 640. + */ + int height; + + /** Layer position of the video frame. The value ranges between 0 and 100. + + - 0: (Default) Lowest + - 100: Highest + + @note + - If zOrder is beyond this range, the SDK reports #ERR_INVALID_ARGUMENT. + - As of v2.3, the SDK supports zOrder = 0. + */ + int zOrder; + /** Transparency of the video frame in CDN live. The value ranges between 0 and 1.0: + + - 0: Completely transparent + - 1.0: (Default) Opaque + */ + double alpha; + /** The audio channel of the sound. The default value is 0: + + - 0: (Default) Supports dual channels at most, depending on the upstream of the broadcaster. + - 1: The audio stream of the broadcaster uses the FL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 2: The audio stream of the broadcaster uses the FC audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 3: The audio stream of the broadcaster uses the FR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 4: The audio stream of the broadcaster uses the BL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + - 5: The audio stream of the broadcaster uses the BR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels are mixed into mono first. + + @note If your setting is not 0, you may need a specialized player. + */ + int audioChannel; + TranscodingUser() + : uid(0) + , x(0) + , y(0) + , width(0) + , height(0) + , zOrder(0) + , alpha(1.0) + , audioChannel(0) + {} + +} TranscodingUser; + +/** Image properties. + + The properties of the watermark and background images. + */ +typedef struct RtcImage { + RtcImage() : + url(NULL), + x(0), + y(0), + width(0), + height(0) + {} + /** HTTP/HTTPS URL address of the image on the broadcasting video. The maximum length of this parameter is 1024 bytes. */ + const char* url; + /** Horizontal position of the image from the upper left of the broadcasting video. */ + int x; + /** Vertical position of the image from the upper left of the broadcasting video. */ + int y; + /** Width of the image on the broadcasting video. */ + int width; + /** Height of the image on the broadcasting video. */ + int height; +} RtcImage; + +/** A struct for managing CDN live audio/video transcoding settings. +*/ +typedef struct LiveTranscoding { + /** Width of the video. The default value is 360. + * - If you push video streams to the CDN, set the value of width × height to at least 64 × 64 (px), or the SDK will adjust it to 64 × 64 (px). + * - If you push audio streams to the CDN, set the value of width × height to 0 × 0 (px). + */ + int width; + /** Height of the video. The default value is 640. + * - If you push video streams to the CDN, set the value of width × height to at least 64 × 64 (px), or the SDK will adjust it to 64 × 64 (px). + * - If you push audio streams to the CDN, set the value of width × height to 0 × 0 (px). + */ + int height; + /** Bitrate of the CDN live output video stream. The default value is 400 Kbps. + + Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range. + */ + int videoBitrate; + /** Frame rate of the output video stream set for the CDN live broadcast. The default value is 15 fps, and the value range is (0,30]. + + @note Agora adjusts all values over 30 to 30. + */ + int videoFramerate; + + /** **DEPRECATED** Latency mode: + + - true: Low latency with unassured quality. + - false: (Default) High latency with assured quality. + */ + bool lowLatency; + + /** Video GOP in frames. The default value is 30 fps. + */ + int videoGop; + /** Self-defined video codec profile: #VIDEO_CODEC_PROFILE_TYPE. + + @note If you set this parameter to other values, Agora adjusts it to the default value of 100. + */ + VIDEO_CODEC_PROFILE_TYPE videoCodecProfile; + /** The background color in RGB hex value. Value only, do not include a #. For example, 0xFFB6C1 (light pink). The default value is 0x000000 (black). + */ + unsigned int backgroundColor; + /** The number of users in the live broadcast. + */ + unsigned int userCount; + /** TranscodingUser + */ + TranscodingUser *transcodingUsers; + /** Reserved property. Extra user-defined information to send SEI for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes. + + For more information on SEI frame, see [SEI-related questions](https://docs.agora.io/en/faq/sei). + */ + const char *transcodingExtraInfo; + + /** **DEPRECATED** The metadata sent to the CDN live client defined by the RTMP or FLV metadata. + */ + const char *metadata; + /** The watermark image added to the CDN live publishing stream. + + Ensure that the format of the image is PNG. Once a watermark image is added, the audience of the CDN live publishing stream can see the watermark image. See RtcImage. + */ + RtcImage* watermark; + /** The background image added to the CDN live publishing stream. + + Once a background image is added, the audience of the CDN live publishing stream can see the background image. See RtcImage. + */ + RtcImage* backgroundImage; + /** Self-defined audio-sample rate: #AUDIO_SAMPLE_RATE_TYPE. + */ + AUDIO_SAMPLE_RATE_TYPE audioSampleRate; + /** Bitrate of the CDN live audio output stream. The default value is 48 Kbps, and the highest value is 128. + */ + int audioBitrate; + /** Agora's self-defined audio-channel types. We recommend choosing option 1 or 2. A special player is required if you choose option 3, 4, or 5: + + - 1: (Default) Mono + - 2: Two-channel stereo + - 3: Three-channel stereo + - 4: Four-channel stereo + - 5: Five-channel stereo + */ + int audioChannels; + /** Self-defined audio codec profile: #AUDIO_CODEC_PROFILE_TYPE. + */ + + AUDIO_CODEC_PROFILE_TYPE audioCodecProfile; + + + LiveTranscoding() + : width(360) + , height(640) + , videoBitrate(400) + , videoFramerate(15) + , lowLatency(false) + , videoGop(30) + , videoCodecProfile(VIDEO_CODEC_PROFILE_HIGH) + , backgroundColor(0x000000) + , userCount(0) + , transcodingUsers(NULL) + , transcodingExtraInfo(NULL) + , metadata(NULL) + , watermark(NULL) + , backgroundImage(NULL) + , audioSampleRate(AUDIO_SAMPLE_RATE_48000) + , audioBitrate(48) + , audioChannels(1) + , audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC) + {} +} LiveTranscoding; + + /** Camera capturer configuration. + */ + struct CameraCapturerConfiguration{ + + /** Camera capturer preference settings. See: #CAPTURER_OUTPUT_PREFERENCE. */ + CAPTURER_OUTPUT_PREFERENCE preference; + #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) + /** Camera direction settings (for Android/iOS only). See: #CAMERA_DIRECTION. */ + CAMERA_DIRECTION cameraDirection; + #endif + }; + +/** Configuration of the imported live broadcast voice or video stream. + */ +struct InjectStreamConfig { + /** Width of the added stream in the live broadcast. The default value is 0 (same width as the original stream). + */ + int width; + /** Height of the added stream in the live broadcast. The default value is 0 (same height as the original stream). + */ + int height; + /** Video GOP of the added stream in the live broadcast in frames. The default value is 30 fps. + */ + int videoGop; + /** Video frame rate of the added stream in the live broadcast. The default value is 15 fps. + */ + int videoFramerate; + /** Video bitrate of the added stream in the live broadcast. The default value is 400 Kbps. + + @note The setting of the video bitrate is closely linked to the resolution. If the video bitrate you set is beyond a reasonable range, the SDK sets it within a reasonable range. + */ + int videoBitrate; + /** Audio-sample rate of the added stream in the live broadcast: #AUDIO_SAMPLE_RATE_TYPE. The default value is 48000 Hz. + + @note We recommend setting the default value. + */ + AUDIO_SAMPLE_RATE_TYPE audioSampleRate; + /** Audio bitrate of the added stream in the live broadcast. The default value is 48. + + @note We recommend setting the default value. + */ + int audioBitrate; + /** Audio channels in the live broadcast. + + - 1: (Default) Mono + - 2: Two-channel stereo + + @note We recommend setting the default value. + */ + int audioChannels; + + // width / height default set to 0 means pull the stream with its original resolution + InjectStreamConfig() + : width(0) + , height(0) + , videoGop(30) + , videoFramerate(15) + , videoBitrate(400) + , audioSampleRate(AUDIO_SAMPLE_RATE_48000) + , audioBitrate(48) + , audioChannels(1) + {} +}; +/** The definition of ChannelMediaInfo. + */ +struct ChannelMediaInfo { + /** The channel name. + */ + const char* channelName; + /** The token that enables the user to join the channel. + */ + const char* token; + /** The user ID. + */ + uid_t uid; +}; + +/** The definition of ChannelMediaRelayConfiguration. + */ +struct ChannelMediaRelayConfiguration { + /** Pointer to the information of the source channel: ChannelMediaInfo. It contains the following members: + * - `channelName`: The name of the source channel. The default value is `NULL`, which means the SDK applies the name of the current channel. + * - `uid`: ID of the broadcaster whose media stream you want to relay. The default value is 0, which means the SDK generates a random UID. You must set it as 0. + * - `token`: The token for joining the source channel. It is generated with the `channelName` and `uid` you set in `srcInfo`. + * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID. + * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`, and the `uid` must be set as 0. + */ + ChannelMediaInfo *srcInfo; + /** Pointer to the information of the destination channel: ChannelMediaInfo. It contains the following members: + * - `channelName`: The name of the destination channel. + * - `uid`: ID of the broadcaster in the destination channel. The value ranges from 0 to (232-1). To avoid UID conflicts, this `uid` must be different from any other UIDs in the destination channel. The default value is 0, which means the SDK generates a random UID. + * - `token`: The token for joining the destination channel. It is generated with the `channelName` and `uid` you set in `destInfos`. + * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID. + * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`. + */ + ChannelMediaInfo *destInfos; + /** The number of destination channels. The default value is 0, and the + * value range is [0,4). Ensure that the value of this parameter + * corresponds to the number of ChannelMediaInfo structs you define in + * `destInfos`. + */ + int destCount; + + ChannelMediaRelayConfiguration() + : srcInfo(nullptr) + , destInfos(nullptr) + , destCount(0) + {} +}; + +/** **DEPRECATED** Lifecycle of the CDN live video stream. +*/ +enum RTMP_STREAM_LIFE_CYCLE_TYPE +{ + /** Bind to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds. + */ + RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1, + /** Bind to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately. + */ + RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2, +}; + +/** Content hints for screen sharing. +*/ +enum VideoContentHint +{ + /** (Default) No content hint. + */ + CONTENT_HINT_NONE, + /** Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game. + */ + CONTENT_HINT_MOTION, + /** Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slide, or text. + */ + CONTENT_HINT_DETAILS +}; + +/** The relative location of the region to the screen or window. + */ +struct Rectangle +{ + /** The horizontal offset from the top-left corner. + */ + int x; + /** The vertical offset from the top-left corner. + */ + int y; + /** The width of the region. + */ + int width; + /** The height of the region. + */ + int height; + + Rectangle(): x(0), y(0), width(0), height(0) {} + Rectangle(int xx, int yy, int ww, int hh): x(xx), y(yy), width(ww), height(hh) {} +}; + +/** **DEPRECATED** Definition of the rectangular region. */ +typedef struct Rect { + /** Y-axis of the top line. + */ + int top; + /** X-axis of the left line. + */ + int left; + /** Y-axis of the bottom line. + */ + int bottom; + /** X-axis of the right line. + */ + int right; + + Rect(): top(0), left(0), bottom(0), right(0) {} + Rect(int t, int l, int b, int r): top(t), left(l), bottom(b), right(r) {} +} Rect; + +/** The options of the watermark image to be added. */ +typedef struct WatermarkOptions { + /** Sets whether or not the watermark image is visible in the local video preview: + * - true: (Default) The watermark image is visible in preview. + * - false: The watermark image is not visible in preview. + */ + bool visibleInPreview; + /** + * The watermark position in the landscape mode. See Rectangle. + * For detailed information on the landscape mode, see [Rotate the video](https://docs.agora.io/en/Interactive%20Broadcast/rotation_guide_windows?platform=Windows). + */ + Rectangle positionInLandscapeMode; + /** + * The watermark position in the portrait mode. See Rectangle. + * For detailed information on the portrait mode, see [Rotate the video](https://docs.agora.io/en/Interactive%20Broadcast/rotation_guide_windows?platform=Windows). + */ + Rectangle positionInPortraitMode; + + WatermarkOptions() + : visibleInPreview(true) + , positionInLandscapeMode(0, 0, 0, 0) + , positionInPortraitMode(0, 0, 0, 0) + {} +} WatermarkOptions; + +/** Screen sharing encoding parameters. +*/ +struct ScreenCaptureParameters +{ + /** The maximum encoding dimensions of the shared region in terms of width × height. + + The default value is 1920 × 1080 pixels, that is, 2073600 pixels. Agora uses the value of this parameter to calculate the charges. + + If the aspect ratio is different between the encoding dimensions and screen dimensions, Agora applies the following algorithms for encoding. Suppose the encoding dimensions are 1920 x 1080: + + - If the value of the screen dimensions is lower than that of the encoding dimensions, for example, 1000 × 1000, the SDK uses 1000 × 1000 for encoding. + - If the value of the screen dimensions is higher than that of the encoding dimensions, for example, 2000 × 1500, the SDK uses the maximum value under 1920 × 1080 with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 × 1080. + */ + VideoDimensions dimensions; + /** The frame rate (fps) of the shared region. + + The default value is 5. We do not recommend setting this to a value greater than 15. + */ + int frameRate; + /** The bitrate (Kbps) of the shared region. + + The default value is 0 (the SDK works out a bitrate according to the dimensions of the current screen). + */ + int bitrate; + /** Sets whether or not to capture the mouse for screen sharing: + + - true: (Default) Capture the mouse. + - false: Do not capture the mouse. + */ + bool captureMouseCursor; + + ScreenCaptureParameters() : dimensions(1920, 1080), frameRate(5), bitrate(STANDARD_BITRATE), captureMouseCursor(true) {} + ScreenCaptureParameters(const VideoDimensions& d, int f, int b, bool c) : dimensions(d), frameRate(f), bitrate(b), captureMouseCursor(c) {} + ScreenCaptureParameters(int width, int height, int f, int b, bool c) : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(c) {} +}; + +/** Video display settings of the VideoCanvas class. +*/ +struct VideoCanvas +{ + /** Video display window (view). + */ + view_t view; + /** The rendering mode of the video view. See RENDER_MODE_TYPE + */ + int renderMode; + /** The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: + - All lowercase English letters: a to z. + - All uppercase English letters: A to Z. + - All numeric characters: 0 to 9. + - The space character. + - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @note + - The default value is the empty string "". Use the default value if the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IRtcEngine class. The `VideoCanvas` struct defines the video canvas of the user in the channel. + - If the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IChannel class, set this parameter as the `channelId` of the `IChannel` object. The `VideoCanvas` struct defines the video canvas of the user in the channel with the specified channel ID. + */ + char channelId[MAX_CHANNEL_ID_LENGTH]; + /** The user ID. */ + uid_t uid; + void *priv; // private data (underlying video engine denotes it) + /** The mirror mode of the video view. See VIDEO_MIRROR_MODE_TYPE + @note + - For the mirror mode of the local video view: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. + - For the mirror mode of the remote video view: The SDK disables the mirror mode by default. + */ + VIDEO_MIRROR_MODE_TYPE mirrorMode; + + VideoCanvas() + : view(NULL) + , renderMode(RENDER_MODE_HIDDEN) + , uid(0) + , priv(NULL) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + { + channelId[0] = '\0'; + } + VideoCanvas(view_t v, int m, uid_t u) + : view(v) + , renderMode(m) + , uid(u) + , priv(NULL) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + { + channelId[0] = '\0'; + } + VideoCanvas(view_t v, int m, const char *ch, uid_t u) + : view(v) + , renderMode(m) + , uid(u) + , priv(NULL) + , mirrorMode(VIDEO_MIRROR_MODE_AUTO) + { + strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH); + channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0'; + } + VideoCanvas(view_t v, int rm, uid_t u, VIDEO_MIRROR_MODE_TYPE mm) + : view(v) + , renderMode(rm) + , uid(u) + , priv(NULL) + , mirrorMode(mm) + { + channelId[0] = '\0'; + } + VideoCanvas(view_t v, int rm, const char *ch, uid_t u, VIDEO_MIRROR_MODE_TYPE mm) + : view(v) + , renderMode(rm) + , uid(u) + , priv(NULL) + , mirrorMode(mm) + { + strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH); + channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0'; + } +}; + +/** Image enhancement options. +*/ +struct BeautyOptions { + /** The contrast level, used with the @p lightening parameter. + */ + enum LIGHTENING_CONTRAST_LEVEL + { + /** Low contrast level. */ + LIGHTENING_CONTRAST_LOW = 0, + /** (Default) Normal contrast level. */ + LIGHTENING_CONTRAST_NORMAL, + /** High contrast level. */ + LIGHTENING_CONTRAST_HIGH + }; + +/** The contrast level, used with the @p lightening parameter. +*/ +LIGHTENING_CONTRAST_LEVEL lighteningContrastLevel; + +/** The brightness level. The value ranges from 0.0 (original) to 1.0. */ +float lighteningLevel; + +/** The sharpness level. The value ranges between 0 (original) and 1. This parameter is usually used to remove blemishes. + */ +float smoothnessLevel; + +/** The redness level. The value ranges between 0 (original) and 1. This parameter adjusts the red saturation level. +*/ +float rednessLevel; + +BeautyOptions(LIGHTENING_CONTRAST_LEVEL contrastLevel, float lightening, float smoothness, float redness) + : lighteningLevel(lightening), + smoothnessLevel(smoothness), + rednessLevel(redness), + lighteningContrastLevel(contrastLevel) {} + +BeautyOptions() + : lighteningLevel(0), + smoothnessLevel(0), + rednessLevel(0), + lighteningContrastLevel(LIGHTENING_CONTRAST_NORMAL) {} +}; + +struct UserInfo { + uid_t uid; + char userAccount[MAX_USER_ACCOUNT_LENGTH]; + UserInfo() + : uid(0) { + userAccount[0] = '\0'; + } +}; + +/** Definition of IPacketObserver. +*/ +class IPacketObserver +{ +public: +/** Definition of Packet. + */ + struct Packet + { + /** Buffer address of the sent or received data. + * @note Agora recommends that the value of buffer is more than 2048 bytes, otherwise, you may meet undefined behaviors such as a crash. + */ + const unsigned char* buffer; + /** Buffer size of the sent or received data. + */ + unsigned int size; + }; + /** Occurs when the local user sends an audio packet. + + @param packet The sent audio packet. See Packet. + @return + - true: The audio packet is sent successfully. + - false: The audio packet is discarded. + */ + virtual bool onSendAudioPacket(Packet& packet) = 0; + /** Occurs when the local user sends a video packet. + + @param packet The sent video packet. See Packet. + @return + - true: The video packet is sent successfully. + - false: The video packet is discarded. + */ + virtual bool onSendVideoPacket(Packet& packet) = 0; + /** Occurs when the local user receives an audio packet. + + @param packet The received audio packet. See Packet. + @return + - true: The audio packet is received successfully. + - false: The audio packet is discarded. + */ + virtual bool onReceiveAudioPacket(Packet& packet) = 0; + /** Occurs when the local user receives a video packet. + + @param packet The received video packet. See Packet. + @return + - true: The video packet is received successfully. + - false: The video packet is discarded. + */ + virtual bool onReceiveVideoPacket(Packet& packet) = 0; +}; + +/** The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application. The application inherits the methods of this interface class to retrieve these callbacks. + + All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling blocking APIs, such as the SendMessage method. Otherwise, the SDK may not work properly. + */ +class IRtcEngineEventHandler +{ +public: + virtual ~IRtcEngineEventHandler() {} + + /** Reports a warning during SDK runtime. + + In most cases, the application can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. For example, when losing connection with the server, the SDK may report #WARN_LOOKUP_CHANNEL_TIMEOUT and automatically try to reconnect. + + @param warn Warning code: #WARN_CODE_TYPE. + @param msg Pointer to the warning message. + */ + virtual void onWarning(int warn, const char* msg) { + (void)warn; + (void)msg; + } + + /** Reports an error during SDK runtime. + + In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue. + + For example, the SDK reports an #ERR_START_CALL error when failing to initialize a call. The application informs the user that the call initialization failed and invokes the \ref IRtcEngine::leaveChannel "leaveChannel" method to leave the channel. + + @param err Error code: #ERROR_CODE_TYPE. + @param msg Pointer to the error message. + */ + virtual void onError(int err, const char* msg) { + (void)err; + (void)msg; + } + + /** Occurs when a user joins a channel. + + This callback notifies the application that a user joins a specified channel when the application calls the \ref IRtcEngine::joinChannel "joinChannel" method. + + The channel name assignment is based on @p channelName specified in the \ref IRtcEngine::joinChannel "joinChannel" method. + + If the @p uid is not specified in the *joinChannel* method, the server automatically assigns a @p uid. + + @param channel Pointer to the channel name. + @param uid User ID of the user joining the channel. + @param elapsed Time elapsed (ms) from the user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + (void)channel; + (void)uid; + (void)elapsed; + } + + /** Occurs when a user rejoins the channel after disconnection due to network problems. + + When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. + + @param channel Pointer to the channel name. + @param uid User ID of the user rejoining the channel. + @param elapsed Time elapsed (ms) from starting to reconnect until the SDK triggers this callback. + */ + virtual void onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { + (void)channel; + (void)uid; + (void)elapsed; + } + + /** Occurs when a user leaves the channel. + + This callback notifies the application that a user leaves the channel when the application calls the \ref IRtcEngine::leaveChannel "leaveChannel" method. + + The application retrieves information, such as the call duration and statistics. + + @param stats Pointer to the statistics of the call: RtcStats. + */ + virtual void onLeaveChannel(const RtcStats& stats) { + (void)stats; + } + + /** Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa. + + This callback notifies the application of a user role switch when the application calls the \ref IRtcEngine::setClientRole "setClientRole" method. + + The SDK triggers this callback when the local user switches the user role by calling the \ref agora::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel. + @param oldRole Role that the user switches from: #CLIENT_ROLE_TYPE. + @param newRole Role that the user switches to: #CLIENT_ROLE_TYPE. + */ + virtual void onClientRoleChanged(CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) { + } + + /** Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel. + + - Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users. + - Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend limiting the number of hosts to 17. + + The SDK triggers this callback under one of the following circumstances: + - A remote user/host joins the channel by calling the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + - A remote user switches the user role to the host by calling the \ref agora::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel. + - A remote user/host rejoins the channel after a network interruption. + - The host injects an online media stream into the channel by calling the \ref agora::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method. + + @note In the Live-broadcast profile: + - The host receives this callback when another host joins the channel. + - The audience in the channel receives this callback when a new host joins the channel. + - When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams. + + @param uid User ID of the user or host joining the channel. + @param elapsed Time delay (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onUserJoined(uid_t uid, int elapsed) { + (void)uid; + (void)elapsed; + } + + /** Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + + Reasons why the user is offline: + + - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel. + - Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using a signaling system for more reliable offline detection. + + @param uid User ID of the user leaving the channel or going offline. + @param reason Reason why the user is offline: #USER_OFFLINE_REASON_TYPE. + */ + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { + (void)uid; + (void)reason; + } + + /** Reports the last mile network quality of the local user once every two seconds before the user joins the channel. + + Last mile refers to the connection between the local device and Agora's edge server. After the application calls the \ref IRtcEngine::enableLastmileTest "enableLastmileTest" method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel. + + @param quality The last mile network quality: #QUALITY_TYPE. + */ + virtual void onLastmileQuality(int quality) { + (void)quality; + } + + /** Reports the last-mile network probe result. + + The SDK triggers this callback within 30 seconds after the app calls the \ref agora::rtc::IRtcEngine::startLastmileProbeTest "startLastmileProbeTest" method. + + @param result The uplink and downlink last-mile network probe test result. See LastmileProbeResult. + */ + virtual void onLastmileProbeResult(const LastmileProbeResult& result) { + (void)result; + } + + /** **DEPRECATED** Occurs when the connection between the SDK and the server is interrupted. + + Deprecated as of v2.3.2. Replaced by the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED)" callback. + + The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established. + + After triggering this callback, the SDK tries reconnecting to the server. You can use this callback to implement pop-up reminders. + + This callback is different from \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost": + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. + + If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. + + */ + virtual void onConnectionInterrupted() {} + + /** Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. + + The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the \ref IRtcEngine::joinChannel "joinChannel" method, whether or not it is in the channel. + + This callback is different from \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted": + + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. + - The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. + + If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. + + */ + virtual void onConnectionLost() {} + + /** **DEPRECATED** Deprecated as of v2.3.2. Replaced by the \ref agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_FAILED, CONNECTION_CHANGED_BANNED_BY_SERVER)" callback. + + Occurs when your connection is banned by the Agora Server. + */ + virtual void onConnectionBanned() {} + + /** Occurs when a method is executed by the SDK. + + @param err The error code (#ERROR_CODE_TYPE) returned by the SDK when a method call fails. If the SDK returns 0, then the method call is successful. + @param api Pointer to the method executed by the SDK. + @param result Pointer to the result of the method call. + */ + virtual void onApiCallExecuted(int err, const char* api, const char* result) { + (void)err; + (void)api; + (void)result; + } + + /** Occurs when the token expires. + + After a token is specified by calling the \ref IRtcEngine::joinChannel "joinChannel" method, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server. + + This callback notifies the application to generate a new token. Call the \ref IRtcEngine::renewToken "renewToken" method to renew the token. + */ + virtual void onRequestToken() { + } + + /** Occurs when the token expires in 30 seconds. + + The user becomes offline if the token used in the \ref IRtcEngine::joinChannel "joinChannel" method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the \ref IRtcEngine::renewToken "renewToken" method to pass the new token to the SDK. + + @param token Pointer to the token that expires in 30 seconds. + */ + virtual void onTokenPrivilegeWillExpire(const char* token) { + (void)token; + } + + /** **DEPRECATED** Reports the statistics of the audio stream from each remote user/host. + + Deprecated as of v2.3.2. Use the \ref agora::rtc::IRtcEngineEventHandler::onRemoteAudioStats "onRemoteAudioStats" callback instead. + + The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple users/hosts sending audio streams, the SDK triggers this callback as many times. + + @param uid User ID of the speaker. + @param quality Audio quality of the user: #QUALITY_TYPE. + @param delay Time delay (ms) of sending the audio packet from the sender to the receiver, including the time delay of audio sampling pre-processing, transmission, and the jitter buffer. + @param lost Packet loss rate (%) of the audio packet sent from the sender to the receiver. + */ + virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) { + (void)uid; + (void)quality; + (void)delay; + (void)lost; + } + + /** Reports the statistics of the current call. + + The SDK triggers this callback once every two seconds after the user joins the channel. + + @param stats Statistics of the RtcEngine: RtcStats. + */ + virtual void onRtcStats(const RtcStats& stats) { + (void)stats; + } + + /** Reports the last mile network quality of each user in the channel once every two seconds. + + Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times. + + @param uid User ID. The network quality of the user with this @p uid is reported. If @p uid is 0, the local network quality is reported. + @param txQuality Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. @p txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the Live-broadcast profile, but may be inadequate for resolutions higher than 1280 × 720. See #QUALITY_TYPE. + @param rxQuality Downlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE. + */ + virtual void onNetworkQuality(uid_t uid, int txQuality, int rxQuality) { + (void)uid; + (void)txQuality; + (void)rxQuality; + } + + /** Reports the statistics of the local video stream. + * + * The SDK triggers this callback once every two seconds for each + * user/host. If there are multiple users/hosts in the channel, the SDK + * triggers this callback as many times. + * + * @note + * If you have called the \ref agora::rtc::IRtcEngine::enableDualStream + * "enableDualStream" method, the \ref onLocalVideoStats() + * "onLocalVideoStats" callback reports the statistics of the high-video + * stream (high bitrate, and high-resolution video stream). + * + * @param stats Statistics of the local video stream. See LocalVideoStats. + */ + virtual void onLocalVideoStats(const LocalVideoStats& stats) { + (void)stats; + } + + /** Reports the statistics of the video stream from each remote user/host. + * + * The SDK triggers this callback once every two seconds for each remote + * user/host. If a channel includes multiple remote users, the SDK + * triggers this callback as many times. + * + * @param stats Statistics of the remote video stream. See + * RemoteVideoStats. + */ + virtual void onRemoteVideoStats(const RemoteVideoStats& stats) { + (void)stats; + } + + /** Reports the statistics of the local audio stream. + * + * The SDK triggers this callback once every two seconds. + * + * @param stats The statistics of the local audio stream. + * See LocalAudioStats. + */ + virtual void onLocalAudioStats(const LocalAudioStats& stats) { + (void)stats; + } + + /** Reports the statistics of the audio stream from each remote user/host. + + This callback replaces the \ref agora::rtc::IRtcEngineEventHandler::onAudioQuality "onAudioQuality" callback. + + The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. + + @param stats Pointer to the statistics of the received remote audio streams. See RemoteAudioStats. + */ + virtual void onRemoteAudioStats(const RemoteAudioStats& stats) { + (void)stats; + } + + /** Occurs when the local audio state changes. + * + * This callback indicates the state change of the local audio stream, + * including the state of the audio recording and encoding, and allows + * you to troubleshoot issues when exceptions occur. + * + * @note + * When the state is #LOCAL_AUDIO_STREAM_STATE_FAILED (3), see the `error` + * parameter for details. + * + * @param state State of the local audio. See #LOCAL_AUDIO_STREAM_STATE. + * @param error The error information of the local audio. + * See #LOCAL_AUDIO_STREAM_ERROR. + */ + virtual void onLocalAudioStateChanged(LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) { + (void)state; + (void)error; + } + + /** Occurs when the remote audio state changes. + * + * This callback indicates the state change of the remote audio stream. + * + * @param uid ID of the remote user whose audio state changes. + * @param state State of the remote audio. See #REMOTE_AUDIO_STATE. + * @param reason The reason of the remote audio state change. + * See #REMOTE_AUDIO_STATE_REASON. + * @param elapsed Time elapsed (ms) from the local user calling the + * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK + * triggers this callback. + */ + virtual void onRemoteAudioStateChanged(uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) { + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + + /** Reports which users are speaking, the speakers' volume and whether the local user is speaking. + + This callback reports the IDs and volumes of the loudest speakers at the moment in the channel, and whether the local user is speaking. + + By default, this callback is disabled. You can enable it by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. + Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not. + + The SDK triggers two independent `onAudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers. + For more information, see the detailed parameter descriptions. + + @note + - To enable the voice activity detection of the local user, ensure that you set `report_vad`(true) in the `enableAudioVolumeIndication` method. + - Calling the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method affects the SDK's behavior: + - If the local user calls the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method, the SDK stops triggering the local user's callback. + - 20 seconds after a remote speaker calls the *muteLocalAudioStream* method, the remote speakers' callback excludes this remote user's information; 20 seconds after all remote users call the *muteLocalAudioStream* method, the SDK stops triggering the remote speakers' callback. + - An empty @p speakers array in the *onAudioVolumeIndication* callback suggests that no remote user is speaking at the moment. + + @param speakers A pointer to AudioVolumeInfo: + - In the local user's callback, this struct contains the following members: + - `uid` = 0, + - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and + - `vad`, which reports the voice activity status of the local user. + - In the remote speakers' callback, this array contains the following members: + - `uid` of the remote speaker, + - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and + - `vad` = 0. + + An empty speakers array in the callback indicates that no remote user is speaking at the moment. + @param speakerNumber Total number of speakers. The value range is [0, 3]. + - In the local user’s callback, `speakerNumber` = 1, regardless of whether the local user speaks or not. + - In the remote speakers' callback, the callback reports the IDs and volumes of the three loudest speakers when there are more than three remote users in the channel, and `speakerNumber` = 3. + @param totalVolume Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume). + - In the local user’s callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of the local user. + - In the remote speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of all the remote speakers. + */ + virtual void onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume) { + (void)speakers; + (void)speakerNumber; + (void)totalVolume; + } + + /** Reports which user is the loudest speaker. + + If the user enables the audio volume indication by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method, this callback returns the @p uid of the active speaker detected by the audio volume detection module of the SDK. + + @note + - To receive this callback, you need to call the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. + - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. + + @param uid User ID of the active speaker. A @p uid of 0 represents the local user. + */ + virtual void onActiveSpeaker(uid_t uid) { + (void)uid; + } + + /** **DEPRECATED** Occurs when the video stops playing. + + The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing. + + Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_STOPPED(0) in the \ref agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead. + */ + virtual void onVideoStopped() {} + + /** Occurs when the first local video frame is displayed/rendered on the local video view. + + @param width Width (px) of the first local video frame. + @param height Height (px) of the first local video frame. + @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + If you call the \ref IRtcEngine::startPreview "startPreview" method before calling the *joinChannel* method, then @p elapsed is the time elapsed from calling the *startPreview* method until the SDK triggers this callback. + */ + virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) { + (void)width; + (void)height; + (void)elapsed; + } + + /** Occurs when the first remote video frame is received and decoded. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STARTING (1) + * - #REMOTE_VIDEO_STATE_DECODING (2) + * + * This callback is triggered in either of the following scenarios: + * + * - The remote user joins the channel and sends the video stream. + * - The remote user stops sending the video stream and re-sends it after + * 15 seconds. Reasons for such an interruption include: + * - The remote user leaves the channel. + * - The remote user drops offline. + * - The remote user calls the + * \ref agora::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" + * method to stop sending the video stream. + * - The remote user calls the + * \ref agora::rtc::IRtcEngine::disableVideo "disableVideo" method to + * disable video. + * + * The application can configure the user view settings in this callback. + * + * @param uid User ID of the remote user sending the video stream. + * @param width Width (px) of the video stream. + * @param height Height (px) of the video stream. + * @param elapsed Time elapsed (ms) from the local user calling the + * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK + * triggers this callback. + */ + virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) { + (void)uid; + (void)width; + (void)height; + (void)elapsed; + } + + /** Occurs when the first remote video frame is rendered. + + The SDK triggers this callback when the first frame of the remote video is displayed in the user's video window. The application can retrieve the time elapsed from a user joining the channel until the first video frame is displayed. + + @param uid User ID of the remote user sending the video stream. + @param width Width (px) of the video frame. + @param height Height (px) of the video stream. + @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) { + (void)uid; + (void)width; + (void)height; + (void)elapsed; + } + + /** Occurs when a remote user's audio stream playback pauses/resumes. + + The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method. + @note This callback returns invalid when the number of users in a channel exceeds 20. + + @param uid User ID of the remote user. + @param muted Whether the remote user's audio stream is muted/unmuted: + - true: Muted. + - false: Unmuted. + */ + virtual void onUserMuteAudio(uid_t uid, bool muted) { + (void)uid; + (void)muted; + } + + /** Occurs when a remote user's video stream playback pauses/resumes. + * + * You can also use the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STOPPED (0) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). + * - #REMOTE_VIDEO_STATE_DECODING (2) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). + * + * The SDK triggers this callback when the remote user stops or resumes + * sending the video stream by calling the + * \ref agora::rtc::IRtcEngine::muteLocalVideoStream + * "muteLocalVideoStream" method. + * + * @note This callback returns invalid when the number of users in a + * channel exceeds 20. + * + * @param uid User ID of the remote user. + * @param muted Whether the remote user's video stream playback is + * paused/resumed: + * - true: Paused. + * - false: Resumed. + */ + virtual void onUserMuteVideo(uid_t uid, bool muted) { + (void)uid; + (void)muted; + } + + /** Occurs when a specific remote user enables/disables the video + * module. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STOPPED (0) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). + * - #REMOTE_VIDEO_STATE_DECODING (2) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). + * + * Once the video module is disabled, the remote user can only use a + * voice call. The remote user cannot send or receive any video from + * other users. + * + * The SDK triggers this callback when the remote user enables or disables + * the video module by calling the + * \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" or + * \ref agora::rtc::IRtcEngine::disableVideo "disableVideo" method. + * + * @note This callback returns invalid when the number of users in a + * channel exceeds 20. + * + * @param uid User ID of the remote user. + * @param enabled Whether the remote user enables/disables the video + * module: + * - true: Enable. The remote user can enter a video session. + * - false: Disable. The remote user can only enter a voice session, and + * cannot send or receive any video stream. + */ + virtual void onUserEnableVideo(uid_t uid, bool enabled) { + (void)uid; + (void)enabled; + } + + /** Occurs when the audio device state changes. + + This callback notifies the application that the system's audio device state is changed. For example, a headset is unplugged from the device. + + @param deviceId Pointer to the device ID. + @param deviceType Device type: #MEDIA_DEVICE_TYPE. + @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE. + */ + virtual void onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) { + (void)deviceId; + (void)deviceType; + (void)deviceState; + } + + /** Occurs when the volume of the playback device, microphone, or application changes. + + @param deviceType Device type: #MEDIA_DEVICE_TYPE. + @param volume Volume of the device. The value ranges between 0 and 255. + @param muted + - true: The audio device is muted. + - false: The audio device is not muted. + */ + virtual void onAudioDeviceVolumeChanged(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) { + (void)deviceType; + (void)volume; + (void)muted; + } + + /** **DEPRECATED** Occurs when the camera turns on and is ready to capture the video. + + If the camera fails to turn on, fix the error reported in the \ref IRtcEngineEventHandler::onError "onError" callback. + + Deprecated as of v2.4.1. Use #LOCAL_VIDEO_STREAM_STATE_CAPTURING (1) in the \ref agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead. + */ + virtual void onCameraReady() {} + + /** Occurs when the camera focus area changes. + + The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocusPositionInPreview method. + + @note This callback is for Android and iOS only. + + @param x x coordinate of the changed camera focus area. + @param y y coordinate of the changed camera focus area. + @param width Width of the changed camera focus area. + @param height Height of the changed camera focus area. + */ + virtual void onCameraFocusAreaChanged(int x, int y, int width, int height) { + (void)x; + (void)y; + (void)width; + (void)height; + } + + /** Occurs when the camera exposure area changes. + + The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method. + + @note This callback is for Android and iOS only. + + @param x x coordinate of the changed camera exposure area. + @param y y coordinate of the changed camera exposure area. + @param width Width of the changed camera exposure area. + @param height Height of the changed camera exposure area. + */ + virtual void onCameraExposureAreaChanged(int x, int y, int width, int height) { + (void)x; + (void)y; + (void)width; + (void)height; + } + + /** Occurs when the audio mixing file playback finishes. + + **DEPRECATED** use onAudioMixingStateChanged instead. + + You can start an audio mixing file playback by calling the \ref IRtcEngine::startAudioMixing "startAudioMixing" method. The SDK triggers this callback when the audio mixing file playback finishes. + + If the *startAudioMixing* method call fails, an error code returns in the \ref IRtcEngineEventHandler::onError "onError" callback. + + */ + virtual void onAudioMixingFinished() { + } + + /** Occurs when the state of the local user's audio mixing file changes. + + - When the audio mixing file plays, pauses playing, or stops playing, this callback returns 710, 711, or 713 in @p state, and 0 in @p errorCode. + - When exceptions occur during playback, this callback returns 714 in @p state and an error in @p errorCode. + - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701. + + @param state The state code. See #AUDIO_MIXING_STATE_TYPE. + @param errorCode The error code. See #AUDIO_MIXING_ERROR_TYPE. + */ + virtual void onAudioMixingStateChanged(AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode){ + } + /** Occurs when a remote user starts audio mixing. + + When a remote user calls \ref IRtcEngine::startAudioMixing "startAudioMixing" to play the background music, the SDK reports this callback. + */ + virtual void onRemoteAudioMixingBegin() { + } + /** Occurs when a remote user finishes audio mixing. + */ + virtual void onRemoteAudioMixingEnd() { + } + + /** Occurs when the local audio effect playback finishes. + + The SDK triggers this callback when the local audio effect file playback finishes. + + @param soundId ID of the local audio effect. Each local audio effect has a unique ID. + */ + virtual void onAudioEffectFinished(int soundId) { + } + + + /** + Occurs when the SDK decodes the first remote audio frame for playback. + + This callback is triggered in either of the following scenarios: + + - The remote user joins the channel and sends the audio stream. + - The remote user stops sending the audio stream and re-sends it after 15 seconds. Reasons for such an interruption include: + - The remote user leaves channel. + - The remote user drops offline. + - The remote user calls the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method to stop sending the local audio stream. + - The remote user calls the \ref agora::rtc::IRtcEngine::disableAudio "disableAudio" method to disable audio. + + @param uid User ID of the remote user sending the audio stream. + @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. + */ + virtual void onFirstRemoteAudioDecoded(uid_t uid, int elapsed) { + (void)uid; + (void)elapsed; + } + + /** Occurs when the video device state changes. + + @note On a Windows device with an external camera for video capturing, the video disables once the external camera is unplugged. + + @param deviceId Pointer to the device ID of the video device that changes state. + @param deviceType Device type: #MEDIA_DEVICE_TYPE. + @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE. + */ + virtual void onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) { + (void)deviceId; + (void)deviceType; + (void)deviceState; + } + + /** Occurs when the local video stream state changes. + + This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. + + @note For some device models, the SDK will not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment. + + @param localVideoState State type #LOCAL_VIDEO_STREAM_STATE. When the state is LOCAL_VIDEO_STREAM_STATE_FAILED (3), see the `error` parameter for details. + @param error The detailed error information: #LOCAL_VIDEO_STREAM_ERROR. + */ + virtual void onLocalVideoStateChanged(LOCAL_VIDEO_STREAM_STATE localVideoState, LOCAL_VIDEO_STREAM_ERROR error) { + (void)localVideoState; + (void)error; + } + + /** Occurs when the video size or rotation of a specified user changes. + + @param uid User ID of the remote user or local user (0) whose video size or rotation changes. + @param width New width (pixels) of the video. + @param height New height (pixels) of the video. + @param rotation New rotation of the video [0 to 360). + */ + virtual void onVideoSizeChanged(uid_t uid, int width, int height, int rotation) { + (void)uid; + (void)width; + (void)height; + (void)rotation; + } + /** Occurs when the remote video state changes. + * + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video. See #REMOTE_VIDEO_STATE. + * @param reason The reason of the remote video state change. See + * #REMOTE_VIDEO_STATE_REASON. + * @param elapsed Time elapsed (ms) from the local user calling the + * \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method until the + * SDK triggers this callback. + */ + virtual void onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) { + (void)uid; + (void)state; + (void)reason; + (void)elapsed; + } + + /** Occurs when a specified remote user enables/disables the local video + * capturing function. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback + * with the following parameters: + * - #REMOTE_VIDEO_STATE_STOPPED (0) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). + * - #REMOTE_VIDEO_STATE_DECODING (2) and + * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). + * + * This callback is only applicable to the scenario when the user only + * wants to watch the remote video without sending any video stream to the + * other user. + * + * The SDK triggers this callback when the remote user resumes or stops + * capturing the video stream by calling the + * \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method. + * + * @param uid User ID of the remote user. + * @param enabled Whether the specified remote user enables/disables the + * local video capturing function: + * - true: Enable. Other users in the channel can see the video of this + * remote user. + * - false: Disable. Other users in the channel can no longer receive the + * video stream from this remote user, while this remote user can still + * receive the video streams from other users. + */ + virtual void onUserEnableLocalVideo(uid_t uid, bool enabled) { + (void)uid; + (void)enabled; + } + +// virtual void onStreamError(int streamId, int code, int parameter, const char* message, size_t length) {} + /** Occurs when the local user receives the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param data Pointer to the data received by the local user. + @param length Length of the data in bytes. + */ + virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length) { + (void)uid; + (void)streamId; + (void)data; + (void)length; + } + + /** Occurs when the local user does not receive the data stream from the remote user within five seconds. + + The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. + @param uid User ID of the remote user sending the message. + @param streamId Stream ID. + @param code Error code: #ERROR_CODE_TYPE. + @param missed Number of lost messages. + @param cached Number of incoming cached messages when the data stream is interrupted. + */ + virtual void onStreamMessageError(uid_t uid, int streamId, int code, int missed, int cached) { + (void)uid; + (void)streamId; + (void)code; + (void)missed; + (void)cached; + } + + /** Occurs when the media engine loads.*/ + virtual void onMediaEngineLoadSuccess() { + } + /** Occurs when the media engine call starts.*/ + virtual void onMediaEngineStartCallSuccess() { + } + + /** Occurs when the state of the media stream relay changes. + * + * The SDK returns the state of the current media relay with any error + * message. + * + * @param state The state code in #CHANNEL_MEDIA_RELAY_STATE. + * @param code The error code in #CHANNEL_MEDIA_RELAY_ERROR. + */ + virtual void onChannelMediaRelayStateChanged(CHANNEL_MEDIA_RELAY_STATE state,CHANNEL_MEDIA_RELAY_ERROR code) { + } + + /** Reports events during the media stream relay. + * + * @param code The event code in #CHANNEL_MEDIA_RELAY_EVENT. + */ + virtual void onChannelMediaRelayEvent(CHANNEL_MEDIA_RELAY_EVENT code) { + } + + /** Occurs when the engine sends the first local audio frame. + + @param elapsed Time elapsed (ms) from the local user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. + */ + virtual void onFirstLocalAudioFrame(int elapsed) { + (void)elapsed; + } + + /** Occurs when the engine receives the first audio frame from a specific remote user. + + @param uid User ID of the remote user. + @param elapsed Time elapsed (ms) from the remote user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. + */ + virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) { + (void)uid; + (void)elapsed; + } + + /** + Occurs when the state of the RTMP streaming changes. + + The SDK triggers this callback to report the result of the local user calling the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" or \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. + + This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the *errCode* parameter. + + @param url The RTMP URL address. + @param state The RTMP streaming state. See: #RTMP_STREAM_PUBLISH_STATE. + @param errCode The detailed error information for streaming. See: #RTMP_STREAM_PUBLISH_ERROR. + */ + virtual void onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { + (void) url; + (void) state; + (void) errCode; + } + + /** Reports the result of calling the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. (CDN live only.) + + @param url The RTMP URL address. + @param error Error code: #ERROR_CODE_TYPE. Main errors include: + - #ERR_OK (0): The publishing succeeds. + - #ERR_FAILED (1): The publishing fails. + - #ERR_INVALID_ARGUMENT (2): Invalid argument used. If, for example, you did not call \ref agora::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" to configure LiveTranscoding before calling \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl", the SDK reports #ERR_INVALID_ARGUMENT. + - #ERR_TIMEDOUT (10): The publishing timed out. + - #ERR_ALREADY_IN_USE (19): The chosen URL address is already in use for CDN live streaming. + - #ERR_RESOURCE_LIMITED (22): The backend system does not have enough resources for the CDN live streaming. + - #ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH (130): You cannot publish an encrypted stream. + - #ERR_PUBLISH_STREAM_CDN_ERROR (151) + - #ERR_PUBLISH_STREAM_NUM_REACH_LIMIT (152) + - #ERR_PUBLISH_STREAM_NOT_AUTHORIZED (153) + - #ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR (154) + - #ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED (156) + */ + virtual void onStreamPublished(const char *url, int error) { + (void)url; + (void)error; + } + /** Reports the result of calling the \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. (CDN live only.) + + This callback indicates whether you have successfully removed an RTMP stream from the CDN. + + @param url The RTMP URL address. + */ + virtual void onStreamUnpublished(const char *url) { + (void)url; + } +/** Occurs when the publisher's transcoding is updated. + * + * When the `LiveTranscoding` class in the \ref agora::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information to the local host. + * + * @note If you call the `setLiveTranscoding` method to set the LiveTranscoding class for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + * + */ + virtual void onTranscodingUpdated() { + } + /** Occurs when a voice or video stream URL address is added to a live broadcast. + + @param url Pointer to the URL address of the externally injected stream. + @param uid User ID. + @param status State of the externally injected stream: #INJECT_STREAM_STATUS. + */ + virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) { + (void)url; + (void)uid; + (void)status; + } + + /** Occurs when the local audio route changes. + + The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device. + + @note This callback is for Android and iOS only. + + @param routing Audio output routing. See: #AUDIO_ROUTE_TYPE. + */ + virtual void onAudioRouteChanged(AUDIO_ROUTE_TYPE routing) { + (void)routing; + } + + /** Occurs when the locally published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve. + + If you call \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" and set *option* as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. + + @param isFallbackOrRecover Whether the locally published stream falls back to audio-only or switches back to the video: + - true: The locally published stream falls back to audio-only due to poor network conditions. + - false: The locally published stream switches back to the video after the network conditions improve. + */ + virtual void onLocalPublishFallbackToAudioOnly(bool isFallbackOrRecover) { + (void)isFallbackOrRecover; + } + + /** Occurs when the remote media stream falls back to audio-only stream + * due to poor network conditions or switches back to the video stream + * after the network conditions improve. + * + * If you call + * \ref IRtcEngine::setRemoteSubscribeFallbackOption + * "setRemoteSubscribeFallbackOption" and set + * @p option as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this + * callback when the remote media stream falls back to audio-only mode due + * to poor uplink conditions, or when the remote media stream switches + * back to the video after the uplink network condition improves. + * + * @note Once the remote media stream switches to the low stream due to + * poor network conditions, you can monitor the stream switch between a + * high and low stream in the RemoteVideoStats callback. + * + * @param uid ID of the remote user sending the stream. + * @param isFallbackOrRecover Whether the remotely subscribed media stream + * falls back to audio-only or switches back to the video: + * - true: The remotely subscribed media stream falls back to audio-only + * due to poor network conditions. + * - false: The remotely subscribed media stream switches back to the + * video stream after the network conditions improved. + */ + virtual void onRemoteSubscribeFallbackToAudioOnly(uid_t uid, bool isFallbackOrRecover) { + (void)uid; + (void)isFallbackOrRecover; + } + + /** Reports the transport-layer statistics of each remote audio stream. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteAudioStats() "onRemoteAudioStats" callback. + * + * This callback reports the transport-layer statistics, such as the + * packet loss rate and network time delay, once every two seconds after + * the local user receives an audio packet from a remote user. + * + * @param uid User ID of the remote user sending the audio packet. + * @param delay Network time delay (ms) from the remote user sending the + * audio packet to the local user. + * @param lost Packet loss rate (%) of the audio packet sent from the + * remote user. + * @param rxKBitRate Received bitrate (Kbps) of the audio packet sent + * from the remote user. + */ + virtual void onRemoteAudioTransportStats( + uid_t uid, unsigned short delay, unsigned short lost, + unsigned short rxKBitRate) { + (void)uid; + (void)delay; + (void)lost; + (void)rxKBitRate; + } + + /** Reports the transport-layer statistics of each remote video stream. + * + * @deprecated + * This callback is deprecated and replaced by the + * \ref onRemoteVideoStats() "onRemoteVideoStats" callback. + * + * This callback reports the transport-layer statistics, such as the + * packet loss rate and network time delay, once every two seconds after + * the local user receives a video packet from a remote user. + * + * @param uid User ID of the remote user sending the video packet. + * @param delay Network time delay (ms) from the remote user sending the + * video packet to the local user. + * @param lost Packet loss rate (%) of the video packet sent from the + * remote user. + * @param rxKBitRate Received bitrate (Kbps) of the video packet sent + * from the remote user. + */ + virtual void onRemoteVideoTransportStats( + uid_t uid, unsigned short delay, unsigned short lost, + unsigned short rxKBitRate) { + (void)uid; + (void)delay; + (void)lost; + (void)rxKBitRate; + } + + /** **DEPRECATED** Occurs when the microphone is enabled/disabled. + * + * The \ref onMicrophoneEnabled() "onMicrophoneEnabled" callback is + * deprecated. Use #LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or + * #LOCAL_AUDIO_STREAM_STATE_RECORDING (1) in the + * \ref onLocalAudioStateChanged() "onLocalAudioStateChanged" callback + * instead. + * + * The SDK triggers this callback when the local user resumes or stops + * capturing the local audio stream by calling the + * \ref agora::rtc::IRtcEngine::enableLocalAudio "enbaleLocalAudio" method. + * + * @param enabled Whether the microphone is enabled/disabled: + * - true: Enabled. + * - false: Disabled. + */ + virtual void onMicrophoneEnabled(bool enabled) { + (void)enabled; + } + /** Occurs when the connection state between the SDK and the server changes. + + @param state See #CONNECTION_STATE_TYPE. + @param reason See #CONNECTION_CHANGED_REASON_TYPE. + */ + virtual void onConnectionStateChanged( + CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) { + (void)state; + (void)reason; + } + + /** Occurs when the local network type changes. + + When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions. + + @param type See #NETWORK_TYPE. + */ + virtual void onNetworkTypeChanged(NETWORK_TYPE type) { + (void)type; + } + /** Occurs when the local user successfully registers a user account by calling the \ref agora::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method or joins a channel by calling the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method.This callback reports the user ID and user account of the local user. + + @param uid The ID of the local user. + @param userAccount The user account of the local user. + */ + virtual void onLocalUserRegistered(uid_t uid, const char* userAccount) { + (void)uid; + (void)userAccount; + } + /** Occurs when the SDK gets the user ID and user account of the remote user. + + After a remote user joins the channel, the SDK gets the UID and user account of the remote user, + caches them in a mapping table object (`userInfo`), and triggers this callback on the local client. + + @param uid The ID of the remote user. + @param info The `UserInfo` object that contains the user ID and user account of the remote user. + */ + virtual void onUserInfoUpdated(uid_t uid, const UserInfo& info) { + (void)uid; + (void)info; + } +}; + +/** +* Video device collection methods. + + The IVideoDeviceCollection interface class retrieves the video device information. +*/ +class IVideoDeviceCollection +{ +protected: + virtual ~IVideoDeviceCollection(){} +public: + /** Retrieves the total number of the indexed video devices in the system. + + @return Total number of the indexed video devices: + */ + virtual int getCount() = 0; + + /** Retrieves a specified piece of information about an indexed video device. + + @param index The specified index of the video device that must be less than the return value of \ref IVideoDeviceCollection::getCount "getCount". + @param deviceName Pointer to the video device name. + @param deviceId Pointer to the video device ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Sets the device with the device ID. + + @param deviceId Device ID of the device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Releases all IVideoDeviceCollection resources. + */ + virtual void release() = 0; +}; + +/** Video device management methods. + + The IVideoDeviceManager interface class tests the video device interfaces. Instantiate an AVideoDeviceManager class to retrieve an IVideoDeviceManager interface. +*/ +class IVideoDeviceManager +{ +protected: + virtual ~IVideoDeviceManager(){} +public: + + /** Enumerates the video devices. + + This method returns an IVideoDeviceCollection object including all video devices in the system. With the IVideoDeviceCollection object, the application can enumerate the video devices. The application must call the \ref IVideoDeviceCollection::release "release" method to release the returned object after using it. + + @return + - An IVideoDeviceCollection object including all video devices in the system: Success. + - NULL: Failure. + */ + virtual IVideoDeviceCollection* enumerateVideoDevices() = 0; + + /** Starts the video-capture device test. + + This method tests whether the video-capture device works properly. Before calling this method, ensure that you have already called the \ref IRtcEngine::enableVideo "enableVideo" method, and the window handle (*hwnd*) parameter is valid. + + @param hwnd The window handle used to display the screen. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startDeviceTest(view_t hwnd) = 0; + + /** Stops the video-capture device test. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopDeviceTest() = 0; + + /** Sets a device with the device ID. + + @param deviceId Pointer to the video-capture device ID. Call the \ref IVideoDeviceManager::enumerateVideoDevices "enumerateVideoDevices" method to retrieve it. + + @note Plugging or unplugging the device does not change the device ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the video-capture device that is in use. + + @param deviceId Pointer to the video-capture device ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Releases all IVideoDeviceManager resources. + */ + virtual void release() = 0; +}; + +/** Audio device collection methods. + +The IAudioDeviceCollection interface class retrieves device-related information. +*/ +class IAudioDeviceCollection +{ +protected: + virtual ~IAudioDeviceCollection(){} +public: + + /** Retrieves the total number of audio playback or audio recording devices. + + @note You must first call the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" or \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method before calling this method to return the number of audio playback or audio recording devices. + + @return Number of audio playback or audio recording devices. + */ + virtual int getCount() = 0; + + /** Retrieves a specified piece of information about an indexed audio device. + + @param index The specified index that must be less than the return value of \ref IAudioDeviceCollection::getCount "getCount". + @param deviceName Pointer to the audio device name. + @param deviceId Pointer to the audio device ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Specifies a device with the device ID. + + @param deviceId Pointer to the device ID of the device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Sets the volume of the application. + + @param volume Application volume. The value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setApplicationVolume(int volume) = 0; + + /** Retrieves the volume of the application. + + @param volume Pointer to the application volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getApplicationVolume(int& volume) = 0; + + /** Mutes the application. + + @param mute Sets whether to mute/unmute the application: + - true: Mute the application. + - false: Unmute the application. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setApplicationMute(bool mute) = 0; + /** Gets the mute state of the application. + + @param mute Pointer to whether the application is muted/unmuted. + - true: The application is muted. + - false: The application is not muted. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int isApplicationMute(bool& mute) = 0; + + /** Releases all IAudioDeviceCollection resources. + */ + virtual void release() = 0; +}; +/** Audio device management methods. + + The IAudioDeviceManager interface class allows for audio device interface testing. Instantiate an AAudioDeviceManager class to retrieve the IAudioDeviceManager interface. +*/ +class IAudioDeviceManager +{ +protected: + virtual ~IAudioDeviceManager(){} +public: + + /** Enumerates the audio playback devices. + + This method returns an IAudioDeviceCollection object that includes all audio playback devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio playback devices. + + @note The application must call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it. + + @return + - Success: Returns an IAudioDeviceCollection object that includes all audio playback devices in the system. For wireless Bluetooth headset devices with master and slave headsets, the master headset is the playback device. + - Returns NULL: Failure. + */ + virtual IAudioDeviceCollection* enumeratePlaybackDevices() = 0; + + /** Enumerates the audio recording devices. + + This method returns an IAudioDeviceCollection object that includes all audio recording devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio recording devices. + + @note The application needs to call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it. + + @return + - Returns an IAudioDeviceCollection object that includes all audio recording devices in the system: Success. + - Returns NULL: Failure. + */ + virtual IAudioDeviceCollection* enumerateRecordingDevices() = 0; + + /** Sets the audio playback device using the device ID. + + @note Plugging or unplugging the audio device does not change the device ID. + + @param deviceId Device ID of the audio playback device, retrieved by calling the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Sets the audio recording device using the device ID. + + @param deviceId Device ID of the audio recording device, retrieved by calling the \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method. + + @note Plugging or unplugging the audio device does not change the device ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Starts the audio playback device test. + + This method tests if the playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly. + + @param testAudioFilePath Pointer to the path of the audio file for the audio playback device test in UTF-8: + - Supported file formats: wav, mp3, m4a, and aac. + - Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz. + + @return + - 0: Success, and you can hear the sound of the specified audio file. + - < 0: Failure. + */ + virtual int startPlaybackDeviceTest(const char* testAudioFilePath) = 0; + + /** Stops the audio playback device test. + + This method stops testing the audio playback device. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startPlaybackDeviceTest "startPlaybackDeviceTest" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopPlaybackDeviceTest() = 0; + + /** Sets the volume of the audio playback device. + + @param volume Sets the volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackDeviceVolume(int volume) = 0; + + /** Retrieves the volume of the audio playback device. + + @param volume Pointer to the audio playback device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDeviceVolume(int *volume) = 0; + + /** Sets the volume of the microphone. + + @param volume Sets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingDeviceVolume(int volume) = 0; + + /** Retrieves the volume of the microphone. + + @param volume Pointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDeviceVolume(int *volume) = 0; + + /** Mutes the audio playback device. + + @param mute Sets whether to mute/unmute the audio playback device: + - true: Mutes. + - false: Unmutes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackDeviceMute(bool mute) = 0; + /** Retrieves the mute status of the audio playback device. + + @param mute Pointer to whether the audio playback device is muted/unmuted. + - true: Muted. + - false: Unmuted. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDeviceMute(bool *mute) = 0; + /** Mutes/Unmutes the microphone. + + @param mute Sets whether to mute/unmute the microphone: + - true: Mutes. + - false: Unmutes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingDeviceMute(bool mute) = 0; + + /** Retrieves the microphone's mute status. + + @param mute Pointer to whether the microphone is muted/unmuted. + - true: Muted. + - false: Unmuted. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDeviceMute(bool *mute) = 0; + + /** Starts the microphone test. + + This method tests whether the microphone works properly. Once the test starts, the SDK uses the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback to notify the application with the volume information. + + @param indicationInterval Interval period (ms) of the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback cycle. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startRecordingDeviceTest(int indicationInterval) = 0; + + /** Stops the microphone test. + + This method stops the microphone test. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startRecordingDeviceTest "startRecordingDeviceTest" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopRecordingDeviceTest() = 0; + + /** Retrieves the audio playback device associated with the device ID. + + @param deviceId Pointer to the ID of the audio playback device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the audio playback device information associated with the device ID and device name. + + @param deviceId Pointer to the device ID of the audio playback device. + @param deviceName Pointer to the device name of the audio playback device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getPlaybackDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the audio recording device associated with the device ID. + + @param deviceId Pointer to the device ID of the audio recording device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Retrieves the audio recording device information associated with the device ID and device name. + + @param deviceId Pointer to the device ID of the recording audio device. + @param deviceName Pointer to the device name of the recording audio device. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getRecordingDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0; + + /** Starts the audio device loopback test. + + This method tests whether the local audio devices are working properly. After calling this method, the microphone captures the local audio and plays it through the speaker. The \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns the local audio volume information at the set interval. + + @note This method tests the local audio devices and does not report the network conditions. + + @param indicationInterval The time interval (ms) at which the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startAudioDeviceLoopbackTest(int indicationInterval) = 0; + + /** Stops the audio device loopback test. + + @note Ensure that you call this method to stop the loopback test after calling the \ref IAudioDeviceManager::startAudioDeviceLoopbackTest "startAudioDeviceLoopbackTest" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopAudioDeviceLoopbackTest() = 0; + + /** Releases all IAudioDeviceManager resources. + */ + virtual void release() = 0; +}; + +/** Definition of RtcEngineContext. +*/ +struct RtcEngineContext +{ + /** The IRtcEngineEventHandler object. + */ + IRtcEngineEventHandler* eventHandler; + /** App ID issued to you by Agora. Apply for a new App ID from Agora if + * it is missing from your kit. + */ + const char* appId; + // For android, it the context(Activity or Application + // for windows,Video hot plug device + /** The video window handle. Once set, this parameter enables you to plug + * or unplug the video devices while they are powered. + */ + void* context; + RtcEngineContext() + :eventHandler(NULL) + ,appId(NULL) + ,context(NULL) + {} +}; + +/** Definition of IMetadataObserver +*/ +class IMetadataObserver +{ +public: + /** Metadata type of the observer. + @note We only support video metadata for now. + */ + enum METADATA_TYPE + { + /** -1: the metadata type is unknown. + */ + UNKNOWN_METADATA = -1, + /** 0: the metadata type is video. + */ + VIDEO_METADATA = 0, + }; + + struct Metadata + { + /** The User ID. + + - For the receiver: the ID of the user who sent the metadata. + - For the sender: ignore it. + */ + unsigned int uid; + /** Buffer size of the sent or received Metadata. + */ + unsigned int size; + /** Buffer address of the sent or received Metadata. + */ + unsigned char *buffer; + /** Time statmp of the frame following the metadata. + */ + long long timeStampMs; + }; + + virtual ~IMetadataObserver() {}; + + /** Occurs when the SDK requests the maximum size of the Metadata. + + The metadata includes the following parameters: + - `uid`: ID of the user who sends the metadata. + - `size`: The size of the sent or received metadata. + - `buffer`: The sent or received metadata. + - `timeStampMs`: The timestamp of the metadata. + + The SDK triggers this callback after you successfully call the \ref agora::rtc::IRtcEngine::registerMediaMetadataObserver "registerMediaMetadataObserver" method. You need to specify the maximum size of the metadata in the return value of this callback. + + @return The maximum size of the buffer of the metadata that you want to use. The highest value is 1024 bytes. Ensure that you set the return value. + */ + virtual int getMaxMetadataSize() = 0; + + /** Occurs when the SDK is ready to receive and send metadata. + + @note Ensure that the size of the metadata does not exceed the value set in the \ref agora::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback. + + @param metadata The Metadata to be sent. + @return + - true: Send. + - false: Do not send. + */ + virtual bool onReadyToSendMetadata(Metadata &metadata) = 0; + + /** Occurs when the local user receives the metadata. + + @param metadata The received Metadata. + */ + virtual void onMetadataReceived(const Metadata &metadata) = 0; +}; + +/** IRtcEngine is the base interface class of the Agora SDK that provides the main Agora SDK methods invoked by your application. + +Enable the Agora SDK's communication functionality through the creation of an IRtcEngine object, then call the methods of this object. + */ +class IRtcEngine +{ +protected: + virtual ~IRtcEngine() {} +public: + + /** Initializes the Agora service. + * + * Ensure that you call the + * \ref agora::rtc::IRtcEngine::createAgoraRtcEngine + * "createAgoraRtcEngine" and \ref agora::rtc::IRtcEngine::initialize + * "initialize" methods before calling any other API. + * + * @param context Pointer to the RTC engine context. See RtcEngineContext. + * + * @return + * - 0: Success. + * - < 0: Failure. + * - `ERR_INVALID_APP_ID (101)`: The app ID is invalid. Check if it is in the correct format. + */ + virtual int initialize(const RtcEngineContext& context) = 0; + + /** Releases all IRtcEngine resources. + + @param sync + - true: (Synchronous call) The result returns after the IRtcEngine resources are released. The application should not call this method in the SDK generated callbacks. Otherwise, the SDK must wait for the callbacks to return to recover the associated IRtcEngine resources, resulting in a deadlock. The SDK automatically detects the deadlock and converts this method into an asynchronous call, causing the test to take additional time. + - false: (Asynchronous call) The result returns immediately, even when the IRtcEngine resources have not been released. The SDK releases all resources. + + @note Do not immediately uninstall the SDK's dynamic library after the call, or it may cause a crash due to the SDK clean-up thread not quitting. + */ + virtual void release(bool sync=false) = 0; + + /** Sets the channel profile of the Agora RtcEngine. + + The Agora RtcEngine differentiates channel profiles and applies optimization algorithms accordingly. + For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast. + + @note + - To ensure the quality of real-time communication, we recommend that all users in a channel use the same channel profile. + - Call this method before calling \ref IRtcEngine::joinChannel "joinChannel" . You cannot set the channel profile once you have joined the channel. + + @param profile The channel profile of the Agora RtcEngine. See #CHANNEL_PROFILE_TYPE + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setChannelProfile(CHANNEL_PROFILE_TYPE profile) = 0; + + /** Sets the role of the user, such as a host or an audience (default), before joining a channel in a live broadcast. + + This method can be used to switch the user role in a live broadcast after the user joins a channel. + + In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful \ref agora::rtc::IRtcEngine::setClientRole "setClientRole" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onClientRoleChanged "onClientRoleChanged" + - The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" or \ref agora::rtc::IRtcEngineEventHandler::onUserOffline "onUserOffline" (BECOME_AUDIENCE) + + @note + This method applies only to the Live-broadcast profile. + + @param role Sets the role of the user. See #CLIENT_ROLE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setClientRole(CLIENT_ROLE_TYPE role) = 0; + + /** Joins a channel with the user ID. + + Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other. + + + You must call the \ref IRtcEngine::leaveChannel "leaveChannel" method to exit the current call before entering another channel. + + A successful \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" + - The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. + + When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onRejoinChannelSuccess "onRejoinChannelSuccess" callback on the local client. + + @note A channel does not accept duplicate uids, such as two users with the same @p uid. If you set @p uid as 0, the system automatically assigns a @p uid. If you want to join a channel from different devices, ensure that each device has a different uid. + @warning Ensure that the App ID used for creating the token is the same App ID used by the \ref IRtcEngine::initialize "initialize" method for initializing the RTC engine. Otherwise, the CDN live streaming may fail. + + @param token Pointer to the token generated by the application server. In most circumstances, a static App ID suffices. For added security, use a Channel Key. + - If the user uses a static App ID, *token* is optional and can be set as NULL. + - If the user uses a Channel Key, Agora issues an additional App Certificate for you to generate a user key based on the algorithm and App Certificate for user authentication on the server. + @param channelId Pointer to the unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters: + - The 26 lowercase English letters: a to z + - The 26 uppercase English letters: A to Z + - The 10 numbers: 0 to 9 + - The space + - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", "," + @param info (Optional) Pointer to additional information about the channel. This parameter can be set to NULL or contain channel related information. Other users in the channel will not receive this message. + @param uid (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to 232-1. The @p uid must be unique. If a @p uid is not assigned (or set to 0), the SDK assigns and returns a @p uid in the \ref IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. Your application must record and maintain the returned *uid* since the SDK does not do so. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannel(const char* token, const char* channelId, const char* info, uid_t uid) = 0; + /** Switches to a different channel. + * + * This method allows the audience of a Live-broadcast channel to switch + * to a different channel. + * + * After the user successfully switches to another channel, the + * \ref agora::rtc::IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" + * and \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess + * "onJoinChannelSuccess" callbacks are triggered to indicate that the + * user has left the original channel and joined a new one. + * + * @note + * This method applies to the audience role in a Live-broadcast channel + * only. + * + * @param token The token generated at your server: + * - For low-security requirements: You can use the temporary token + * generated in Console. For details, see + * [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-temporary-token). + * - For high-security requirements: Use the token generated at your + * server. For details, see + * [Get a token](https://docs.agora.io/en/Agora%20Platform/token?platfor%20*%20m=All%20Platforms#get-a-token). + * @param channelId Unique channel name for the AgoraRTC session in the + * string format. The string length must be less than 64 bytes. Supported + * character scopes are: + * - The 26 lowercase English letters: a to z. + * - The 26 uppercase English letters: A to Z. + * - The 10 numbers: 0 to 9. + * - The space. + * - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", + * ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int switchChannel(const char* token, const char* channelId) = 0; + + /** Allows a user to leave a channel, such as hanging up or exiting a call. + + After joining a channel, the user must call the *leaveChannel* method to end the call before joining another channel. + + This method returns 0 if the user leaves the channel and releases all resources related to the call. + + This method call is asynchronous, and the user has not left the channel when the method call returns. Once the user leaves the channel, the SDK triggers the \ref IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" callback. + + A successful \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method call triggers the following callbacks: + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" + - The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserOffline "onUserOffline" , if the user leaving the channel is in the Communication channel, or is a BROADCASTER in the Live Broadcast profile. + + @note + - If you call the \ref IRtcEngine::release "release" method immediately after the *leaveChannel* method, the *leaveChannel* process interrupts, and the \ref IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" callback is not triggered. + - If you call the *leaveChannel* method during a CDN live streaming, the SDK triggers the \ref IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int leaveChannel() = 0; + + /** Gets a new token when the current token expires after a period of time. + + The `token` expires after a period of time once the token schema is enabled when: + + - The SDK triggers the \ref IRtcEngineEventHandler::onTokenPrivilegeWillExpire "onTokenPrivilegeWillExpire" callback, or + - The \ref IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" reports CONNECTION_CHANGED_TOKEN_EXPIRED(9). + + The application should call this method to get the new `token`. Failure to do so will result in the SDK disconnecting from the server. + + @param token Pointer to the new token. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int renewToken(const char* token) = 0; + + /** Retrieves the pointer to the device manager object. + + @param iid ID of the interface. + @param inter Pointer to the *DeviceManager* object. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + + /** Registers a user account. + + Once registered, the user account can be used to identify the local user when the user joins the channel. + After the user successfully registers a user account, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" callback on the local client, + reporting the user ID and user account of the local user. + + To join a channel with a user account, you can choose either of the following: + + - Call the \ref agora::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method to create a user account, and then the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel. + - Call the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel. + + The difference between the two is that for the former, the time elapsed between calling the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method + and joining the channel is shorter than the latter. + + @note + - Ensure that you set the `userAccount` parameter. Otherwise, this method does not take effect. + - Ensure that the value of the `userAccount` parameter is unique in the channel. + - To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + + @param appId The App ID of your project. + @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + - The 26 lowercase English letters: a to z. + - The 26 uppercase English letters: A to Z. + - The 10 numbers: 0 to 9. + - The space. + - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerLocalUserAccount( + const char* appId, const char* userAccount) = 0; + /** Joins the channel with a user account. + + After the user successfully joins the channel, the SDK triggers the following callbacks: + + - The local client: \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" and \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" . + The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" and \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. + + @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. + If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + + @param token The token generated at your server: + - For low-security requirements: You can use the temporary token generated at Console. For details, see [Get a temporary toke](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-temporary-token). + - For high-security requirements: Set it as the token generated at your server. For details, see [Get a token](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-token). + @param channelId The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: + The 26 lowercase English letters: a to z. + - The 26 uppercase English letters: A to Z. + - The 10 numbers: 0 to 9. + - The space. + - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + - The 26 lowercase English letters: a to z. + - The 26 uppercase English letters: A to Z. + - The 10 numbers: 0 to 9. + - The space. + - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (-2) + - #ERR_NOT_READY (-3) + - #ERR_REFUSED (-5) + */ + virtual int joinChannelWithUserAccount(const char* token, + const char* channelId, + const char* userAccount) = 0; + + /** Gets the user information by passing in the user account. + + After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them + in a mapping table object (`userInfo`), and triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client. + + After receiving the o\ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback, you can call this method to get the user ID of the + remote user from the `userInfo` object by passing in the user account. + + @param userAccount The user account of the user. Ensure that you set this parameter. + @param[in/out] userInfo A userInfo object that identifies the user: + - Input: A userInfo object. + - Output: A userInfo object that contains the user account and user ID of the user. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getUserInfoByUserAccount(const char* userAccount, UserInfo* userInfo) = 0; + /** Gets the user information by passing in the user ID. + + After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, + caches them in a mapping table object (`userInfo`), and triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client. + + After receiving the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback, you can call this method to get the user account of the remote user + from the `userInfo` object by passing in the user ID. + + @param uid The user ID of the remote user. Ensure that you set this parameter. + @param[in/out] userInfo A userInfo object that identifies the user: + - Input: A userInfo object. + - Output: A userInfo object that contains the user account and user ID of the user. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getUserInfoByUid(uid_t uid, UserInfo* userInfo) = 0; + + /** **DEPRECATED** Starts an audio call test. + + This method is deprecated as of v2.4.0. + + This method starts an audio call test to check whether the audio devices (for example, headset and speaker) and the network connection are working properly. + + To conduct the test: + + - The user speaks and the recording is played back within 10 seconds. + - If the user can hear the recording within 10 seconds, the audio devices and network connection are working properly. + + @note + - After calling this method, always call the \ref IRtcEngine::stopEchoTest "stopEchoTest" method to end the test. Otherwise, the application cannot run the next echo test. + - In the Live-broadcast profile, only the hosts can call this method. If the user switches from the Communication to Live-broadcast profile, the user must call the \ref IRtcEngine::setClientRole "setClientRole" method to change the user role from the audience (default) to the host before calling this method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startEchoTest() = 0; + + /** Starts an audio call test. + + This method starts an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly. + + In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly. + + @note + - Call this method before joining a channel. + - After calling this method, call the \ref IRtcEngine::stopEchoTest "stopEchoTest" method to end the test. Otherwise, the app cannot run the next echo test, or call the \ref IRtcEngine::joinChannel "joinChannel" method. + - In the Live-broadcast profile, only a host can call this method. + @param intervalInSeconds The time interval (s) between when you speak and when the recording plays back. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startEchoTest(int intervalInSeconds) = 0; + + /** Stops the audio call test. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopEchoTest() = 0; + + /** Enables the video module. + + Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode. If this method is called during an audio call, the audio mode switches to the video mode. To disable the video module, call the \ref IRtcEngine::disableVideo "disableVideo" method. + + A successful \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (true) callback on the remote client. + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately: + - \ref IRtcEngine::enableLocalVideo "enableLocalVideo": Whether to enable the camera to create the local video stream. + - \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream": Whether to publish the local video stream. + - \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream": Whether to subscribe to and play the remote video stream. + - \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams": Whether to subscribe to and play all remote video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableVideo() = 0; + + /** Disables the video module. + + This method can be called before joining a channel or during a call. If this method is called before joining a channel, the call starts in audio mode. If this method is called during a video call, the video mode switches to the audio mode. To enable the video module, call the \ref IRtcEngine::enableVideo "enableVideo" method. + + A successful \ref agora::rtc::IRtcEngine::disableVideo "disableVideo" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (false) callback on the remote client. + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately: + - \ref IRtcEngine::enableLocalVideo "enableLocalVideo": Whether to enable the camera to create the local video stream. + - \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream": Whether to publish the local video stream. + - \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream": Whether to subscribe to and play the remote video stream. + - \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams": Whether to subscribe to and play all remote video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int disableVideo() = 0; + + /** **DEPRECATED** Sets the video profile. + + This method is deprecated as of v2.3. Use the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method instead. + + Each video profile includes a set of parameters, such as the resolution, frame rate, and bitrate. If the camera device does not support the specified resolution, the SDK automatically chooses a suitable camera resolution, keeping the encoder resolution specified by the *setVideoProfile* method. + + @note + - If you do not need to set the video profile after joining the channel, call this method before the \ref IRtcEngine::enableVideo "enableVideo" method to reduce the render time of the first video frame. + - Always set the video profile before calling the \ref IRtcEngine::joinChannel "joinChannel" or \ref IRtcEngine::startPreview "startPreview" method. + + @param profile Sets the video profile. See #VIDEO_PROFILE_TYPE. + @param swapWidthAndHeight Sets whether to swap the width and height of the video stream: + - true: Swap the width and height. + - false: (Default) Do not swap the width and height. + The width and height of the output video are consistent with the set video profile. + @note Since the landscape or portrait mode of the output video can be decided directly by the video profile, We recommend setting *swapWidthAndHeight* to *false* (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVideoProfile(VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight) = 0; + + /** Sets the video encoder configuration. + + Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation. + + The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found. + + @note If you do not need to set the video encoder configuration after joining the channel, you can call this method before the \ref IRtcEngine::enableVideo "enableVideo" method to reduce the render time of the first video frame. + + @param config Sets the local video encoder configuration. See VideoEncoderConfiguration. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVideoEncoderConfiguration(const VideoEncoderConfiguration& config) = 0; + /** Sets the camera capture configuration. + + For a video call or live broadcast, generally the SDK controls the camera output parameters. When the default camera capturer settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration: + + - If the resolution or frame rate of the captured raw video data are higher than those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration", processing video frames requires extra CPU and RAM usage and degrades performance. We recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1 to avoid such problems. + - If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1 to optimize CPU and RAM usage. + - If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2. + + @note Call this method before enabling the local camera. That said, you can call this method before calling \ref agora::rtc::IRtcEngine::joinChannel "joinChannel", \ref agora::rtc::IRtcEngine::enableVideo "enableVideo", or \ref IRtcEngine::enableLocalVideo "enableLocalVideo", depending on which method you use to turn on your local camera. + + @param config Sets the camera capturer configuration. See CameraCapturerConfiguration. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) = 0; + + /** Initializes the local video view. + + This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream. + + Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. + The binding is still valid after the user leaves the channel, which means that the window still displays. To unbind the view, set the *view* in VideoCanvas to NULL. + + @note + - Call this method before joining a channel. + - To update the rendering or mirror mode of the local video view during a call, use the \ref IRtcEngine::setLocalRenderMode "setLocalRenderMode" method. + @param canvas Pointer to the local video view and settings. See VideoCanvas. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setupLocalVideo(const VideoCanvas& canvas) = 0; + + /** Initializes the video view of a remote user. + + This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. + + Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view. + + The application specifies the uid of the remote video in this method before the remote user joins the channel. If the remote uid is unknown to the application, set it after the application receives the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback. + If the Video Recording function is enabled, the Video Recording Service joins the channel as a dummy client, causing other clients to also receive the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback. Do not bind the dummy client to the application view because the dummy client does not send any video streams. If your application does not recognize the dummy client, bind the remote user to the view when the SDK triggers the \ref IRtcEngineEventHandler::onFirstRemoteVideoDecoded "onFirstRemoteVideoDecoded" callback. + To unbind the remote user from the view, set the view in VideoCanvas to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user. + + @note To update the rendering or mirror mode of the remote video view during a call, use the \ref IRtcEngine::setRemoteRenderMode "setRemoteRenderMode" method. + + @param canvas Pointer to the remote video view and settings. See VideoCanvas. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setupRemoteVideo(const VideoCanvas& canvas) = 0; + + /** Starts the local video preview before joining the channel. + + Before calling this method, you must: + + - Call the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" method to set up the local preview window and configure the attributes. + - Call the \ref IRtcEngine::enableVideo "enableVideo" method to enable video. + + @note Once the startPreview method is called to start the local video preview, if you leave the channel by calling the \ref IRtcEngine::leaveChannel "leaveChannel" method, the local video preview remains until you call the \ref IRtcEngine::stopPreview "stopPreview" method to disable it. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startPreview() = 0; + + /** Prioritizes a remote user's stream. + + Use this method with the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. + + @note The Agora SDK supports setting @p userPriority as high for one user only. + + @param uid The ID of the remote user. + @param userPriority Sets the priority of the remote user. See #PRIORITY_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteUserPriority(uid_t uid, PRIORITY_TYPE userPriority) = 0; + + /** Stops the local video preview and disables video. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopPreview() = 0; + + /** Enables the audio module. + + The audio mode is enabled by default. + + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. You can call this method either before or after joining a channel. + - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately: + - \ref IRtcEngine::enableLocalAudio "enableLocalAudio": Whether to enable the microphone to create the local audio stream. + - \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream": Whether to publish the local audio stream. + - \ref IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream": Whether to subscribe to and play the remote audio stream. + - \ref IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams": Whether to subscribe to and play all remote audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableAudio() = 0; + + /** Disables/Re-enables the local audio function. + + The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capturing. + + This method does not affect receiving or playing the remote audio streams,and enableLocalAudio(false) is applicable to scenarios where the user wants to + receive remote audio streams without sending any audio stream to other users in the channel. + + The SDK triggers the \ref IRtcEngineEventHandler::onMicrophoneEnabled "onMicrophoneEnabled" callback once the local audio function is disabled or enabled. + + @note + - Call this method after the \ref IRtcEngine::joinChannel "joinChannel" method. + - This method is different from the \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method: + + - \ref agora::rtc::IRtcEngine::enableLocalAudio "enableLocalAudio": Disables/Re-enables the local audio capturing and processing. + If you disable or re-enable local audio recording using the `enableLocalAudio` method, the local user may hear a pause in the remote audio playback. + - \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream": Sends/Stops sending the local audio streams. + + @param enabled Sets whether to disable/re-enable the local audio function: + - true: (Default) Re-enable the local audio function, that is, to start the local audio capturing device (for example, the microphone). + - false: Disable the local audio function, that is, to stop local audio capturing. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableLocalAudio(bool enabled) = 0; + + /** Disables the audio module. + + @note + - This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. You can call this method either before or after joining a channel. + - This method resets the internal engine and takes some time to take effect. We recommend using the \ref agora::rtc::IRtcEngine::enableLocalAudio "enableLocalAudio" and \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" methods to capture, process, and send the local audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int disableAudio() = 0; + + /** Sets the audio parameters and application scenarios. + + @note + - The *setAudioProfile* method must be called before the \ref IRtcEngine::joinChannel "joinChannel" method. + - In the Communication and Live-broadcast profiles, the bitrate may be different from your settings due to network self-adaptation. + - In scenarios requiring high-quality audio, for example, a music teaching scenario, we recommend setting profile as AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) and scenario as AUDIO_SCENARIO_GAME_STREAMING (3). + + @param profile Sets the sample rate, bitrate, encoding mode, and the number of channels. See #AUDIO_PROFILE_TYPE. + @param scenario Sets the audio application scenario. See #AUDIO_SCENARIO_TYPE. Under different audio scenarios, the device uses different volume tracks, i.e. either the in-call volume or the media volume. For details, see [What is the difference between the in-call volume and the media volume?](https://docs.agora.io/en/faq/system_volume). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) = 0; + /** Stops/Resumes sending the local audio stream. + + A successful \ref agora::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserMuteAudio "onUserMuteAudio" callback on the remote client. + @note + - When @p mute is set as @p true, this method does not disable the microphone, which does not affect any ongoing recording. + - If you call \ref agora::rtc::IRtcEngine::setChannelProfile "setChannelProfile" after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. Therefore, we recommend calling this method after the `setChannelProfile` method. + + @param mute Sets whether to send/stop sending the local audio stream: + - true: Stops sending the local audio stream. + - false: (Default) Sends the local audio stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteLocalAudioStream(bool mute) = 0; + /** Stops/Resumes receiving all remote users' audio streams. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams. + - true: Stops receiving all remote users' audio streams. + - false: (Default) Receives all remote users' audio streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteAudioStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' audio streams by default. + + @param mute Sets whether to receive/stop receiving all remote users' audio streams by default: + - true: Stops receiving all remote users' audio streams by default. + - false: (Default) Receives all remote users' audio streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteAudioStreams(bool mute) = 0; + + /** Adjusts the playback volume of a specified remote user. + + You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user. + + @note + - Call this method after joining a channel. + - The playback volume here refers to the mixed volume of a specified remote user. + - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. + + @param uid The ID of the remote user. + @param volume The playback volume of the specified remote user. The value ranges from 0 to 100: + - 0: Mute. + - 100: Original volume. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustUserPlaybackSignalVolume(unsigned int uid, int volume) = 0; + /** Stops/Resumes receiving a specified remote user's audio stream. + + @note If you called the \ref agora::rtc::IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method and set @p mute as @p true to stop receiving all remote users' audio streams, call the *muteAllRemoteAudioStreams* method and set @p mute as @p false before calling this method. The *muteAllRemoteAudioStreams* method sets all remote audio streams, while the *muteRemoteAudioStream* method sets a specified remote audio stream. + + @param userId User ID of the specified remote user sending the audio. + @param mute Sets whether to receive/stop receiving a specified remote user's audio stream: + - true: Stops receiving the specified remote user's audio stream. + - false: (Default) Receives the specified remote user's audio stream. + + @return + - 0: Success. + - < 0: Failure. + + */ + virtual int muteRemoteAudioStream(uid_t userId, bool mute) = 0; + /** Stops/Resumes sending the local video stream. + + A successful \ref agora::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserMuteVideo "onUserMuteVideo" callback on the remote client. + + @note + - When set to *true*, this method does not disable the camera which does not affect the retrieval of the local video streams. This method executes faster than the \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method which controls the sending of the local video stream. + - If you call \ref agora::rtc::IRtcEngine::setChannelProfile "setChannelProfile" after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. Therefore, we recommend calling this method after the `setChannelProfile` method. + + @param mute Sets whether to send/stop sending the local video stream: + - true: Stop sending the local video stream. + - false: (Default) Send the local video stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteLocalVideoStream(bool mute) = 0; + /** Enables/Disables the local video capture. + + This method disables or re-enables the local video capturer, and does not affect receiving the remote video stream. + + After you call the \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" method, the local video capturer is enabled by default. You can call \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local video capturer. If you want to re-enable it, call \ref agora::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo(true)". + + After the local video capturer is successfully disabled or re-enabled, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onUserEnableLocalVideo "onUserEnableLocalVideo" callback on the remote client. + + @note This method affects the internal engine and can be called after the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method. + + @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender: + - true: (Default) Re-enable the local video. + - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of the other remote users. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableLocalVideo(bool enabled) = 0; + /** Stops/Resumes receiving all video stream from a specified remote user. + + @param mute Sets whether to receive/stop receiving all remote users' video streams: + - true: Stop receiving all remote users' video streams. + - false: (Default) Receive all remote users' video streams. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving all remote users' video streams by default. + + @param mute Sets whether to receive/stop receiving all remote users' video streams by default: + - true: Stop receiving all remote users' video streams by default. + - false: (Default) Receive all remote users' video streams by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultMuteAllRemoteVideoStreams(bool mute) = 0; + /** Stops/Resumes receiving the video stream from a specified remote user. + + @note If you called the \ref agora::rtc::IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method and set @p mute as @p true to stop receiving all remote video streams, call the *muteAllRemoteVideoStreams* method and set @p mute as @p false before calling this method. + + @param userId User ID of the specified remote user. + @param mute Sets whether to stop/resume receiving the video stream from a specified remote user: + - true: Stop receiving the specified remote user's video stream. + - false: (Default) Receive the specified remote user's video stream. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int muteRemoteVideoStream(uid_t userId, bool mute) = 0; + /** Sets the remote user's video stream type received by the local user when the remote user sends dual streams. + + This method allows the application to adjust the corresponding video-stream type based on the size of the video window to reduce the bandwidth and resources. + + - If the remote user enables the dual-stream mode by calling the \ref agora::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" method, the SDK receives the high-stream video by default. + - If the dual-stream mode is not enabled, the SDK receives the high-stream video by default. + + The method result returns in the \ref agora::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. The SDK receives the high-stream video by default to reduce the bandwidth. If needed, users may use this method to switch to the low-stream video. + By default, the aspect ratio of the low-stream video is the same as the high-stream video. Once the resolution of the high-stream video is set, the system automatically sets the resolution, frame rate, and bitrate of the low-stream video. + + @param userId ID of the remote user sending the video stream. + @param streamType Sets the video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVideoStreamType(uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + /** Sets the default video-stream type for the video received by the local user when the remote user sends dual streams. + + - If the dual-stream mode is enabled by calling the \ref agora::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" method, the user receives the high-stream video by default. The @p setRemoteDefaultVideoStreamType method allows the application to adjust the corresponding video-stream type according to the size of the video window, reducing the bandwidth and resources. + - If the dual-stream mode is not enabled, the user receives the high-stream video by default. + + The result after calling this method is returned in the \ref agora::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. The Agora SDK receives the high-stream video by default to reduce the bandwidth. If needed, users can switch to the low-stream video through this method. + + @param streamType Sets the default video-stream type. See #REMOTE_VIDEO_STREAM_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) = 0; + + /** Enables the \ref agora::rtc::IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback at a set time interval to report on which users are speaking and the speakers' volume. + + Once this method is enabled, the SDK returns the volume indication in the \ref agora::rtc::IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback at the set time interval, whether or not any user is speaking in the channel. + + @param interval Sets the time interval between two consecutive volume indications: + - ≤ 0: Disables the volume indication. + - > 0: Time interval (ms) between two consecutive volume indications. We recommend setting @p interval > 200 ms. Do not set @p interval < 10 ms, or the *onAudioVolumeIndication* callback will not be triggered. + @param smooth Smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3. + @param report_vad + + - true: Enable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the `onAudioVolumeIndication` callback reports the voice activity status of the local user. + - false: (Default) Disable the voice activity detection of the local user. Once it is disabled, the `vad` parameter of the `onAudioVolumeIndication` callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableAudioVolumeIndication(int interval, int smooth, bool report_vad) = 0; + /** **DEPRECATED** Starts an audio recording. + * Use \ref IRtcEngine::startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) "startAudioRecording"2 instead. + + The SDK allows recording during a call. Supported formats: + + - .wav: Large file size with high fidelity. + - .aac: Small file size with low fidelity. + + This method has a fixed sample rate of 32 kHz. + + Ensure that the directory to save the recording file exists and is writable. + This method is usually called after the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method. + The recording automatically stops when the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method is called. + + @param filePath Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. + @param quality Sets the audio recording quality. See #AUDIO_RECORDING_QUALITY_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) = 0; + + /** Starts an audio recording on the client. + * + * The SDK allows recording during a call. After successfully calling this method, you can record the audio of all the users in the channel and get an audio recording file. + * Supported formats of the recording file are as follows: + * - .wav: Large file size with high fidelity. + * - .aac: Small file size with low fidelity. + * + * @note + * - Ensure that the directory you use to save the recording file exists and is writable. + * - This method is usually called after the `joinChannel` method. The recording automatically stops when you call the `leaveChannel` method. + * - For better recording effects, set quality as #AUDIO_RECORDING_QUALITY_MEDIUM or #AUDIO_RECORDING_QUALITY_HIGH when `sampleRate` is 44.1 kHz or 48 kHz. + * + * @param filePath Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. + * @param sampleRate Sample rate (kHz) of the recording file. Supported values are as follows: + * - 16 + * - (Default) 32 + * - 44.1 + * - 48 + * @param quality Sets the audio recording quality. See #AUDIO_RECORDING_QUALITY_TYPE. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) = 0; + /** Stops an audio recording on the client. + + You can call this method before calling the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method else, the recording automatically stops when the \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" method is called. + + @return + - 0: Success + - < 0: Failure. + */ + virtual int stopAudioRecording() = 0; + /** Starts playing and mixing the music file. + + This method mixes the specified local audio file with the audio stream from the microphone, or replaces the microphone's audio stream with the specified local audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. This method also supports online music playback. + + When the audio mixing file playback finishes after calling this method, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onAudioMixingFinished "onAudioMixingFinished" callback. + + A successful \ref agora::rtc::IRtcEngine::startAudioMixing "startAudioMixing" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged "onAudioMixingStateChanged" (PLAY) callback on the local client. + + When the audio mixing file playback finishes, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged "onAudioMixingStateChanged" (STOPPED) callback on the local client. + @note + - Call this method when you are in a channel. + - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701. + + @param filePath Pointer to the absolute path of the local or online audio file to mix. Supported audio formats: 3GP, ASF, ADTS, AVI, MP3, MPEG-4, SAMI, and WAVE. For more information, see [Supported Media Formats in Media Foundation](https://docs.microsoft.com/en-us/windows/desktop/medfound/supported-media-formats-in-media-foundation). + @param loopback Sets which user can hear the audio mixing: + - true: Only the local user can hear the audio mixing. + - false: Both users can hear the audio mixing. + @param replace Sets the audio mixing content: + - true: Only the specified audio file is published; the audio stream received by the microphone is not published. + - false: The local audio file is mixed with the audio stream from the microphone. + @param cycle Sets the number of playback loops: + - Positive integer: Number of playback loops. + - -1: Infinite playback loops. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startAudioMixing(const char* filePath, bool loopback, bool replace, int cycle) = 0; + /** Stops playing and mixing the music file. + + Call this method when you are in a channel. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopAudioMixing() = 0; + /** Pauses playing and mixing the music file. + + Call this method when you are in a channel. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pauseAudioMixing() = 0; + /** Resumes playing and mixing the music file. + + Call this method when you are in a channel. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int resumeAudioMixing() = 0; + /** **DEPRECATED** Agora does not recommend using this method. + + Sets the high-quality audio preferences. Call this method and set all parameters before joining a channel. + + Do not call this method again after joining a channel. + + @param fullband Sets whether to enable/disable full-band codec (48-kHz sample rate). Not compatible with SDK versions before v1.7.4: + - true: Enable full-band codec. + - false: Disable full-band codec. + @param stereo Sets whether to enable/disable stereo codec. Not compatible with SDK versions before v1.7.4: + - true: Enable stereo codec. + - false: Disable stereo codec. + @param fullBitrate Sets whether to enable/disable high-bitrate mode. Recommended in voice-only mode: + - true: Enable high-bitrate mode. + - false: Disable high-bitrate mode. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setHighQualityAudioParameters(bool fullband, bool stereo, bool fullBitrate) = 0; + /** Adjusts the volume during audio mixing. + + Call this method when you are in a channel. + + @note Calling this method does not affect the volume of audio effect file playback invoked by the \ref agora::rtc::IRtcEngine::playEffect "playEffect" method. + + @param volume Audio mixing volume. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustAudioMixingVolume(int volume) = 0; + /** Adjusts the audio mixing volume for local playback. + + @note Call this method when you are in a channel. + + @param volume Audio mixing volume for local playback. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustAudioMixingPlayoutVolume(int volume) = 0; + /** Retrieves the audio mixing volume for local playback. + + This method helps troubleshoot audio volume related issues. + + @note Call this method when you are in a channel. + + @return + - ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100]. + - < 0: Failure. + */ + virtual int getAudioMixingPlayoutVolume() = 0; + /** Adjusts the audio mixing volume for publishing (for remote users). + + @note Call this method when you are in a channel. + + @param volume Audio mixing volume for publishing. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustAudioMixingPublishVolume(int volume) = 0; + /** Retrieves the audio mixing volume for publishing. + + This method helps troubleshoot audio volume related issues. + + @note Call this method when you are in a channel. + + @return + - ≥ 0: The audio mixing volume for publishing, if this method call succeeds. The value range is [0,100]. + - < 0: Failure. + */ + virtual int getAudioMixingPublishVolume() = 0; + + /** Retrieves the duration (ms) of the music file. + + Call this method when you are in a channel. + + @return + - ≥ 0: The audio mixing duration, if this method call succeeds. + - < 0: Failure. + */ + virtual int getAudioMixingDuration() = 0; + /** Retrieves the playback position (ms) of the music file. + + Call this method when you are in a channel. + + @return + - ≥ 0: The current playback position of the audio mixing, if this method call succeeds. + - < 0: Failure. + */ + virtual int getAudioMixingCurrentPosition() = 0; + /** Sets the playback position of the music file to a different starting position (the default plays from the beginning). + + @param pos The playback starting position (ms) of the music file. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setAudioMixingPosition(int pos /*in ms*/) = 0; + /** Retrieves the volume of the audio effects. + + The value ranges between 0.0 and 100.0. + + @return + - ≥ 0: Volume of the audio effects, if this method call succeeds. + + - < 0: Failure. + */ + virtual int getEffectsVolume() = 0; + /** Sets the volume of the audio effects. + + @param volume Sets the volume of the audio effects. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEffectsVolume(int volume) = 0; + /** Sets the volume of a specified audio effect. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @param volume Sets the volume of the specified audio effect. The value ranges between 0 and 100 (default). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVolumeOfEffect(int soundId, int volume) = 0; + + /** Plays a specified local or online audio effect file. + + This method allows you to set the loop count, pitch, pan, and gain of the audio effect file, as well as whether the remote user can hear the audio effect. + + To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time. + + @param soundId ID of the specified audio effect. Each audio effect has a unique ID. + + @note + - If the audio effect is preloaded into the memory through the \ref IRtcEngine::preloadEffect "preloadEffect" method, the value of @p soundID must be the same as that in the *preloadEffect* method. + - Playing multiple online audio effect files simultaneously is not supported on macOS and Windows. + + @param filePath The absolute path to the local audio effect file or the URL of the online audio effect file. + @param loopCount Sets the number of times the audio effect loops: + - 0: Play the audio effect once. + - 1: Play the audio effect twice. + - -1: Play the audio effect in an indefinite loop until the \ref IRtcEngine::stopEffect "stopEffect" or \ref IRtcEngine::stopAllEffects "stopAllEffects" method is called. + @param pitch Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. + @param pan Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0: + - 0.0: The audio effect displays ahead. + - 1.0: The audio effect displays to the right. + - -1.0: The audio effect displays to the left. + @param gain Sets the volume of the audio effect. The value ranges between 0 and 100 (default). The lower the value, the lower the volume of the audio effect. + @param publish Sets whether or not to publish the specified audio effect to the remote stream: + - true: The locally played audio effect is published to the Agora Cloud and the remote users can hear it. + - false: The locally played audio effect is not published to the Agora Cloud and the remote users cannot hear it. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int playEffect(int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false) = 0; + /** Stops playing a specified audio effect. + + @param soundId ID of the audio effect to stop playing. Each audio effect has a unique ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopEffect(int soundId) = 0; + /** Stops playing all audio effects. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopAllEffects() = 0; + + /** Preloads a specified audio effect file into the memory. + + @note This method does not support online audio effect files. + + To ensure smooth communication, limit the size of the audio effect file. We recommend using this method to preload the audio effect before calling the \ref IRtcEngine::joinChannel "joinChannel" method. + + Supported audio formats: mp3, aac, m4a, 3gp, and wav. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @param filePath Pointer to the absolute path of the audio effect file. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int preloadEffect(int soundId, const char* filePath) = 0; + /** Releases a specified preloaded audio effect from the memory. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int unloadEffect(int soundId) = 0; + /** Pauses a specified audio effect. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pauseEffect(int soundId) = 0; + /** Pauses all audio effects. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int pauseAllEffects() = 0; + /** Resumes playing a specified audio effect. + + @param soundId ID of the audio effect. Each audio effect has a unique ID. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int resumeEffect(int soundId) = 0; + /** Resumes playing all audio effects. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int resumeAllEffects() = 0; + /** Enables/Disables stereo panning for remote users. + + Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling \ref agora::rtc::IRtcEngine::setRemoteVoicePosition "setRemoteVoicePosition". + + @param enabled Sets whether or not to enable stereo panning for remote users: + - true: enables stereo panning. + - false: disables stereo panning. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableSoundPositionIndication(bool enabled) = 0; + /** Sets the sound position and gain of a remote user. + + When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. + + @note + - For this method to work, enable stereo panning for remote users by calling the \ref agora::rtc::IRtcEngine::enableSoundPositionIndication "enableSoundPositionIndication" method before joining a channel. + - This method requires hardware support. For the best sound positioning, we recommend using a stereo speaker. + + @param uid The ID of the remote user. + @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: + - 0.0: the remote sound comes from the front. + - -1.0: the remote sound comes from the left. + - 1.0: the remote sound comes from the right. + @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteVoicePosition(uid_t uid, double pan, double gain) = 0; + + /** Changes the voice pitch of the local speaker. + + @param pitch Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoicePitch(double pitch) = 0; + /** Sets the local voice equalization effect. + + @param bandFrequency Sets the band frequency. The value ranges between 0 and 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. See #AUDIO_EQUALIZATION_BAND_FREQUENCY. + @param bandGain Sets the gain of each band in dB. The value ranges between -15 and 15. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) = 0; + /** Sets the local voice reverberation. + + v2.4.0 adds the \ref agora::rtc::IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset" method, a more user-friendly method for setting the local voice reverberation. You can use this method to set the local reverberation effect, such as pop music, R&B, rock music, and hip-hop. + + @param reverbKey Sets the reverberation key. See #AUDIO_REVERB_TYPE. + @param value Sets the value of the reverberation key. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value) = 0; + /** Sets the local voice changer option. + + @note Do not use this method together with the \ref agora::rtc::IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset" method, because the method called later overrides the one called earlier. + + @param voiceChanger Sets the local voice changer option. See #VOICE_CHANGER_PRESET. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceChanger(VOICE_CHANGER_PRESET voiceChanger) = 0; + /** Sets the preset local voice reverberation effect. + + @note + - Do not use this method together with \ref agora::rtc::IRtcEngine::setLocalVoiceReverb "setLocalVoiceReverb". + - Do not use this method together with the \ref agora::rtc::IRtcEngine::setLocalVoiceChanger "setLocalVoiceChanger" method, because the method called later overrides the one called earlier. + + @param reverbPreset Sets the preset audio reverberation configuration. See #AUDIO_REVERB_PRESET. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVoiceReverbPreset(AUDIO_REVERB_PRESET reverbPreset) = 0; + + /** Specifies an SDK output log file. + + The log file records all SDK operations during runtime. If it does not exist, the SDK creates one. + + @note + - The default log file is located at: C:\Users\\AppData\Local\Agora\. + - Ensure that you call this method immediately after calling the \ref agora::rtc::IRtcEngine::initialize "initialize" method, otherwise the output log may not be complete. + + @param filePath File path of the log file. The string of the log file is in UTF-8. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLogFile(const char* filePath) = 0; + /** Sets the output log level of the SDK. + + You can use one or a combination of the log filter levels. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level. + + If you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING. + + @param filter Sets the log filter level. See #LOG_FILTER_TYPE. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLogFilter(unsigned int filter) = 0; + /** Sets the log file size (KB). + + The SDK has two log files, each with a default size of 512 KB. If you set @p fileSizeInBytes as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files. + + @param fileSizeInKBytes The SDK log file size (KB). + @return + - 0: Success. + - <0: Failure. + */ + virtual int setLogFileSize(unsigned int fileSizeInKBytes) = 0; + /** + @deprecated This method is deprecated, use the \ref IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode"2 method instead. + Sets the local video display mode. + + This method can be called multiple times during a call to change the display mode. + + @param renderMode Sets the local video display mode. See #RENDER_MODE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalRenderMode(RENDER_MODE_TYPE renderMode) = 0; + /** Updates the display mode of the local video view. + + After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream. + + @note + - Ensure that you have called the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" method to initialize the local video view before calling this method. + @param renderMode The rendering mode of the local video view. See #RENDER_MODE_TYPE. + @param mirrorMode + - The mirror mode of the local video view. See #VIDEO_MIRROR_MODE_TYPE. + - **Note**: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** + @deprecated This method is deprecated, use the \ref IRtcEngine::setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setRemoteRenderMode"2 method instead. + Sets the video display mode of a specified remote user. + + This method can be called multiple times during a call to change the display mode. + + @param userId ID of the remote user. + @param renderMode Sets the video display mode. See #RENDER_MODE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode) = 0; + /** Updates the display mode of the video view of a remote user. + + After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees. + + @note + - Ensure that you have called the \ref IRtcEngine::setupRemoteVideo "setupRemoteVideo" method to initialize the remote video view before calling this method. + - During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user. + + @param userId The ID of the remote user. + @param renderMode The rendering mode of the remote video view. See #RENDER_MODE_TYPE. + @param mirrorMode + - The mirror mode of the remote video view. See #VIDEO_MIRROR_MODE_TYPE. + - **Note**: The SDK disables the mirror mode by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** + @deprecated This method is deprecated, use the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" + or \ref IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode" method instead. + Sets the local video mirror mode. + + You must call this method before calling the \ref agora::rtc::IRtcEngine::startPreview "startPreview" method, otherwise the mirror mode will not work. + + @note The SDK enables the mirror mode by default. + + @param mirrorMode Sets the local video mirror mode. See #VIDEO_MIRROR_MODE_TYPE. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** Sets the stream mode to the single-stream (default) or dual-stream mode. (Live broadcast only.) + + If the dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution and high-bitrate video stream), or the low stream (low-resolution and low-bitrate video stream). + + @param enabled Sets the stream mode: + - true: Dual-stream mode. + - false: (Default) Single-stream mode. + */ + virtual int enableDualStreamMode(bool enabled) = 0; + /** Sets the external audio source. Please call this method before \ref agora::rtc::IRtcEngine::joinChannel "joinChannel". + + @param enabled Sets whether to enable/disable the external audio source: + - true: Enables the external audio source. + - false: (Default) Disables the external audio source. + @param sampleRate Sets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param channels Sets the number of audio channels of the external audio source: + - 1: Mono. + - 2: Stereo. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels) = 0; + /** Sets the external audio sink. + * This method applies to scenarios where you want to use external audio + * data for playback. After enabling the external audio sink, you can call + * the \ref agora::media::IMediaEngine::pullAudioFrame "pullAudioFrame" method to pull the remote audio data, process + * it, and play it with the audio effects that you want. + * + * @note + * Once you enable the external audio sink, the app will not retrieve any + * audio data from the + * \ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback. + * + * @param enabled + * - true: Enables the external audio sink. + * - false: (Default) Disables the external audio sink. + * @param sampleRate Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. + * @param channels Sets the number of audio channels of the external + * audio sink: + * - 1: Mono. + * - 2: Stereo. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels) = 0; + /** Sets the audio recording format for the \ref agora::media::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" callback. + + + @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onRecordAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param channel Sets the number of audio channels (@p channels) returned in the *onRecordAudioFrame* callback: + - 1: Mono + - 2: Stereo + @param mode Sets the use mode (see #RAW_AUDIO_FRAME_OP_MODE_TYPE) of the *onRecordAudioFrame* callback. + @param samplesPerCall Sets the number of samples returned in the *onRecordAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming. + + + @note The SDK triggers the `onRecordAudioFrame` callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` × `channel`). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) = 0; + /** Sets the audio playback format for the \ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback. + + + @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onPlaybackAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param channel Sets the number of channels (@p channels) returned in the *onPlaybackAudioFrame* callback: + - 1: Mono + - 2: Stereo + @param mode Sets the use mode (see #RAW_AUDIO_FRAME_OP_MODE_TYPE) of the *onPlaybackAudioFrame* callback. + @param samplesPerCall Sets the number of samples returned in the *onPlaybackAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming. + + @note The SDK triggers the `onPlaybackAudioFrame` callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` × `channel`). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) = 0; + /** Sets the mixed audio format for the \ref agora::media::IAudioFrameObserver::onMixedAudioFrame "onMixedAudioFrame" callback. + + + @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onMixedAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. + @param samplesPerCall Sets the number of samples (`samples`) returned in the *onMixedAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming. + + @note The SDK triggers the `onMixedAudioFrame` callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` × `channels`). + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setMixedAudioFrameParameters(int sampleRate, int samplesPerCall) = 0; + /** Adjusts the recording volume. + + @param volume Recording volume. The value ranges between 0 and 400: + - 0: Mute. + - 100: Original volume. + - 400: (Maximum) Four times the original volume with signal clipping protection. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustRecordingSignalVolume(int volume) = 0; + /** Adjusts the playback volume of all remote users. + + @note + - This method adjusts the playback volume that is the mixed volume of all remote users. + - (Since v2.3.2) To mute the local audio playback, call both the `adjustPlaybackSignalVolume` and \ref IRtcEngine::adjustAudioMixingVolume "adjustAudioMixingVolume" methods and set the volume as `0`. + + @param volume The playback volume of all remote users. The value ranges from 0 to 400: + - 0: Mute. + - 100: Original volume. + - 400: (Maximum) Four times the original volume with signal clipping protection. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int adjustPlaybackSignalVolume(int volume) = 0; + + /** + @deprecated This method is deprecated. As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. + Enables interoperability with the Agora Web SDK. + + @note + - This method applies only to the Live-broadcast profile. In the Communication profile, interoperability with the Agora Web SDK is enabled by default. + - If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. + + @param enabled Sets whether to enable/disable interoperability with the Agora Web SDK: + - true: Enable. + - false: (Default) Disable. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableWebSdkInteroperability(bool enabled) = 0; + //only for live broadcast + /** **DEPRECATED** Sets the preferences for the high-quality video. (Live broadcast only). + + This method is deprecated as of v2.4.0. + + @param preferFrameRateOverImageQuality Sets the video quality preference: + - true: Frame rate over image quality. + - false: (Default) Image quality over frame rate. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setVideoQualityParameters(bool preferFrameRateOverImageQuality) = 0; + /** Sets the fallback option for the locally published video stream based on the network conditions. + + If `option` is set as #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK will: + + - Disable the upstream video but enable audio only when the network conditions deteriorate and cannot support both video and audio. + - Re-enable the video when the network conditions improve. + + When the locally published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onLocalPublishFallbackToAudioOnly "onLocalPublishFallbackToAudioOnly" callback. + + @note Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only. + + @param option Sets the fallback option for the locally published video stream: + - #STREAM_FALLBACK_OPTION_DISABLED (0): (Default) No fallback behavior for the locally published video stream when the uplink network condition is poor. The stream quality is not guaranteed. + - #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2): The locally published video stream falls back to audio only when the uplink network condition is poor. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option) = 0; + /** Sets the fallback option for the remotely subscribed video stream based on the network conditions. + + The default setting for `option` is #STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW (1), where the remotely subscribed video stream falls back to the low-stream video (low resolution and low bitrate) under poor downlink network conditions. + + If `option` is set as #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve. + + When the remotely subscribed video stream falls back to audio only or when the audio-only stream switches back to the video stream, the SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onRemoteSubscribeFallbackToAudioOnly "onRemoteSubscribeFallbackToAudioOnly" callback. + + @param option Sets the fallback option for the remotely subscribed video stream. See #STREAM_FALLBACK_OPTIONS. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option) = 0; + +#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) + /** Switches between front and rear cameras. + + @note This method is for Android and iOS only. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int switchCamera() = 0; + /** Switches between front and rear cameras. + + @note This method is for Android and iOS only, and it is private. + + @param direction Sets the camera to be used: + - CAMERA_DIRECTION.CAMERA_REAR: Use the rear camera. + - CAMERA_DIRECTION.CAMERA_FRONT: Use the front camera. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int switchCamera(CAMERA_DIRECTION direction) = 0; + /** Sets the default audio playback route. + + This method sets whether the received audio is routed to the earpiece or speakerphone by default before joining a channel. + If a user does not call this method, the audio is routed to the earpiece by default. If you need to change the default audio route after joining a channel, call the \ref IRtcEngine::setEnableSpeakerphone "setEnableSpeakerphone" method. + + The default setting for each mode: + - Voice: Earpiece. + - Video: Speakerphone. If a user who is in the Communication profile calls the \ref IRtcEngine::disableVideo "disableVideo" method or if the user calls the \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" and \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" methods, the default audio route switches back to the earpiece automatically. + - Live Broadcast: Speakerphone. + - Gaming Voice: Speakerphone. + + @note + - This method is for Android and iOS only. + - This method only works in audio mode. + - Call this method before calling the \ref IRtcEngine::joinChannel "joinChannel" method. + - Regardless of whether the audio is routed to the speakerphone or earpiece by default, once a headset is plugged in or Bluetooth device is connected, the default audio route changes. The default audio route switches to the earpiece once removing the headset or disconnecting the Bluetooth device. + + @param defaultToSpeaker Sets the default audio route: + - true: Speakerphone. + - false: (Default) Earpiece. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setDefaultAudioRouteToSpeakerphone(bool defaultToSpeaker) = 0; + /** Enables/Disables the audio playback route to the speakerphone. + + This method sets whether the audio is routed to the speakerphone or earpiece. + + See the default audio route explanation in the \ref IRtcEngine::setDefaultAudioRouteToSpeakerphone "setDefaultAudioRouteToSpeakerphone" method and check whether it is necessary to call this method. + + @note + - This method is for Android and iOS only. + - Ensure that you have successfully called the \ref IRtcEngine::joinChannel "joinChannel" method before calling this method. + - After calling this method, the SDK returns the \ref IRtcEngineEventHandler::onAudioRouteChanged "onAudioRouteChanged" callback to indicate the changes. + - This method does not take effect if a headset is used. + + @param speakerOn Sets whether to route the audio to the speakerphone or earpiece: + - true: Route the audio to the speakerphone. + - false: Route the audio to the earpiece. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEnableSpeakerphone(bool speakerOn) = 0; + /** Enables in-ear monitoring (for Android and iOS only). + @param enabled Sets whether to enable/disable in-ear monitoring: + - true: Enable. + - false: (Default) Disable. + + * @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableInEarMonitoring(bool enabled) = 0; + /** Sets the volume of the in-ear monitor. + + @param volume Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default). + + @note This method is for Android and iOS only. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setInEarMonitoringVolume(int volume) = 0; + /** Checks whether the speakerphone is enabled. + + @note This method is for Android and iOS only. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual bool isSpeakerphoneEnabled() = 0; +#endif + +#if (defined(__APPLE__) && TARGET_OS_IOS) + /** Sets the audio session’s operational restriction. + + The SDK and the app can both configure the audio session by default. The app may occasionally use other apps or third-party components to manipulate the audio session and restrict the SDK from doing so. This method allows the app to restrict the SDK’s manipulation of the audio session. + + You can call this method at any time to return the control of the audio sessions to the SDK. + + @note + - This method is for iOS only. + - This method restricts the SDK’s manipulation of the audio session. Any operation to the audio session relies solely on the app, other apps, or third-party components. + + @param restriction The operational restriction (bit mask) of the SDK on the audio session. See #AUDIO_SESSION_OPERATION_RESTRICTION. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setAudioSessionOperationRestriction(AUDIO_SESSION_OPERATION_RESTRICTION restriction) = 0; +#endif + +#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) || defined(_WIN32) + /** Enables loopback recording. + + If you enable loopback recording, the output of the sound card is mixed into the audio stream sent to the other end. + + @param enabled Sets whether to enable/disable loopback recording. + - true: Enable loopback recording. + - false: (Default) Disable loopback recording. + @param deviceName Pointer to the device name of the sound card. The default value is NULL (the default sound card). + + @note + - This method is for macOS and Windows only. + - macOS does not support loopback recording of the default sound card. If you need to use this method, please use a virtual sound card and pass its name to the deviceName parameter. Agora has tested and recommends using soundflower. + + */ + virtual int enableLoopbackRecording(bool enabled, const char* deviceName = NULL) = 0; + +#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) + /** Shares the whole or part of a screen by specifying the display ID. + + @note This method is for macOS only. + + @param displayId The display ID of the screen to be shared. This parameter specifies which screen you want to share. + @param regionRect (Optional) Sets the relative location of the region to the screen. NIL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. + @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters. + + + @return + - 0: Success. + - < 0: Failure: + - ERR_INVALID_STATE: the screen sharing state is invalid, probably because another screen or window is being shared. Call \ref agora::rtc::IRtcEngine::stopScreenCapture "stopScreenCapture" to stop the current screen sharing. + - #ERR_INVALID_ARGUMENT: the argument is invalid. + */ + virtual int startScreenCaptureByDisplayId(unsigned int displayId, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0; +#endif + +#if defined(_WIN32) + /** Shares the whole or part of a screen by specifying the screen rect. + + @param screenRect Sets the relative location of the screen to the virtual screen. For information on how to get screenRect, see [Share the Screen](https://docs.agora.io/en/Video/screensharing_windows?platform=Windows). + @param regionRect (Optional) Sets the relative location of the region to the screen. NULL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. + @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters. + + @return + - 0: Success. + - < 0: Failure: + - ERR_INVALID_STATE: the screen sharing state is invalid, probably because another screen or window is being shared. Call \ref agora::rtc::IRtcEngine::stopScreenCapture "stopScreenCapture" to stop the current screen sharing. + - ERR_INVALID_ARGUMENT: the argument is invalid. + */ + virtual int startScreenCaptureByScreenRect(const Rectangle& screenRect, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0; +#endif + + /** Shares the whole or part of a window by specifying the window ID. + + @param windowId The ID of the window to be shared. For information on how to get the windowId, see [Share the Screen](https://docs.agora.io/en/Video/screensharing_windows?platform=Windows). + @param regionRect (Optional) The relative location of the region to the window. NULL/NIL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window. + @param captureParams Window sharing encoding parameters. See ScreenCaptureParameters. + + @return + - 0: Success. + - < 0: Failure: + - ERR_INVALID_STATE: the window sharing state is invalid, probably because another screen or window is being shared. Call \ref agora::rtc::IRtcEngine::stopScreenCapture "stopScreenCapture" to stop sharing the current window. + - #ERR_INVALID_ARGUMENT: the argument is invalid. + */ + virtual int startScreenCaptureByWindowId(view_t windowId, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0; + + /** Sets the content hint for screen sharing. + + A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithm to different types of content. + + @param contentHint Sets the content hint for screen sharing. See VideoContentHint. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setScreenCaptureContentHint(VideoContentHint contentHint) = 0; + + /** Updates the screen sharing parameters. + + @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_NOT_READY: no screen or windows is being shared. + */ + virtual int updateScreenCaptureParameters(const ScreenCaptureParameters& captureParams) = 0; + + /** Updates the screen sharing region. + + @param regionRect Sets the relative location of the region to the screen or window. NULL means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window. + + @return + - 0: Success. + - < 0: Failure: + - #ERR_NOT_READY: no screen or window is being shared. + */ + virtual int updateScreenCaptureRegion(const Rectangle& regionRect) = 0; + + /** Stop screen sharing. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int stopScreenCapture() = 0; + +#if defined(__APPLE__) + typedef unsigned int WindowIDType; +#elif defined(_WIN32) + typedef HWND WindowIDType; +#endif + + /** **DEPRECATED** Starts screen sharing. + + This method is deprecated as of v2.4.0. See the following methods instead: + + - \ref agora::rtc::IRtcEngine::startScreenCaptureByDisplayId "startScreenCaptureByDisplayId" + - \ref agora::rtc::IRtcEngine::startScreenCaptureByScreenRect "startScreenCaptureByScreenRect" + - \ref agora::rtc::IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId" + + This method shares the whole screen, specified window, or specified region: + + - Whole screen: Set @p windowId as 0 and @p rect as NULL. + - Specified window: Set @p windowId as a value other than 0. Each window has a @p windowId that is not 0. + - Specified region: Set @p windowId as 0 and @p rect not as NULL. In this case, you can share the specified region, for example by dragging the mouse or implementing your own logic. + + @note The specified region is a region on the whole screen. Currently, sharing a specified region in a specific window is not supported. + *captureFreq* is the captured frame rate once the screen-sharing function is enabled. The mandatory value ranges between 1 fps and 15 fps. + + @param windowId Sets the screen sharing area. See WindowIDType. + @param captureFreq (Mandatory) The captured frame rate. The value ranges between 1 fps and 15 fps. + @param rect Specifies the screen-sharing region. @p rect is valid when @p windowsId is set as 0. When @p rect is set as NULL, the whole screen is shared. + @param bitrate The captured bitrate. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startScreenCapture(WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate) = 0; + + /** **DEPRECATED** Updates the screen capture region. + + @param rect Specifies the required region inside the screen or window. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int updateScreenCaptureRegion(const Rect *rect) = 0; +#endif + + /** Retrieves the current call ID. + + When a user joins a channel on a client, a @p callId is generated to identify the call from the client. Feedback methods, such as \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain", must be called after the call ends to submit feedback to the SDK. + + The \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain" methods require the @p callId parameter retrieved from the *getCallId* method during a call. @p callId is passed as an argument into the \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain" methods after the call ends. + + @param callId Pointer to the current call ID. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getCallId(agora::util::AString& callId) = 0; + + /** Allows a user to rate a call after the call ends. + + @param callId Pointer to the ID of the call, retrieved from the \ref IRtcEngine::getCallId "getCallId" method. + @param rating Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the #ERR_INVALID_ARGUMENT (2) error returns. + @param description (Optional) Pointer to the description of the rating, with a string length of less than 800 bytes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int rate(const char* callId, int rating, const char* description) = 0; + + /** Allows a user to complain about the call quality after a call ends. + + @param callId Pointer to the ID of the call, retrieved from the \ref IRtcEngine::getCallId "getCallId" method. + @param description (Optional) Pointer to the description of the complaint, with a string length of less than 800 bytes. + + @return + - 0: Success. + - < 0: Failure. + + */ + virtual int complain(const char* callId, const char* description) = 0; + + /** Retrieves the SDK version number. + + @param build Pointer to the build number. + @return The version of the current SDK in the string format. For example, 2.3.1. + */ + virtual const char* getVersion(int* build) = 0; + + /** Enables the network connection quality test. + + This method tests the quality of the users' network connections and is disabled by default. + + Before a user joins a channel or before an audience switches to a host, call this method to check the uplink network quality. + + This method consumes additional network traffic, and hence may affect communication quality. + + Call the \ref IRtcEngine::disableLastmileTest "disableLastmileTest" method to disable this test after receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" callback, and before joining a channel. + + @note + - Do not call any other methods before receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" callback. Otherwise, the callback may be interrupted by other methods, and hence may not be triggered. + - A host should not call this method after joining a channel (when in a call). + - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the \ref agora::rtc::IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. After you join the channel, whether you have called the `disableLastmileTest` method or not, the SDK automatically stops consuming the bandwidth. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableLastmileTest() = 0; + + /** Disables the network connection quality test. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int disableLastmileTest() = 0; + + /** Starts the last-mile network probe test. + + This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). + + Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. + Once this method is enabled, the SDK returns the following callbacks: + - \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality": the SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience. + - \ref IRtcEngineEventHandler::onLastmileProbeResult "onLastmileProbeResult": the SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. + + @note + - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with enableLastmileTest. + - Do not call other methods before receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" and \ref IRtcEngineEventHandler::onLastmileProbeResult "onLastmileProbeResult" callbacks. Otherwise, the callbacks may be interrupted. + - In the Live-broadcast profile, a host should not call this method after joining a channel. + + @param config Sets the configurations of the last-mile network probe test. See LastmileProbeConfig. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int startLastmileProbeTest(const LastmileProbeConfig& config) = 0; + + /** Stops the last-mile network probe test. */ + virtual int stopLastmileProbeTest() = 0; + + /** Retrieves the warning or error description. + + @param code Warning code or error code returned in the \ref agora::rtc::IRtcEngineEventHandler::onWarning "onWarning" or \ref agora::rtc::IRtcEngineEventHandler::onError "onError" callback. + + @return #WARN_CODE_TYPE or #ERROR_CODE_TYPE. + */ + virtual const char* getErrorDescription(int code) = 0; + + /** Enables built-in encryption with an encryption password before users join a channel. + + All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel. + + If an encryption password is not specified, the encryption functionality will be disabled. + + @note + - Do not use this method for CDN live streaming. + - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. + + @param secret Pointer to the encryption password. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionSecret(const char* secret) = 0; + + /** Sets the built-in encryption mode. + + The Agora SDK supports built-in encryption, which is set to the @p aes-128-xts mode by default. Call this method to use other encryption modes. + + All users in the same channel must use the same encryption mode and password. + + Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. + + @note Call the \ref IRtcEngine::setEncryptionSecret "setEncryptionSecret" method to enable the built-in encryption function before calling this method. + + @param encryptionMode Pointer to the set encryption mode: + - "aes-128-xts": (Default) 128-bit AES encryption, XTS mode. + - "aes-128-ecb": 128-bit AES encryption, ECB mode. + - "aes-256-xts": 256-bit AES encryption, XTS mode. + - "": When encryptionMode is set as NULL, the encryption mode is set as "aes-128-xts" by default. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setEncryptionMode(const char* encryptionMode) = 0; + + /** Registers a packet observer. + + The Agora SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission. + + @note + - The size of the packet sent to the network after processing should not exceed 1200 bytes, otherwise, the packet may fail to be sent. + - Ensure that both receivers and senders call this method, otherwise, you may meet undefined behaviors such as no voice and black screen. + - When you use CDN live streaming, recording or storage functions, Agora doesn't recommend calling this method. + + @param observer Pointer to the registered packet observer. See IPacketObserver. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerPacketObserver(IPacketObserver* observer) = 0; + + /** Creates a data stream. + + Each user can create up to five data streams during the lifecycle of the IRtcEngine. + + @note Set both the @p reliable and @p ordered parameters to true or false. Do not set one as true and the other as false. + + @param streamId Pointer to the ID of the created data stream. + @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds: + - true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, an error is reported to the application. + - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. + @param ordered Sets whether or not the recipients receive the data stream in the sent order: + - true: The recipients receive the data stream in the sent order. + - false: The recipients do not receive the data stream in the sent order. + + @return + - Returns 0: Success. + - < 0: Failure. + */ + virtual int createDataStream(int* streamId, bool reliable, bool ordered) = 0; + + /** Sends data stream messages to all users in a channel. + + The SDK has the following restrictions on this method: + - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB. + - Each client can send up to 6 kB of data per second. + - Each user can have up to five data streams simultaneously. + + A successful \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onStreamMessage "onStreamMessage" callback on the remote client, from which the remote user gets the stream message. + + A failed \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onStreamMessageError "onStreamMessage" callback on the remote client. + @note This method applies only to the Communication profile or to the hosts in the Live-broadcast profile. If an audience in the Live-broadcast profile calls this method, the audience may be switched to a host. + + @param streamId ID of the sent data stream, returned in the \ref IRtcEngine::createDataStream "createDataStream" method. + @param data Pointer to the sent data. + @param length Length of the sent data. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0; + + /** Publishes the local stream to a specified CDN live RTMP address. (CDN live only.) + + The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback. + + The \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of adding a local stream to the CDN. + @note + - Ensure that the user joins the channel before calling this method. + - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites). + - This method adds only one stream RTMP URL address each time it is called. + - This method applies to Live Broadcast only. + + @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. + @param transcodingEnabled Sets whether transcoding is enabled/disabled: + - true: Enable transcoding. To [transcode](https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#transcoding) the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. If you set this parameter as `true`, ensure that you call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method before this method. + - false: Disable transcoding. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0. + - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream. + */ + virtual int addPublishStreamUrl(const char *url, bool transcodingEnabled) = 0; + + /** Removes an RTMP stream from the CDN. (CDN live only.) + + This method removes the RTMP URL address (added by the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method) from a CDN live stream. The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamUnpublished "onStreamUnpublished" callback. + + The \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of removing an RTMP stream from the CDN. + @note + - This method removes only one RTMP URL address each time it is called. + - The RTMP URL address must not contain special characters, such as Chinese language characters. + - This method applies to Live Broadcast only. + + @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removePublishStreamUrl(const char *url) = 0; + + /** Sets the video layout and audio settings for CDN live. (CDN live only.) + + The SDK triggers the \ref agora::rtc::IRtcEngineEventHandler::onTranscodingUpdated "onTranscodingUpdated" callback when you call the `setLiveTranscoding` method to update the transcoding setting. + + @note + - This method applies to Live Broadcast only. + - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites). + - If you call the `setLiveTranscoding` method to update the transcoding setting for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. + + @param transcoding Sets the CDN live audio/video transcoding settings. See LiveTranscoding. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setLiveTranscoding(const LiveTranscoding &transcoding) = 0; + + /** **DEPRECATED** Adds a watermark image to the local video or CDN live stream. + + This method is deprecated from v2.9.1. Use \ref agora::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark"2 instead. + + This method adds a PNG watermark image to the local video stream for the recording device, channel audience, and CDN live audience to view and capture. + + To add the PNG file to the CDN live publishing stream, see the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method. + + @param watermark Pointer to the watermark image to be added to the local video stream. See RtcImage. + + @note + - The URL descriptions are different for the local video and CDN live streams: + - In a local video stream, @p url in RtcImage refers to the absolute path of the added watermark image file in the local video stream. + - In a CDN live stream, @p url in RtcImage refers to the URL address of the added watermark image in the CDN live broadcast. + - The source file of the watermark image must be in the PNG file format. If the width and height of the PNG file differ from your settings in this method, the PNG file will be cropped to conform to your settings. + - The Agora SDK supports adding only one watermark image onto a local video or CDN live stream. The newly added watermark image replaces the previous one. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int addVideoWatermark(const RtcImage& watermark) = 0; + + /** Adds a watermark image to the local video. + + This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included), + and the recording device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one. + + The watermark position depends on the settings in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method: + - If the orientation mode of the encoding video is #ORIENTATION_MODE_FIXED_LANDSCAPE, or the landscape mode in #ORIENTATION_MODE_ADAPTIVE, the watermark uses the landscape orientation. + - If the orientation mode of the encoding video is #ORIENTATION_MODE_FIXED_PORTRAIT, or the portrait mode in #ORIENTATION_MODE_ADAPTIVE, the watermark uses the portrait orientation. + - When setting the watermark position, the region must be less than the dimensions set in the `setVideoEncoderConfiguration` method. Otherwise, the watermark image will be cropped. + + @note + - Ensure that you have called the \ref agora::rtc::IRtcEngine::enableVideo "enableVideo" method to enable the video module before calling this method. + - If you only want to add a watermark image to the local video for the audience in the CDN live broadcast channel to see and capture, you can call this method or the \ref agora::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method. + - This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray. + - If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings. + - If you have enabled the local video preview by calling the \ref agora::rtc::IRtcEngine::startPreview "startPreview" method, you can use the `visibleInPreview` member in the WatermarkOptions class to set whether or not the watermark is visible in preview. + - If you have mirrored the local video by calling the \ref agora::rtc::IRtcEngine::setupLocalVideo "setupLocalVideo" or \ref agora::rtc::IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode" method, the watermark image in preview is also mirrored. + + @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path. + @param options Pointer to the watermark's options to be added. See WatermarkOptions for more infomation. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) = 0; + + /** Removes the watermark image from the video stream added by the \ref agora::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark" method. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int clearVideoWatermarks() = 0; + + /** Enables/Disables image enhancement and sets the options. + + @note + - Call this method after calling the enableVideo method. + - Currently this method does not apply for macOS. + + @param enabled Sets whether or not to enable image enhancement: + - true: enables image enhancement. + - false: disables image enhancement. + @param options Sets the image enhancement option. See BeautyOptions. + */ + virtual int setBeautyEffectOptions(bool enabled, BeautyOptions options) = 0; + + /** Adds a voice or video stream URL address to a live broadcast. + + The \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback returns the inject status. If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. + + The \ref agora::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method call triggers the following callbacks: + - The local client: + - \ref agora::rtc::IRtcEngineEventHandler::onStreamInjectedStatus "onStreamInjectedStatus" , with the state of the injecting the online stream. + - \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + - The remote client: + - \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel. + + @note + - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites). + - This method applies to the Native SDK v2.4.1 and later. + + @param url Pointer to the URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV. + - Supported FLV audio codec type: AAC. + - Supported FLV video codec type: H264 (AVC). + @param config Pointer to the InjectStreamConfig object that contains the configuration of the added voice or video stream. + + @return + - 0: Success. + - < 0: Failure. + - #ERR_INVALID_ARGUMENT (2): The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid. + - #ERR_NOT_READY (3): The user is not in the channel. + - #ERR_NOT_SUPPORTED (4): The channel profile is not live broadcast. Call the \ref agora::rtc::IRtcEngine::setChannelProfile "setChannelProfile" method and set the channel profile to live broadcast before calling this method. + - #ERR_NOT_INITIALIZED (7): The SDK is not initialized. Ensure that the IRtcEngine object is initialized before calling this method. + */ + virtual int addInjectStreamUrl(const char* url, const InjectStreamConfig& config) = 0; + /** Starts to relay media streams across channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" and + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callbacks, and these callbacks return the + * state and events of the media stream relay. + * - If the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback returns + * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the broadcaster starts + * sending data to the destination channel. + * - If the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream + * relay. + * + * @note + * - Call this method after the \ref joinChannel() "joinChannel" method. + * - This method takes effect only when you are a broadcaster in a + * Live-broadcast channel. + * - After a successful method call, if you want to call this method + * again, ensure that you call the + * \ref stopChannelMediaRelay() "stopChannelMediaRelay" method to quit the + * current relay. + * - Contact sales-us@agora.io before implementing this function. + * - We do not support string user accounts in this API. + * + * @param configuration The configuration of the media stream relay: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int startChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Updates the channels for media stream relay. After a successful + * \ref startChannelMediaRelay() "startChannelMediaRelay" method call, if + * you want to relay the media stream to more channels, or leave the + * current relay channel, you can call the + * \ref updateChannelMediaRelay() "updateChannelMediaRelay" method. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent + * "onChannelMediaRelayEvent" callback with the + * #RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code. + * + * @note + * Call this method after the + * \ref startChannelMediaRelay() "startChannelMediaRelay" method to update + * the destination channel. + * + * @param configuration The media stream relay configuration: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int updateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; + /** Stops the media stream relay. + * + * Once the relay stops, the broadcaster quits all the destination + * channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback. If the callback returns + * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the broadcaster successfully + * stops the relay. + * + * @note + * If the method call fails, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback with the + * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or + * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the + * channel by calling the \ref leaveChannel() "leaveChannel" method, and + * the media stream relay automatically stops. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int stopChannelMediaRelay() = 0; + + /** Removes the voice or video stream URL address from a live broadcast. + + This method removes the URL address (added by the \ref IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method) from the live broadcast. + + @note If this method is called successfully, the SDK triggers the \ref IRtcEngineEventHandler::onUserOffline "onUserOffline" callback and returns a stream uid of 666. + + @param url Pointer to the URL address of the added stream to be removed. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int removeInjectStreamUrl(const char* url) = 0; + virtual bool registerEventHandler(IRtcEngineEventHandler *eventHandler) = 0; + virtual bool unregisterEventHandler(IRtcEngineEventHandler *eventHandler) = 0; + /** Gets the current connection state of the SDK. + + @return #CONNECTION_STATE_TYPE. + */ + virtual CONNECTION_STATE_TYPE getConnectionState() = 0; + + /** Registers the metadata observer. + + Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the \ref agora::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback. + This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. + + @note + - Call this method before the joinChannel method. + - This method applies to the Live-broadcast channel profile. + + @param observer The IMetadataObserver class. See the definition of IMetadataObserver for details. + @param type See \ref IMetadataObserver::METADATA_TYPE "METADATA_TYPE". The SDK supports VIDEO_METADATA (0) only for now. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int registerMediaMetadataObserver(IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type) = 0; + /** Provides technical preview functionalities or special customizations by configuring the SDK with JSON options. + + The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way. + + @param parameters Sets the parameter as a JSON string in the specified format. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setParameters(const char* parameters) = 0; +}; + + +class IRtcEngineParameter +{ +public: + /** + * Releases all IRtcEngineParameter resources. + */ + virtual void release() = 0; + + /** Sets the bool value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setBool(const char* key, bool value) = 0; + + /** Sets the int value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setInt(const char* key, int value) = 0; + + /** Sets the unsigned int value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setUInt(const char* key, unsigned int value) = 0; + + /** Sets the double value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Sets the value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setNumber(const char* key, double value) = 0; + + /** Sets the string value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the set value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setString(const char* key, const char* value) = 0; + + /** Sets the object value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the set value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setObject(const char* key, const char* value) = 0; + + /** Retrieves the bool value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getBool(const char* key, bool& value) = 0; + + /** Retrieves the int value of the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getInt(const char* key, int& value) = 0; + + /** Retrieves the unsigned int value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getUInt(const char* key, unsigned int& value) = 0; + + /** Retrieves the double value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getNumber(const char* key, double& value) = 0; + + /** Retrieves the string value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getString(const char* key, agora::util::AString& value) = 0; + + /** Retrieves a child object value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getObject(const char* key, agora::util::AString& value) = 0; + + /** Retrieves the array value of a specified key in the JSON format. + + @param key Pointer to the name of the key. + @param value Pointer to the retrieved value. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int getArray(const char* key, agora::util::AString& value) = 0; + + /** Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options. + + @param parameters Pointer to the set parameters in a JSON string. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setParameters(const char* parameters) = 0; + + /** Sets the profile to control the RTC engine. + + @param profile Pointer to the set profile. + @param merge Sets whether to merge the profile data with the original value: + - true: Merge the profile data with the original value. + - false: Do not merge the profile data with the original value. + + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setProfile(const char* profile, bool merge) = 0; + + virtual int convertPath(const char* filePath, agora::util::AString& value) = 0; +}; + +class AAudioDeviceManager : public agora::util::AutoPtr +{ +public: + AAudioDeviceManager(IRtcEngine* engine) + { + queryInterface(engine, AGORA_IID_AUDIO_DEVICE_MANAGER); + } +}; + +class AVideoDeviceManager : public agora::util::AutoPtr +{ +public: + AVideoDeviceManager(IRtcEngine* engine) + { + queryInterface(engine, AGORA_IID_VIDEO_DEVICE_MANAGER); + } +}; + +class AParameter : public agora::util::AutoPtr +{ +public: + AParameter(IRtcEngine& engine) { initialize(&engine); } + AParameter(IRtcEngine* engine) { initialize(engine); } + AParameter(IRtcEngineParameter* p) :agora::util::AutoPtr(p) {} +private: + bool initialize(IRtcEngine* engine) + { + IRtcEngineParameter* p = NULL; + if (engine && !engine->queryInterface(AGORA_IID_RTC_ENGINE_PARAMETER, (void**)&p)) + reset(p); + return p != NULL; + } +}; +/** **DEPRECATED** The RtcEngineParameters class is deprecated, use the IRtcEngine class instead. +*/ +class RtcEngineParameters +{ +public: + RtcEngineParameters(IRtcEngine& engine) + :m_parameter(&engine){} + RtcEngineParameters(IRtcEngine* engine) + :m_parameter(engine){} + + + int enableLocalVideo(bool enabled) { + return setParameters("{\"rtc.video.capture\":%s,\"che.video.local.capture\":%s,\"che.video.local.render\":%s,\"che.video.local.send\":%s}", enabled ? "true" : "false", enabled ? "true" : "false", enabled ? "true" : "false", enabled ? "true" : "false"); + } + + + + int muteLocalVideoStream(bool mute) { + return setParameters("{\"rtc.video.mute_me\":%s,\"che.video.local.send\":%s}", mute ? "true" : "false", mute ? "false" : "true"); + } + + + int muteAllRemoteVideoStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.video.mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + + int setDefaultMuteAllRemoteVideoStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.video.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + int muteRemoteVideoStream(uid_t uid, bool mute) { + return setObject("rtc.video.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute ? "true" : "false"); + } + + + int setPlaybackDeviceVolume(int volume) {// [0,255] + return m_parameter ? m_parameter->setInt("che.audio.output.volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) { + return startAudioRecording(filePath, 32000, quality); + } + + int startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else + return -ERR_INVALID_ARGUMENT; +#endif + return setObject("che.audio.start_recording", "{\"filePath\":\"%s\",\"sampleRate\":%d,\"quality\":%d}", filePath, sampleRate, quality); + } + + + int stopAudioRecording() { + return m_parameter ? m_parameter->setBool("che.audio.stop_recording", true) : -ERR_NOT_INITIALIZED; + } + + + int startAudioMixing(const char* filePath, bool loopback, bool replace, int cycle) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else + return -ERR_INVALID_ARGUMENT; +#endif + return setObject("che.audio.start_file_as_playout", "{\"filePath\":\"%s\",\"loopback\":%s,\"replace\":%s,\"cycle\":%d}", + filePath, + loopback?"true":"false", + replace?"true":"false", + cycle); + } + + + int stopAudioMixing() { + return m_parameter ? m_parameter->setBool("che.audio.stop_file_as_playout", true) : -ERR_NOT_INITIALIZED; + } + + + int pauseAudioMixing() { + return m_parameter ? m_parameter->setBool("che.audio.pause_file_as_playout", true) : -ERR_NOT_INITIALIZED; + } + + + int resumeAudioMixing() { + return m_parameter ? m_parameter->setBool("che.audio.pause_file_as_playout", false) : -ERR_NOT_INITIALIZED; + } + + + int adjustAudioMixingVolume(int volume) { + int ret = adjustAudioMixingPlayoutVolume(volume); + if (ret == 0) { + adjustAudioMixingPublishVolume(volume); + } + return ret; + } + + + int adjustAudioMixingPlayoutVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int getAudioMixingPlayoutVolume() { + int volume = 0; + int r = m_parameter ? m_parameter->getInt("che.audio.get_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED; + if (r == 0) + r = volume; + return r; + } + + + int adjustAudioMixingPublishVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_publish_volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int getAudioMixingPublishVolume() { + int volume = 0; + int r = m_parameter ? m_parameter->getInt("che.audio.get_file_as_playout_publish_volume", volume) : -ERR_NOT_INITIALIZED; + if (r == 0) + r = volume; + return r; + } + + + int getAudioMixingDuration() { + int duration = 0; + int r = m_parameter ? m_parameter->getInt("che.audio.get_mixing_file_length_ms", duration) : -ERR_NOT_INITIALIZED; + if (r == 0) + r = duration; + return r; + } + + + int getAudioMixingCurrentPosition() { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + int pos = 0; + int r = m_parameter->getInt("che.audio.get_mixing_file_played_ms", pos); + if (r == 0) + r = pos; + return r; + } + + int setAudioMixingPosition(int pos /*in ms*/) { + return m_parameter ? m_parameter->setInt("che.audio.mixing.file.position", pos) : -ERR_NOT_INITIALIZED; + } + + + int getEffectsVolume() { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + int volume = 0; + int r = m_parameter->getInt("che.audio.game_get_effects_volume", volume); + if (r == 0) + r = volume; + return r; + } + + + int setEffectsVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.game_set_effects_volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int setVolumeOfEffect(int soundId, int volume) { + return setObject( + "che.audio.game_adjust_effect_volume", + "{\"soundId\":%d,\"gain\":%d}", + soundId, volume); + } + + + int playEffect(int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false) { +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else if (!filePath) + filePath = ""; +#endif + return setObject( + "che.audio.game_play_effect", + "{\"soundId\":%d,\"filePath\":\"%s\",\"loopCount\":%d, \"pitch\":%lf,\"pan\":%lf,\"gain\":%d, \"send2far\":%d}", + soundId, filePath, loopCount, pitch, pan, gain, publish); + } + + + int stopEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_stop_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int stopAllEffects() { + return m_parameter ? m_parameter->setBool( + "che.audio.game_stop_all_effects", true) : -ERR_NOT_INITIALIZED; + } + + + int preloadEffect(int soundId, char* filePath) { + return setObject( + "che.audio.game_preload_effect", + "{\"soundId\":%d,\"filePath\":\"%s\"}", + soundId, filePath); + } + + + int unloadEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_unload_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int pauseEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_pause_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int pauseAllEffects() { + return m_parameter ? m_parameter->setBool( + "che.audio.game_pause_all_effects", true) : -ERR_NOT_INITIALIZED; + } + + + int resumeEffect(int soundId) { + return m_parameter ? m_parameter->setInt( + "che.audio.game_resume_effect", soundId) : -ERR_NOT_INITIALIZED; + } + + + int resumeAllEffects() { + return m_parameter ? m_parameter->setBool( + "che.audio.game_resume_all_effects", true) : -ERR_NOT_INITIALIZED; + } + + + int enableSoundPositionIndication(bool enabled) { + return m_parameter ? m_parameter->setBool( + "che.audio.enable_sound_position", enabled) : -ERR_NOT_INITIALIZED; + } + + + int setRemoteVoicePosition(uid_t uid, double pan, double gain) { + return setObject("che.audio.game_place_sound_position", "{\"uid\":%u,\"pan\":%lf,\"gain\":%lf}", uid, pan, gain); + } + + + int setLocalVoicePitch(double pitch) { + return m_parameter ? m_parameter->setInt( + "che.audio.morph.pitch_shift", + static_cast(pitch * 100)) : -ERR_NOT_INITIALIZED; + } + + int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) { + return setObject( + "che.audio.morph.equalization", + "{\"index\":%d,\"gain\":%d}", + static_cast(bandFrequency), bandGain); + } + + int setLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value) { + return setObject( + "che.audio.morph.reverb", + "{\"key\":%d,\"value\":%d}", + static_cast(reverbKey), value); + } + + + int setLocalVoiceChanger(VOICE_CHANGER_PRESET voiceChanger) { + return m_parameter ? m_parameter->setInt("che.audio.morph.voice_changer", static_cast(voiceChanger)) : -ERR_NOT_INITIALIZED; + } + + + int setLocalVoiceReverbPreset(AUDIO_REVERB_PRESET reverbPreset) { + return m_parameter ? m_parameter->setInt("che.audio.morph.reverb_preset", static_cast(reverbPreset)) : -ERR_NOT_INITIALIZED; + } + + + + int pauseAudio() { + return m_parameter ? m_parameter->setBool("che.pause.audio", true) : -ERR_NOT_INITIALIZED; + } + + + int resumeAudio() { + return m_parameter ? m_parameter->setBool("che.pause.audio", false) : -ERR_NOT_INITIALIZED; + } + + + int setHighQualityAudioParameters(bool fullband, bool stereo, bool fullBitrate) { + return setObject("che.audio.codec.hq", "{\"fullband\":%s,\"stereo\":%s,\"fullBitrate\":%s}", fullband ? "true" : "false", stereo ? "true" : "false", fullBitrate ? "true" : "false"); + } + + + int adjustRecordingSignalVolume(int volume) {//[0, 400]: e.g. 50~0.5x 100~1x 400~4x + if (volume < 0) + volume = 0; + else if (volume > 400) + volume = 400; + return m_parameter ? m_parameter->setInt("che.audio.record.signal.volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int adjustPlaybackSignalVolume(int volume) {//[0, 400] + if (volume < 0) + volume = 0; + else if (volume > 400) + volume = 400; + return m_parameter ? m_parameter->setInt("che.audio.playout.signal.volume", volume) : -ERR_NOT_INITIALIZED; + } + + + int enableAudioVolumeIndication(int interval, int smooth, bool report_vad) { // in ms: <= 0: disable, > 0: enable, interval in ms + if (interval < 0) + interval = 0; + return setObject("che.audio.volume_indication", "{\"interval\":%d,\"smooth\":%d,\"vad\":%d}", interval, smooth, report_vad); + } + + + int muteLocalAudioStream(bool mute) { + return setParameters("{\"rtc.audio.mute_me\":%s,\"che.audio.mute_me\":%s}", mute ? "true" : "false", mute ? "true" : "false"); + } + // mute/unmute all peers. unmute will clear all muted peers specified mutePeer() interface + + + int muteRemoteAudioStream(uid_t uid, bool mute) { + return setObject("rtc.audio.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute?"true":"false"); + } + + + int muteAllRemoteAudioStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.audio.mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + int setDefaultMuteAllRemoteAudioStreams(bool mute) { + return m_parameter ? m_parameter->setBool("rtc.audio.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED; + } + + + int setExternalAudioSource(bool enabled, int sampleRate, int channels) { + if (enabled) + return setParameters("{\"che.audio.external_capture\":true,\"che.audio.external_capture.push\":true,\"che.audio.set_capture_raw_audio_format\":{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d}}", sampleRate, channels, RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_WRITE); + else + return setParameters("{\"che.audio.external_capture\":false,\"che.audio.external_capture.push\":false}"); + } + + + int setExternalAudioSink(bool enabled, int sampleRate, int channels) { + if (enabled) + return setParameters("{\"che.audio.external_render\":true,\"che.audio.external_render.pull\":true,\"che.audio.set_render_raw_audio_format\":{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d}}", sampleRate, channels, RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY); + else + return setParameters("{\"che.audio.external_render\":false,\"che.audio.external_render.pull\":false}"); + } + + + int setLogFile(const char* filePath) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; +#if defined(_WIN32) + util::AString path; + if (!m_parameter->convertPath(filePath, path)) + filePath = path->c_str(); + else if (!filePath) + filePath = ""; +#endif + return m_parameter->setString("rtc.log_file", filePath); + } + + + int setLogFilter(unsigned int filter) { + return m_parameter ? m_parameter->setUInt("rtc.log_filter", filter&LOG_FILTER_MASK) : -ERR_NOT_INITIALIZED; + } + + + int setLogFileSize(unsigned int fileSizeInKBytes) { + return m_parameter ? m_parameter->setUInt("rtc.log_size", fileSizeInKBytes) : -ERR_NOT_INITIALIZED; + } + + + int setLocalRenderMode(RENDER_MODE_TYPE renderMode) { + return setRemoteRenderMode(0, renderMode); + } + + + int setRemoteRenderMode(uid_t uid, RENDER_MODE_TYPE renderMode) { + return setObject("che.video.render_mode", "{\"uid\":%u,\"renderMode\":%d}", uid, renderMode); + } + + + int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + return m_parameter->setInt("che.video.camera_capture_mode", (int)config.preference); + } + + + int enableDualStreamMode(bool enabled) { + return setParameters("{\"rtc.dual_stream_mode\":%s,\"che.video.enableLowBitRateStream\":%d}", enabled ? "true" : "false", enabled ? 1 : 0); + } + + + int setRemoteVideoStreamType(uid_t uid, REMOTE_VIDEO_STREAM_TYPE streamType) { + return setParameters("{\"rtc.video.set_remote_video_stream\":{\"uid\":%u,\"stream\":%d}, \"che.video.setstream\":{\"uid\":%u,\"stream\":%d}}", uid, streamType, uid, streamType); +// return setObject("rtc.video.set_remote_video_stream", "{\"uid\":%u,\"stream\":%d}", uid, streamType); + } + + + int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) { + return m_parameter ? m_parameter->setInt("rtc.video.set_remote_default_video_stream_type", streamType) : -ERR_NOT_INITIALIZED; + } + + + int setRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) { + return setObject("che.audio.set_capture_raw_audio_format", "{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d,\"samplesPerCall\":%d}", sampleRate, channel, mode, samplesPerCall); + } + + int setPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) { + return setObject("che.audio.set_render_raw_audio_format", "{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d,\"samplesPerCall\":%d}", sampleRate, channel, mode, samplesPerCall); + } + + int setMixedAudioFrameParameters(int sampleRate, int samplesPerCall) { + return setObject("che.audio.set_mixed_raw_audio_format", "{\"sampleRate\":%d,\"samplesPerCall\":%d}", sampleRate, samplesPerCall); + } + + + int enableWebSdkInteroperability(bool enabled) {//enable interoperability with zero-plugin web sdk + return setParameters("{\"rtc.video.web_h264_interop_enable\":%s,\"che.video.web_h264_interop_enable\":%s}", enabled ? "true" : "false", enabled ? "true" : "false"); + } + + //only for live broadcast + + int setVideoQualityParameters(bool preferFrameRateOverImageQuality) { + return setParameters("{\"rtc.video.prefer_frame_rate\":%s,\"che.video.prefer_frame_rate\":%s}", preferFrameRateOverImageQuality ? "true" : "false", preferFrameRateOverImageQuality ? "true" : "false"); + } + + + int setLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode) { + if (!m_parameter) return -ERR_NOT_INITIALIZED; + const char *value; + switch (mirrorMode) { + case VIDEO_MIRROR_MODE_AUTO: + value = "default"; + break; + case VIDEO_MIRROR_MODE_ENABLED: + value = "forceMirror"; + break; + case VIDEO_MIRROR_MODE_DISABLED: + value = "disableMirror"; + break; + default: + return -ERR_INVALID_ARGUMENT; + } + return m_parameter->setString("che.video.localViewMirrorSetting", value); + } + + + int setLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option) { + return m_parameter ? m_parameter->setInt("rtc.local_publish_fallback_option", option) : -ERR_NOT_INITIALIZED; + } + + + int setRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option) { + return m_parameter ? m_parameter->setInt("rtc.remote_subscribe_fallback_option", option) : -ERR_NOT_INITIALIZED; + } + +#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) || defined(_WIN32) + + int enableLoopbackRecording(bool enabled, const char* deviceName = NULL) { + if (!deviceName) { + return setParameters("{\"che.audio.loopback.recording\":%s}", enabled ? "true" : "false"); + } + else { + return setParameters("{\"che.audio.loopback.deviceName\":\"%s\",\"che.audio.loopback.recording\":%s}", deviceName, enabled ? "true" : "false"); + } + } +#endif + + + int setInEarMonitoringVolume(int volume) { + return m_parameter ? m_parameter->setInt("che.audio.headset.monitoring.parameter", volume) : -ERR_NOT_INITIALIZED; + } + +protected: + AParameter& parameter() { + return m_parameter; + } + int setParameters(const char* format, ...) { + char buf[512]; + va_list args; + va_start(args, format); + vsnprintf(buf, sizeof(buf)-1, format, args); + va_end(args); + return m_parameter ? m_parameter->setParameters(buf) : -ERR_NOT_INITIALIZED; + } + int setObject(const char* key, const char* format, ...) { + char buf[512]; + va_list args; + va_start(args, format); + vsnprintf(buf, sizeof(buf)-1, format, args); + va_end(args); + return m_parameter ? m_parameter->setObject(key, buf) : -ERR_NOT_INITIALIZED; + } + int stopAllRemoteVideo() { + return m_parameter ? m_parameter->setBool("che.video.peer.stop_render", true) : -ERR_NOT_INITIALIZED; + } +private: + AParameter m_parameter; +}; + +} //namespace rtc +} // namespace agora + + +#define getAgoraRtcEngineVersion getAgoraSdkVersion + +//////////////////////////////////////////////////////// +/** \addtogroup createAgoraRtcEngine + @{ + */ +//////////////////////////////////////////////////////// + +/** Creates the IRtcEngine object and returns the pointer. + * + * @return Pointer to the IRtcEngine object. + */ +AGORA_API agora::rtc::IRtcEngine* AGORA_CALL createAgoraRtcEngine(); + +//////////////////////////////////////////////////////// +/** @} */ +//////////////////////////////////////////////////////// + +#define getAgoraRtcEngineErrorDescription getAgoraSdkErrorDescription +#define setAgoraRtcEngineExternalSymbolLoader setAgoraSdkExternalSymbolLoader + +#endif diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraService.h b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraService.h new file mode 100644 index 000000000..a607ed311 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/include/IAgoraService.h @@ -0,0 +1,76 @@ +// Agora SDK +// +// Copyright (c) 2019 Agora.io. All rights reserved. +// + +#ifndef AGORA_SERVICE_H +#define AGORA_SERVICE_H +#include "AgoraBase.h" + +namespace agora { + namespace rtc { + class IRtcEngine; + } + namespace rtm { + class IRtmService; + } +namespace base { + +struct AgoraServiceContext +{ +}; + + +class IAgoraService +{ +protected: + virtual ~IAgoraService(){} +public: + virtual void release() = 0; + + /** Initializes the engine. + + @param context RtcEngine context. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int initialize(const AgoraServiceContext& context) = 0; + + /** Retrieves the SDK version number. + * @param build Build number. + * @return The current SDK version in the string format. For example, 2.4.0 + */ + virtual const char* getVersion(int* build) = 0; + + virtual rtm::IRtmService* createRtmService() = 0; +}; + +} //namespace base +} // namespace agora + +/** Gets the SDK version number. + + @param build Build number of the Agora SDK. + @return + - 0: Success. + - < 0: Failure. +*/ +AGORA_API const char* AGORA_CALL getAgoraSdkVersion(int* build); + +/** +* Creates the RtcEngine object and returns the pointer. +* @param err Error code +* @return returns Description of the error code +*/ +AGORA_API const char* AGORA_CALL getAgoraSdkErrorDescription(int err); + +/** +* Creates the Agora Service object and returns the pointer. +* @return returns Pointer of the Agora Service object +*/ +AGORA_API agora::base::IAgoraService* AGORA_CALL createAgoraService(); + +AGORA_API int AGORA_CALL setAgoraSdkExternalSymbolLoader(void* (*func)(const char* symname)); + +#endif diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/include/VMUtil.h b/Android/APIExample/lib-raw-data/src/main/cpp/include/VMUtil.h new file mode 100644 index 000000000..f414b5f74 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/include/VMUtil.h @@ -0,0 +1,52 @@ +#ifndef __VM_UTIL_H__ +#define __VM_UTIL_H__ + +#include +#include + +#include + +#include +#include + +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "AG_EX_AV", __VA_ARGS__) +#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "AG_EX_AV", __VA_ARGS__) +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "AG_EX_AV", __VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "AG_EX_AV", __VA_ARGS__) + +#define TRUE true +#define FALSE false + +#define CHECK_POINTER(pValue, rValue, ...) if (NULL == pValue) { \ + LOGE(__VA_ARGS__); \ + return rValue; } + +class AttachThreadScoped { +public: + explicit AttachThreadScoped(JavaVM *jvm) + : attached_(false), jvm_(jvm), env_(nullptr) { + jint ret_val = jvm->GetEnv(reinterpret_cast(&env_), + JNI_VERSION_1_6); + if (ret_val == JNI_EDETACHED) { + // Attach the thread to the Java VM. + ret_val = jvm_->AttachCurrentThread(&env_, nullptr); + attached_ = ret_val >= 0; + assert(attached_); + } + } + + ~AttachThreadScoped() { + if (attached_ && (jvm_->DetachCurrentThread() < 0)) { + assert(false); + } + } + + JNIEnv *env() { return env_; } + +private: + bool attached_; + JavaVM *jvm_; + JNIEnv *env_; +}; + +#endif // __VM_UTIL_H__ diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.cpp b/Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.cpp new file mode 100644 index 000000000..c179a3497 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.cpp @@ -0,0 +1,443 @@ +#include +#include +#include +#include "include/IAgoraMediaEngine.h" + +#include "include/IAgoraRtcEngine.h" +#include +#include "io_agora_advancedvideo_rawdata_MediaPreProcessing.h" +#include "include/VMUtil.h" + +#include + +using namespace std; + +jobject gCallBack = nullptr; +jclass gCallbackClass = nullptr; +jmethodID recordAudioMethodId = nullptr; +jmethodID playbackAudioMethodId = nullptr; +jmethodID playBeforeMixAudioMethodId = nullptr; +jmethodID mixAudioMethodId = nullptr; +jmethodID captureVideoMethodId = nullptr; +jmethodID renderVideoMethodId = nullptr; +void *_javaDirectPlayBufferCapture = nullptr; +void *_javaDirectPlayBufferRecordAudio = nullptr; +void *_javaDirectPlayBufferPlayAudio = nullptr; +void *_javaDirectPlayBufferBeforeMixAudio = nullptr; +void *_javaDirectPlayBufferMixAudio = nullptr; +map decodeBufferMap; + +static JavaVM *gJVM = nullptr; + +/**Listener to get video frame*/ +class AgoraVideoFrameObserver : public agora::media::IVideoFrameObserver +{ + +public: + AgoraVideoFrameObserver() + { + + } + + ~AgoraVideoFrameObserver() + { + + } + + void + getVideoFrame(VideoFrame &videoFrame, _jmethodID *jmethodID, void *_byteBufferObject, + unsigned int uid) + { + if (_byteBufferObject == nullptr) + { + return; + } + + int width = videoFrame.width; + int height = videoFrame.height; + size_t widthAndHeight = (size_t) videoFrame.yStride * height; + size_t length = widthAndHeight * 3 / 2; + + AttachThreadScoped ats(gJVM); + JNIEnv *env = ats.env(); + + memcpy(_byteBufferObject, videoFrame.yBuffer, widthAndHeight); + memcpy((uint8_t *) _byteBufferObject + widthAndHeight, videoFrame.uBuffer, + widthAndHeight / 4); + memcpy((uint8_t *) _byteBufferObject + widthAndHeight * 5 / 4, videoFrame.vBuffer, + widthAndHeight / 4); + + if (uid == 0) + { + env->CallVoidMethod(gCallBack, jmethodID, videoFrame.type, width, height, length, + videoFrame.yStride, videoFrame.uStride, + videoFrame.vStride, videoFrame.rotation, + videoFrame.renderTimeMs); + } else + { + env->CallVoidMethod(gCallBack, jmethodID, uid, videoFrame.type, width, height, + length, + videoFrame.yStride, videoFrame.uStride, + videoFrame.vStride, videoFrame.rotation, + videoFrame.renderTimeMs); + } + } + + void writebackVideoFrame(VideoFrame &videoFrame, void *byteBuffer) + { + if (byteBuffer == nullptr) + { + return; + } + + int width = videoFrame.width; + int height = videoFrame.height; + size_t widthAndHeight = (size_t) videoFrame.yStride * height; + + memcpy(videoFrame.yBuffer, byteBuffer, widthAndHeight); + memcpy(videoFrame.uBuffer, (uint8_t *) byteBuffer + widthAndHeight, widthAndHeight / 4); + memcpy(videoFrame.vBuffer, (uint8_t *) byteBuffer + widthAndHeight * 5 / 4, + widthAndHeight / 4); + } + +public: + /**Occurs each time the SDK receives a video frame captured by the local camera. + * After you successfully register the video frame observer, the SDK triggers this callback each + * time a video frame is received. In this callback, you can get the video data captured by the + * local camera. You can then pre-process the data according to your scenarios. + * After pre-processing, you can send the processed video data back to the SDK by setting the + * videoFrame parameter in this callback. + * @param videoFrame + * @return + * Whether or not to ignore the current video frame if the pre-processing fails: + * true: Do not ignore. + * false: Ignore the current video frame, and do not send it back to the SDK. + * PS: + * This callback does not support sending processed RGBA video data back to the SDK.*/ + virtual bool onCaptureVideoFrame(VideoFrame &videoFrame) override + { + getVideoFrame(videoFrame, captureVideoMethodId, _javaDirectPlayBufferCapture, 0); + writebackVideoFrame(videoFrame, _javaDirectPlayBufferCapture); + return true; + } + + /**Occurs each time the SDK receives a video frame sent by the remote user. + * After you successfully register the video frame observer and isMultipleChannelFrameWanted + * return false, the SDK triggers this callback each time a video frame is received. In this + * callback, you can get the video data sent by the remote user. You can then post-process the + * data according to your scenarios. + * After post-processing, you can send the processed data back to the SDK by setting the videoFrame + * parameter in this callback. + * @param uid ID of the remote user who sends the current video frame. + * @param videoFrame + * @return + * Whether or not to ignore the current video frame if the post-processing fails: + * true: Do not ignore. + * false: Ignore the current video frame, and do not send it back to the SDK. + * PS: + * This callback does not support sending processed RGBA video data back to the SDK.*/ + virtual bool onRenderVideoFrame(unsigned int uid, VideoFrame &videoFrame) override + { + map::iterator it_find; + it_find = decodeBufferMap.find(uid); + + if (it_find != decodeBufferMap.end()) + { + if (it_find->second != nullptr) + { + getVideoFrame(videoFrame, renderVideoMethodId, it_find->second, uid); + writebackVideoFrame(videoFrame, it_find->second); + } + } + + return true; + } + +}; + +/**Listener to get audio frame*/ +class AgoraAudioFrameObserver : public agora::media::IAudioFrameObserver +{ + +public: + AgoraAudioFrameObserver() + { + gCallBack = nullptr; + } + + ~AgoraAudioFrameObserver() + { + } + + void getAudioFrame(AudioFrame &audioFrame, _jmethodID *jmethodID, void *_byteBufferObject, + unsigned int uid) + { + if (_byteBufferObject == nullptr) + { + return; + } + + AttachThreadScoped ats(gJVM); + JNIEnv *env = ats.env(); + if (env == nullptr) + { + return; + } + int len = audioFrame.samples * audioFrame.bytesPerSample; + memcpy(_byteBufferObject, audioFrame.buffer, (size_t) len); // * sizeof(int16_t) + + if (uid == 0) + { + env->CallVoidMethod(gCallBack, jmethodID, audioFrame.type, audioFrame.samples, + audioFrame.bytesPerSample, + audioFrame.channels, audioFrame.samplesPerSec, + audioFrame.renderTimeMs, len); + } else + { + env->CallVoidMethod(gCallBack, jmethodID, uid, audioFrame.type, audioFrame.samples, + audioFrame.bytesPerSample, + audioFrame.channels, audioFrame.samplesPerSec, + audioFrame.renderTimeMs, len); + } + } + + void writebackAudioFrame(AudioFrame &audioFrame, void *byteBuffer) + { + if (byteBuffer == nullptr) + { + return; + } + + int len = audioFrame.samples * audioFrame.bytesPerSample; + memcpy(audioFrame.buffer, byteBuffer, (size_t) len); + } + +public: + /**Retrieves the recorded audio frame. + * @param audioFrame + * @return + * true: Valid buffer in AudioFrame, and the recorded audio frame is sent out. + * false: Invalid buffer in AudioFrame, and the recorded audio frame is discarded.*/ + virtual bool onRecordAudioFrame(AudioFrame &audioFrame) override + { + getAudioFrame(audioFrame, recordAudioMethodId, _javaDirectPlayBufferRecordAudio, 0); + writebackAudioFrame(audioFrame, _javaDirectPlayBufferRecordAudio); + return true; + } + + /**Retrieves the audio playback frame for getting the audio. + * @param audioFrame + * @return + * true: Valid buffer in AudioFrame, and the audio playback frame is sent out. + false: Invalid buffer in AudioFrame, and the audio playback frame is discarded.*/ + virtual bool onPlaybackAudioFrame(AudioFrame &audioFrame) override + { + getAudioFrame(audioFrame, playbackAudioMethodId, _javaDirectPlayBufferPlayAudio, 0); + writebackAudioFrame(audioFrame, _javaDirectPlayBufferPlayAudio); + return true; + } + + /**Retrieves the audio frame of a specified user before mixing. + * The SDK triggers this callback if isMultipleChannelFrameWanted returns false. + * @param uid The user ID + * @param audioFrame + * @return + * true: Valid buffer in AudioFrame, and the mixed recorded and playback audio frame is sent out. + * false: Invalid buffer in AudioFrame, and the mixed recorded and playback audio frame is discarded.*/ + virtual bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, AudioFrame &audioFrame) override + { + getAudioFrame(audioFrame, playBeforeMixAudioMethodId, _javaDirectPlayBufferBeforeMixAudio, + uid); + writebackAudioFrame(audioFrame, _javaDirectPlayBufferBeforeMixAudio); + return true; + } + + /**Retrieves the mixed recorded and playback audio frame. + * @param audioFrame + * @return + * true: Valid buffer in AudioFrame and the mixed recorded and playback audio frame is sent out. + * false: Invalid buffer in AudioFrame and the mixed recorded and playback audio frame is discarded.*/ + virtual bool onMixedAudioFrame(AudioFrame &audioFrame) override + { + getAudioFrame(audioFrame, mixAudioMethodId, _javaDirectPlayBufferMixAudio, 0); + writebackAudioFrame(audioFrame, _javaDirectPlayBufferMixAudio); + return true; + } +}; + + +static AgoraAudioFrameObserver s_audioFrameObserver; + +static AgoraVideoFrameObserver s_videoFrameObserver; +static agora::rtc::IRtcEngine *rtcEngine = nullptr; + +#ifdef __cplusplus +extern "C" { +#endif + +int __attribute__((visibility("default"))) +loadAgoraRtcEnginePlugin(agora::rtc::IRtcEngine *engine) +{ + __android_log_print(ANDROID_LOG_DEBUG, "agora-raw-data-plugin", "loadAgoraRtcEnginePlugin"); + rtcEngine = engine; + return 0; +} + +void __attribute__((visibility("default"))) +unloadAgoraRtcEnginePlugin(agora::rtc::IRtcEngine *engine) +{ + __android_log_print(ANDROID_LOG_DEBUG, "agora-raw-data-plugin", "unloadAgoraRtcEnginePlugin"); + + rtcEngine = nullptr; +} + +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setCallback + (JNIEnv *env, jclass, jobject callback) +{ + if (!rtcEngine) return; + + env->GetJavaVM(&gJVM); + + agora::util::AutoPtr mediaEngine; + mediaEngine.queryInterface(rtcEngine, agora::INTERFACE_ID_TYPE::AGORA_IID_MEDIA_ENGINE); + if (mediaEngine) + { + /**Registers a video frame observer object. + * You need to implement the IVideoFrameObserver class in this method, and register callbacks + * according to your scenarios. + * After you successfully register the video frame observer, the SDK triggers the registered + * callbacks each time a video frame is received. + * @param observer Video frame observer object instance. If NULL is passed in, the registration is canceled. + * @return + * 0: Success. + * < 0: Failure. + * PS: + * When handling the video data returned in the callbacks, pay attention to the changes in + * the width and height parameters, which may be adapted under the following circumstances: + * When the network condition deteriorates, the video resolution decreases incrementally. + * If the user adjusts the video profile, the resolution of the video returned in the callbacks also changes.*/ + int code = mediaEngine->registerVideoFrameObserver(&s_videoFrameObserver); + /**Registers an audio frame observer object. + * This method is used to register an audio frame observer object (register a callback). + * This method is required to register callbacks when the engine is required to provide an + * onRecordAudioFrame or onPlaybackAudioFrame callback. + * @param observer Audio frame observer object instance. If NULL is passed in, the registration is canceled. + * @return + * 0: Success. + * < 0: Failure.*/ + int ret = mediaEngine->registerAudioFrameObserver(&s_audioFrameObserver); + } + + if (gCallBack == nullptr) + { + gCallBack = env->NewGlobalRef(callback); + gCallbackClass = env->GetObjectClass(gCallBack); + + /**Get the MethodId of each callback function through the callback object. + * Pass the data back to the java layer through these methods*/ + recordAudioMethodId = env->GetMethodID(gCallbackClass, "onRecordAudioFrame", "(IIIIIJI)V"); + playbackAudioMethodId = env->GetMethodID(gCallbackClass, "onPlaybackAudioFrame", + "(IIIIIJI)V"); + playBeforeMixAudioMethodId = env->GetMethodID(gCallbackClass, + "onPlaybackAudioFrameBeforeMixing", + "(IIIIIIJI)V"); + mixAudioMethodId = env->GetMethodID(gCallbackClass, "onMixedAudioFrame", "(IIIIIJI)V"); + + captureVideoMethodId = env->GetMethodID(gCallbackClass, "onCaptureVideoFrame", + "(IIIIIIIIJ)V"); + renderVideoMethodId = env->GetMethodID(gCallbackClass, "onRenderVideoFrame", + "(IIIIIIIIIJ)V"); + + __android_log_print(ANDROID_LOG_DEBUG, "setCallback", "setCallback done successfully"); + } +} + +JNIEXPORT void JNICALL +Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setVideoCaptureByteBuffer + (JNIEnv *env, jclass, jobject bytebuffer) +{ + _javaDirectPlayBufferCapture = env->GetDirectBufferAddress(bytebuffer); +} + +JNIEXPORT void JNICALL +Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setAudioRecordByteBuffer + (JNIEnv *env, jclass, jobject bytebuffer) +{ + _javaDirectPlayBufferRecordAudio = env->GetDirectBufferAddress(bytebuffer); +} + +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setAudioPlayByteBuffer + (JNIEnv *env, jclass, jobject bytebuffer) +{ + _javaDirectPlayBufferPlayAudio = env->GetDirectBufferAddress(bytebuffer); +} + +JNIEXPORT void JNICALL +Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setBeforeAudioMixByteBuffer + (JNIEnv *env, jclass, jobject bytebuffer) +{ + _javaDirectPlayBufferBeforeMixAudio = env->GetDirectBufferAddress(bytebuffer); +} + +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setAudioMixByteBuffer + (JNIEnv *env, jclass, jobject bytebuffer) +{ + _javaDirectPlayBufferMixAudio = env->GetDirectBufferAddress(bytebuffer); +} + +JNIEXPORT void JNICALL +Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setVideoDecodeByteBuffer + (JNIEnv *env, jclass, jint uid, jobject byteBuffer) +{ + if (byteBuffer == nullptr) + { + decodeBufferMap.erase(uid); + } else + { + void *_javaDirectDecodeBuffer = env->GetDirectBufferAddress(byteBuffer); + decodeBufferMap.insert(make_pair(uid, _javaDirectDecodeBuffer)); + __android_log_print(ANDROID_LOG_DEBUG, "agora-raw-data-plugin", + "setVideoDecodeByteBuffer uid: %u, _javaDirectDecodeBuffer: %p", + uid, _javaDirectDecodeBuffer); + } +} + +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_releasePoint + (JNIEnv *env, jclass) +{ + agora::util::AutoPtr mediaEngine; + mediaEngine.queryInterface(rtcEngine, agora::INTERFACE_ID_TYPE::AGORA_IID_MEDIA_ENGINE); + + if (mediaEngine) + { + /**Release video and audio observers*/ + mediaEngine->registerVideoFrameObserver(NULL); + mediaEngine->registerAudioFrameObserver(NULL); + } + + if (gCallBack != nullptr) + { + env->DeleteGlobalRef(gCallBack); + gCallBack = nullptr; + } + gCallbackClass = nullptr; + + recordAudioMethodId = nullptr; + playbackAudioMethodId = nullptr; + playBeforeMixAudioMethodId = nullptr; + mixAudioMethodId = nullptr; + captureVideoMethodId = nullptr; + renderVideoMethodId = nullptr; + + _javaDirectPlayBufferCapture = nullptr; + _javaDirectPlayBufferRecordAudio = nullptr; + _javaDirectPlayBufferPlayAudio = nullptr; + _javaDirectPlayBufferBeforeMixAudio = nullptr; + _javaDirectPlayBufferMixAudio = nullptr; + + decodeBufferMap.clear(); +} + +#ifdef __cplusplus +} +#endif diff --git a/Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.h b/Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.h new file mode 100644 index 000000000..870c8eb4e --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.h @@ -0,0 +1,77 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class io_agora_advancedvideo_rawdata_MediaPreProcessing */ + +#ifndef _Included_io_agora_advancedvideo_rawdata_MediaPreProcessing +#define _Included_io_agora_advancedvideo_rawdata_MediaPreProcessing +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setCallback + * Signature: (Lio/agora/advancedvideo/rawdata/MediaPreProcessing/ProgressCallback;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setCallback + (JNIEnv *, jclass, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setVideoCaptureByteBuffer + * Signature: (Ljava/nio/ByteBuffer;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setVideoCaptureByteBuffer + (JNIEnv *, jclass, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setAudioRecordByteBuffer + * Signature: (Ljava/nio/ByteBuffer;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setAudioRecordByteBuffer + (JNIEnv *, jclass, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setAudioPlayByteBuffer + * Signature: (Ljava/nio/ByteBuffer;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setAudioPlayByteBuffer + (JNIEnv *, jclass, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setBeforeAudioMixByteBuffer + * Signature: (Ljava/nio/ByteBuffer;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setBeforeAudioMixByteBuffer + (JNIEnv *, jclass, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setAudioMixByteBuffer + * Signature: (Ljava/nio/ByteBuffer;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setAudioMixByteBuffer + (JNIEnv *, jclass, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: setVideoDecodeByteBuffer + * Signature: (ILjava/nio/ByteBuffer;)V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_setVideoDecodeByteBuffer + (JNIEnv *, jclass, jint, jobject); + +/* + * Class: io_agora_advancedvideo_rawdata_MediaPreProcessing + * Method: releasePoint + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_io_agora_advancedvideo_rawdata_MediaPreProcessing_releasePoint + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/DecodeDataBuffer.java b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/DecodeDataBuffer.java new file mode 100644 index 000000000..284ecf99b --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/DecodeDataBuffer.java @@ -0,0 +1,32 @@ +package io.agora.advancedvideo.rawdata; + +import java.nio.ByteBuffer; + +/** + * Created by yt on 2018/4/4/004. + */ +public class DecodeDataBuffer { + private int uid; + private ByteBuffer byteBuffer; + + public DecodeDataBuffer(int uid, ByteBuffer byteBuffer) { + this.uid = uid; + this.byteBuffer = byteBuffer; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public ByteBuffer getByteBuffer() { + return byteBuffer; + } + + public void setByteBuffer(ByteBuffer byteBuffer) { + this.byteBuffer = byteBuffer; + } +} diff --git a/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataAudioObserver.java b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataAudioObserver.java new file mode 100644 index 000000000..13c02d268 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataAudioObserver.java @@ -0,0 +1,14 @@ +package io.agora.advancedvideo.rawdata; + +/** + * Created by yt on 2018/3/5/005. + */ +public interface MediaDataAudioObserver { + void onRecordAudioFrame(byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + + void onPlaybackAudioFrame(byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + + void onPlaybackAudioFrameBeforeMixing(int uid, byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + + void onMixedAudioFrame(byte[] data, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); +} diff --git a/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataObserverPlugin.java b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataObserverPlugin.java new file mode 100644 index 000000000..2ffef12f2 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataObserverPlugin.java @@ -0,0 +1,299 @@ +package io.agora.advancedvideo.rawdata; + +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.ImageFormat; +import android.graphics.Matrix; +import android.graphics.Rect; +import android.graphics.YuvImage; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.concurrent.CopyOnWriteArrayList; + +/** + * Created by yt on 2018/2/1/001. + */ +public class MediaDataObserverPlugin implements MediaPreProcessing.ProgressCallback { + + private final CopyOnWriteArrayList videoObserverList = new CopyOnWriteArrayList<>(); + private final CopyOnWriteArrayList audioObserverList = new CopyOnWriteArrayList<>(); + + private static final int VIDEO_DEFAULT_BUFFER_SIZE = 3240 * 1080; // default maximum video size Full HD+ + private static final int AUDIO_DEFAULT_BUFFER_SIZE = 2048; + + public ByteBuffer byteBufferCapture = ByteBuffer.allocateDirect(VIDEO_DEFAULT_BUFFER_SIZE); + public ByteBuffer byteBufferRender = ByteBuffer.allocateDirect(VIDEO_DEFAULT_BUFFER_SIZE); + public ByteBuffer byteBufferAudioRecord = ByteBuffer.allocateDirect(AUDIO_DEFAULT_BUFFER_SIZE); + public ByteBuffer byteBufferAudioPlay = ByteBuffer.allocateDirect(AUDIO_DEFAULT_BUFFER_SIZE); + public ByteBuffer byteBufferBeforeAudioMix = ByteBuffer.allocateDirect(AUDIO_DEFAULT_BUFFER_SIZE); + public ByteBuffer byteBufferAudioMix = ByteBuffer.allocateDirect(AUDIO_DEFAULT_BUFFER_SIZE); + + private final ArrayList decodeBufferList = new ArrayList<>(); + + private static MediaDataObserverPlugin myAgent = null; + + private boolean beCaptureVideoShot = false; + private boolean beRenderVideoShot = false; + private String captureFilePath = null; + private String renderFilePath = null; + private int renderVideoShotUid; + + public static MediaDataObserverPlugin the() { + if (myAgent == null) { + synchronized (MediaDataObserverPlugin.class) { + if (myAgent == null) { + myAgent = new MediaDataObserverPlugin(); + } + } + } + return myAgent; + } + + public void addVideoObserver(MediaDataVideoObserver observer) { + videoObserverList.add(observer); + } + + public void removeVideoObserver(MediaDataVideoObserver observer) { + videoObserverList.remove(observer); + } + + public void addAudioObserver(MediaDataAudioObserver observer) { + audioObserverList.add(observer); + } + + public void removeAudioObserver(MediaDataAudioObserver observer) { + audioObserverList.remove(observer); + } + + public void saveCaptureVideoSnapshot(String filePath) { + beCaptureVideoShot = true; + captureFilePath = filePath; + } + + public void saveRenderVideoSnapshot(String filePath, int uid) { + beRenderVideoShot = true; + renderFilePath = filePath; + renderVideoShotUid = uid; + } + + public void addDecodeBuffer(int uid) { + ByteBuffer byteBuffer = ByteBuffer.allocateDirect(VIDEO_DEFAULT_BUFFER_SIZE); + decodeBufferList.add(new DecodeDataBuffer(uid, byteBuffer)); + MediaPreProcessing.setVideoDecodeByteBuffer(uid, byteBuffer); + } + + public void removeDecodeBuffer(int uid) { + Iterator it = decodeBufferList.iterator(); + while (it.hasNext()) { + DecodeDataBuffer buffer = it.next(); + if (buffer.getUid() == uid) { + it.remove(); + } + } + + MediaPreProcessing.setVideoDecodeByteBuffer(uid, null); + } + + public void removeAllBuffer() { + decodeBufferList.removeAll(decodeBufferList); + releaseBuffer(); + } + + @Override + public void onCaptureVideoFrame(int videoFrameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs) { + byte[] buf = new byte[bufferLength]; + byteBufferCapture.limit(bufferLength); + byteBufferCapture.get(buf); + byteBufferCapture.flip(); + + for (MediaDataVideoObserver observer : videoObserverList) { + observer.onCaptureVideoFrame(buf, videoFrameType, width, height, bufferLength, yStride, uStride, vStride, rotation, renderTimeMs); + } + + byteBufferCapture.put(buf); + byteBufferCapture.flip(); + + if (beCaptureVideoShot) { + beCaptureVideoShot = false; + + getVideoSnapshot(width, height, rotation, bufferLength, buf, captureFilePath, yStride, uStride, vStride); + } + } + + @Override + public void onRenderVideoFrame(int uid, int videoFrameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs) { + for (MediaDataVideoObserver observer : videoObserverList) { + Iterator it = decodeBufferList.iterator(); + while (it.hasNext()) { + DecodeDataBuffer tmp = it.next(); + if (tmp.getUid() == uid) { + byte[] buf = new byte[bufferLength]; + tmp.getByteBuffer().limit(bufferLength); + tmp.getByteBuffer().get(buf); + tmp.getByteBuffer().flip(); + + observer.onRenderVideoFrame(uid, buf, videoFrameType, width, height, bufferLength, yStride, uStride, vStride, rotation, renderTimeMs); + + tmp.getByteBuffer().put(buf); + tmp.getByteBuffer().flip(); + + if (beRenderVideoShot) { + if (uid == renderVideoShotUid) { + beRenderVideoShot = false; + + getVideoSnapshot(width, height, rotation, bufferLength, buf, renderFilePath, yStride, uStride, vStride); + } + } + } + } + } + } + + @Override + public void onRecordAudioFrame(int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + byte[] buf = new byte[bufferLength]; + byteBufferAudioRecord.limit(bufferLength); + byteBufferAudioRecord.get(buf); + byteBufferAudioRecord.flip(); + + for (MediaDataAudioObserver observer : audioObserverList) { + observer.onRecordAudioFrame(buf, audioFrameType, samples, bytesPerSample, channels, samplesPerSec, renderTimeMs, bufferLength); + } + + byteBufferAudioRecord.put(buf); + byteBufferAudioRecord.flip(); + } + + @Override + public void onPlaybackAudioFrame(int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + byte[] buf = new byte[bufferLength]; + byteBufferAudioPlay.limit(bufferLength); + byteBufferAudioPlay.get(buf); + byteBufferAudioPlay.flip(); + + for (MediaDataAudioObserver observer : audioObserverList) { + observer.onPlaybackAudioFrame(buf, audioFrameType, samples, bytesPerSample, channels, samplesPerSec, renderTimeMs, bufferLength); + } + + byteBufferAudioPlay.put(buf); + byteBufferAudioPlay.flip(); + } + + @Override + public void onPlaybackAudioFrameBeforeMixing(int uid, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + byte[] buf = new byte[bufferLength]; + byteBufferBeforeAudioMix.limit(bufferLength); + byteBufferBeforeAudioMix.get(buf); + byteBufferBeforeAudioMix.flip(); + + for (MediaDataAudioObserver observer : audioObserverList) { + observer.onPlaybackAudioFrameBeforeMixing(uid, buf, audioFrameType, samples, bytesPerSample, channels, samplesPerSec, renderTimeMs, bufferLength); + } + + byteBufferBeforeAudioMix.put(buf); + byteBufferBeforeAudioMix.flip(); + } + + @Override + public void onMixedAudioFrame(int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength) { + byte[] buf = new byte[bufferLength]; + byteBufferAudioMix.limit(bufferLength); + byteBufferAudioMix.get(buf); + byteBufferAudioMix.flip(); + + for (MediaDataAudioObserver observer : audioObserverList) { + observer.onMixedAudioFrame(buf, audioFrameType, samples, bytesPerSample, channels, samplesPerSec, renderTimeMs, bufferLength); + } + + byteBufferAudioMix.put(buf); + byteBufferAudioMix.flip(); + } + + private void getVideoSnapshot(int width, int height, int rotation, int bufferLength, byte[] buffer, String filePath, int yStride, int uStride, int vStride) { + File file = new File(filePath); + + byte[] NV21 = new byte[bufferLength]; + swapYU12toYUV420SemiPlanar(buffer, NV21, width, height, yStride, uStride, vStride); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + int[] strides = {yStride, yStride}; + YuvImage image = new YuvImage(NV21, ImageFormat.NV21, width, height, strides); + + image.compressToJpeg( + new Rect(0, 0, image.getWidth(), image.getHeight()), + 100, baos); + + // rotate picture when saving to file + Matrix matrix = new Matrix(); + matrix.postRotate(rotation); + byte[] bytes = baos.toByteArray(); + try { + baos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); + Bitmap target = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + File fileParent = file.getParentFile(); + if (!fileParent.exists()) { + fileParent.mkdirs(); + } + if (file.exists()) { + file.delete(); + } + + try { + file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + + FileOutputStream fos = null; + try { + fos = new FileOutputStream(file); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + + target.compress(Bitmap.CompressFormat.JPEG, 100, fos); + + target.recycle(); + bitmap.recycle(); + + try { + fos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void swapYU12toYUV420SemiPlanar(byte[] yu12bytes, byte[] i420bytes, int width, int height, int yStride, int uStride, int vStride) { + System.arraycopy(yu12bytes, 0, i420bytes, 0, yStride * height); + int startPos = yStride * height; + int yv_start_pos_u = startPos; + int yv_start_pos_v = startPos + startPos / 4; + for (int i = 0; i < startPos / 4; i++) { + i420bytes[startPos + 2 * i + 0] = yu12bytes[yv_start_pos_v + i]; + i420bytes[startPos + 2 * i + 1] = yu12bytes[yv_start_pos_u + i]; + } + } + + public void releaseBuffer() { + byteBufferCapture.clear(); + byteBufferRender.clear(); + byteBufferAudioRecord.clear(); + byteBufferAudioPlay.clear(); + byteBufferBeforeAudioMix.clear(); + byteBufferAudioMix.clear(); + } + +} diff --git a/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataVideoObserver.java b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataVideoObserver.java new file mode 100644 index 000000000..0393dd206 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaDataVideoObserver.java @@ -0,0 +1,10 @@ +package io.agora.advancedvideo.rawdata; + +/** + * Created by yt on 2018/3/5/005. + */ +public interface MediaDataVideoObserver { + void onCaptureVideoFrame(byte[] data, int frameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs); + + void onRenderVideoFrame(int uid, byte[] data, int frameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs); +} diff --git a/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaPreProcessing.java b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaPreProcessing.java new file mode 100644 index 000000000..1940704b2 --- /dev/null +++ b/Android/APIExample/lib-raw-data/src/main/java/io/agora/advancedvideo/rawdata/MediaPreProcessing.java @@ -0,0 +1,64 @@ +package io.agora.advancedvideo.rawdata; + +import java.nio.ByteBuffer; + +/**This class is mainly used to interact with the underlying C++*/ +public class MediaPreProcessing { + static { + System.loadLibrary("apm-plugin-raw-data"); + } + + /**This callback interface is responsible for calling back the raw data from the underlying C++ + * to the data manager (ie MediaDataObserverPlugin)*/ + public interface ProgressCallback { + /**Occurs each time the SDK receives a video frame captured by the local camera. + * @param videoFrameType include FRAME_TYPE_YUV420、FRAME_TYPE_YUV422、FRAME_TYPE_RGBA + * @param rotation the rotation of this frame before rendering the video. Supports 0, 90, + * 180, 270 degrees clockwise. + * @param renderTimeMs The timestamp of the external audio frame. It is mandatory. You can + * use this parameter for the following purposes:*/ + void onCaptureVideoFrame(int videoFrameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs); + + /**Occurs each time the SDK receives a video frame captured by the local camera. + * @param uid ID of the remote user who sends the current video frame.*/ + void onRenderVideoFrame(int uid, int videoFrameType, int width, int height, int bufferLength, int yStride, int uStride, int vStride, int rotation, long renderTimeMs); + + /**Retrieves the recorded audio frame. + * @param audioFrameType only support FRAME_TYPE_PCM16 + * @param samples The number of samples per channel in the audio frame. + * @param bytesPerSample The number of bytes per audio sample, which is usually 16-bit (2-byte). + * @param channels The number of audio channels. + * 1: Mono + * 2: Stereo (the data is interleaved) + * @param samplesPerSec The sample rate. + * @param renderTimeMs The timestamp of the external audio frame. + * @param bufferLength audio frame size*/ + void onRecordAudioFrame(int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + + /**Retrieves the audio playback frame for getting the audio.*/ + void onPlaybackAudioFrame(int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + + /**Retrieves the audio frame of a specified user before mixing.*/ + void onPlaybackAudioFrameBeforeMixing(int uid, int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + + /**Retrieves the mixed recorded and playback audio frame.*/ + void onMixedAudioFrame(int audioFrameType, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int bufferLength); + } + + public static native void setCallback(ProgressCallback callback); + + public static native void setVideoCaptureByteBuffer(ByteBuffer byteBuffer); + + public static native void setAudioRecordByteBuffer(ByteBuffer byteBuffer); + + public static native void setAudioPlayByteBuffer(ByteBuffer byteBuffer); + + public static native void setBeforeAudioMixByteBuffer(ByteBuffer byteBuffer); + + public static native void setAudioMixByteBuffer(ByteBuffer byteBuffer); + + public static native void setVideoDecodeByteBuffer(int uid, ByteBuffer byteBuffer); + + public static native void releasePoint(); + +} diff --git a/Android/APIExample/settings.gradle b/Android/APIExample/settings.gradle index 793eb282f..2c1b2403e 100644 --- a/Android/APIExample/settings.gradle +++ b/Android/APIExample/settings.gradle @@ -1,5 +1,5 @@ rootProject.name='APIExample' -include ':app' +include ':app', ':lib-raw-data' include ':lib-stream-encrypt' include ':lib-component' include ':lib-push-externalvideo' From ee183830fd9e5809fe7f313bf29941c64294b5f6 Mon Sep 17 00:00:00 2001 From: lijuan <2420082764@qq.com> Date: Wed, 24 Jun 2020 15:00:49 +0800 Subject: [PATCH 035/430] fix Former-commit-id: 5d1c477c368d01fc33c24face1f54999c997ee73 --- .../build/asset-manifest.json | 25 ----------- .../basic_video_call/build/favicon.ico | Bin 3150 -> 0 bytes .../basic_video_call/build/index.html | 1 - .../basic_video_call/build/manifest.json | 25 ----------- ...nifest.bea50acfc4c06f8dbbaa4193b59a89ad.js | 30 -------------- .../basic_video_call/build/robots.txt | 3 -- .../basic_video_call/build/service-worker.js | 39 ------------------ .../build/static/css/2.63b65d4e.chunk.css | 10 ----- .../2.63b65d4e.chunk.css.map.REMOVED.git-id | 1 - .../build/static/css/main.2d51ff4f.chunk.css | 2 - .../static/css/main.2d51ff4f.chunk.css.map | 1 - .../build/static/js/2.a0af91be.chunk.js | 3 -- .../static/js/2.a0af91be.chunk.js.LICENSE.txt | 38 ----------------- .../build/static/js/2.a0af91be.chunk.js.map | 1 - .../build/static/js/main.cf5c2376.chunk.js | 2 - .../static/js/main.cf5c2376.chunk.js.map | 1 - .../build/static/js/runtime-main.1f69e042.js | 2 - .../static/js/runtime-main.1f69e042.js.map | 1 - 18 files changed, 185 deletions(-) delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/asset-manifest.json delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/favicon.ico delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/index.html delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/manifest.json delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/robots.txt delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/service-worker.js delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/css/2.63b65d4e.chunk.css.map.REMOVED.git-id delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/css/main.2d51ff4f.chunk.css.map delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/2.a0af91be.chunk.js delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/2.a0af91be.chunk.js.LICENSE.txt delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/2.a0af91be.chunk.js.map delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/main.cf5c2376.chunk.js delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/main.cf5c2376.chunk.js.map delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/runtime-main.1f69e042.js delete mode 100644 Web/webSdkDemo-NG/basic_video_call/build/static/js/runtime-main.1f69e042.js.map diff --git a/Web/webSdkDemo-NG/basic_video_call/build/asset-manifest.json b/Web/webSdkDemo-NG/basic_video_call/build/asset-manifest.json deleted file mode 100644 index 7f67a8972..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/asset-manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "files": { - "main.css": "/static/css/main.2d51ff4f.chunk.css", - "main.js": "/static/js/main.cf5c2376.chunk.js", - "main.js.map": "/static/js/main.cf5c2376.chunk.js.map", - "runtime-main.js": "/static/js/runtime-main.1f69e042.js", - "runtime-main.js.map": "/static/js/runtime-main.1f69e042.js.map", - "static/css/2.63b65d4e.chunk.css": "/static/css/2.63b65d4e.chunk.css", - "static/js/2.a0af91be.chunk.js": "/static/js/2.a0af91be.chunk.js", - "static/js/2.a0af91be.chunk.js.map": "/static/js/2.a0af91be.chunk.js.map", - "index.html": "/index.html", - "precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js": "/precache-manifest.bea50acfc4c06f8dbbaa4193b59a89ad.js", - "service-worker.js": "/service-worker.js", - "static/css/2.63b65d4e.chunk.css.map": "/static/css/2.63b65d4e.chunk.css.map", - "static/css/main.2d51ff4f.chunk.css.map": "/static/css/main.2d51ff4f.chunk.css.map", - "static/js/2.a0af91be.chunk.js.LICENSE.txt": "/static/js/2.a0af91be.chunk.js.LICENSE.txt" - }, - "entrypoints": [ - "static/js/runtime-main.1f69e042.js", - "static/css/2.63b65d4e.chunk.css", - "static/js/2.a0af91be.chunk.js", - "static/css/main.2d51ff4f.chunk.css", - "static/js/main.cf5c2376.chunk.js" - ] -} \ No newline at end of file diff --git a/Web/webSdkDemo-NG/basic_video_call/build/favicon.ico b/Web/webSdkDemo-NG/basic_video_call/build/favicon.ico deleted file mode 100644 index bcd5dfd67cd0361b78123e95c2dd96031f27f743..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3150 zcmaKtc{Ei0AIGn;MZ^<@lHD*OV;K7~W1q3jSjJcqNywTkMOhP*k~Oj?GO|6{m(*C2 zC7JA+hN%%Bp7T4;J@?%2_x=5zbI<2~->=X60stMr0B~{wzpi9D0MG|# zyuANt7z6;uz%?PEfAnimLl^)6h5ARwGXemG2>?hqQv-I^Gpyh$JH}Ag92}3{$a#z& zd`il2Sb#$U&e&4#^4R|GTgk!Qs+x*PCL{2+`uB5mqtnqLaaw`*H2oqJ?XF(zUACc2 zSibBrdQzcidqv*TK}rpEv1ie&;Famq2IK5%4c}1Jt2b1x_{y1C!?EU)@`_F)yN*NK z)(u03@%g%uDawwXGAMm%EnP9FgoucUedioDwL~{6RVO@A-Q$+pwVRR%WYR>{K3E&Q zzqzT!EEZ$_NHGYM6&PK#CGUV$pTWsiI5#~m>htoJ!vbc0=gm3H8sz8KzIiVN5xdCT z%;}`UH2Pc8))1VS-unh?v4*H*NIy5On{MRKw7BTmOO9oE2UApwkCl9Z?^dod9M^#w z51tEZhf+#dpTo#GDDy#kuzoIjMjZ?%v*h$ z*vwUMOjGc?R0(FjLWkMD)kca4z6~H45FIzQ!Zzu&-yWyMdCBsDr2`l}Q{8fH$H@O< z$&snNzbqLk?(GIe?!PVh?F~2qk4z^rMcp$P^hw^rUPjyCyoNTRw%;hNOwrCoN?G0E z!wT^=4Loa9@O{t;Wk(Nj=?ms1Z?UN_;21m%sUm?uib=pg&x|u)8pP#l--$;B9l47n zUUnMV0sXLe*@Gvy>XWjRoqc2tOzgYn%?g@Lb8C&WsxV1Kjssh^ZBs*Ysr+E6%tsC_ zCo-)hkYY=Bn?wMB4sqm?WS>{kh<6*DO)vXnQpQ9`-_qF6!#b;3Nf@;#B>e2j$yokl6F|9p1<($2 z=WSr%)Z?^|r6njhgbuMrIN>8JE05u0x5t@_dEfbGn9r0hK4c2vp>(*$GXsjeLL_uz zWpyfUgdv!~-2N;llVzik#s2*XB*%7u8(^sJv&T3pzaR&<9({17Zs~UY>#ugZZkHBs zD+>0_an$?}utGp$dcXtyFHnTQZJ}SF=oZ}X07dz~K>^o(vjTzw8ZQc!Fw1W=&Z?9% zv63|~l}70sJbY?H8ON8j)w5=6OpXuaZ}YT03`2%u8{;B0Vafo_iY7&BiQTbRkdJBYL}?%ATfmc zLG$uXt$@3j#OIjALdT&Ut$=9F8cgV{w_f5eS)PjoVi z&oemp-SKJ~UuGuCP1|iY?J^S&P z)-IG?O-*=z6kfZrX5H*G=aQ{ZaqnOqP@&+_;nq@mA>EcjgxrYX8EK|Iq4&E&rxR?R z8N$QOdRwY zr{P`O)=87>YLHtFfGXW z6P)ucrhj~It_9w<^v5>T6N1U}+BkS))=WX*2JY=}^b2czGhH<`?`(}}qMcpPx_%>M zM|fs(+I1m&_h(zqp-HgP>re$2O^o$q)xu#fl0ivOJE({duU)a*OD(eYgSi^cdTn}pqcPM(;S)2%1By^Wh%-CaC%>d9hi`7J zaxL7@;nhA>PE%s99&;z{8>VFgf{u!(-B-x7Of6ueme+ScryL`h(^qKE)DtieWY>-7 zgB)VJESQS4*1LU(2&@pgLvSt{(((C?K_V(rQk``i&5}ZPG;G^FiPlZ$7|-vEmMWlU z5lQ%iK2nu=h2wd_7>gK@vX=*AG+u~rQP$NwPC`ZA?4nh{3tui1x@bT6-;Rk3yDQ>d z?3qRD#+PeV7#FAa>s`Xwxsx_oRFcN$StW2=CW`=qObsT?SD^#^jM1Yk}PSPxJ zG@-_mnNU_)vM|iLRSI>UMp|hatyS}17R{10IuL0TLlupt>9dRs_SPQbv7BLYyC#qv16E-y@XZ= z-!p7I%#r-BVi$nQq3&ssRc_IC%R6$tA&^s_l46880~Wst3@>(|EO<}T4~ci~#!=e; zD)B>o%1+$ksURD1p7I-<3ehlFyVkqrySf&gg>Bp0Z9?JaG|gyTZ{Cb8SdvAWVmFX7v2ohs!OCc!Udk zUITUpmZ33rKLI#(&lDj}cKA#dpL4Fil=$5pu_wi1XJR!llw` zSItPBDEdMHk2>c7#%lBxZHHvtVUOZ$}v?=?AT~9!Jcqa@IJGuMg(s^7r>pcTrd)pS`{5Cu8WPey` z9)!!OUUY@L%9Q+bZa*S5`3f_|lFCPN6kdp_M2>{le8;cn^XUsPa+TUk47qd6)IBR% zk*&Ip?!Ge_gmmdj)BX}P_5o@VI2*wbZ^>UhFju}0gQZh!pP%4XT9{@w;G#b3XK8sN zF(7i$Jv(IM$8Akys9dhP^^~H2(7BfJp}yDW1#@!CL-!mGcSCnJ599WK9MV@yo_u$v MDeX2GIKR{Qf5okjU;qFB diff --git a/Web/webSdkDemo-NG/basic_video_call/build/index.html b/Web/webSdkDemo-NG/basic_video_call/build/index.html deleted file mode 100644 index 97922fb5e..000000000 --- a/Web/webSdkDemo-NG/basic_video_call/build/index.html +++ /dev/null @@ -1 +0,0 @@ -React App