mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Conference updates
This commit is contained in:
parent
a72b61423a
commit
5fa86c6a33
@ -163,7 +163,7 @@ private final class EmbeddedBroadcastUploadImpl: BroadcastUploadImpl {
|
|||||||
enableNoiseSuppression: false,
|
enableNoiseSuppression: false,
|
||||||
disableAudioInput: true,
|
disableAudioInput: true,
|
||||||
enableSystemMute: false,
|
enableSystemMute: false,
|
||||||
preferX264: false,
|
prioritizeVP8: false,
|
||||||
logPath: "",
|
logPath: "",
|
||||||
onMutedSpeechActivityDetected: { _ in },
|
onMutedSpeechActivityDetected: { _ in },
|
||||||
isConference: false,
|
isConference: false,
|
||||||
|
@ -1032,7 +1032,6 @@ public final class PresentationCallImpl: PresentationCall {
|
|||||||
self.conferenceCallImpl = conferenceCall
|
self.conferenceCallImpl = conferenceCall
|
||||||
conferenceCall.upgradedConferenceCall = self
|
conferenceCall.upgradedConferenceCall = self
|
||||||
|
|
||||||
conferenceCall.setConferenceInvitedPeers(self.pendingInviteToConferencePeerIds)
|
|
||||||
for (peerId, isVideo) in self.pendingInviteToConferencePeerIds {
|
for (peerId, isVideo) in self.pendingInviteToConferencePeerIds {
|
||||||
let _ = conferenceCall.invitePeer(peerId, isVideo: isVideo)
|
let _ = conferenceCall.invitePeer(peerId, isVideo: isVideo)
|
||||||
}
|
}
|
||||||
|
@ -550,7 +550,7 @@ private final class ScreencastInProcessIPCContext: ScreencastIPCContext {
|
|||||||
enableNoiseSuppression: false,
|
enableNoiseSuppression: false,
|
||||||
disableAudioInput: true,
|
disableAudioInput: true,
|
||||||
enableSystemMute: false,
|
enableSystemMute: false,
|
||||||
preferX264: false,
|
prioritizeVP8: false,
|
||||||
logPath: "",
|
logPath: "",
|
||||||
onMutedSpeechActivityDetected: { _ in },
|
onMutedSpeechActivityDetected: { _ in },
|
||||||
isConference: self.isConference,
|
isConference: self.isConference,
|
||||||
@ -2116,6 +2116,16 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
encryptionContext = OngoingGroupCallEncryptionContextImpl(e2eCall: Atomic(value: ConferenceCallE2EContext.ContextStateHolder()))
|
encryptionContext = OngoingGroupCallEncryptionContextImpl(e2eCall: Atomic(value: ConferenceCallE2EContext.ContextStateHolder()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var prioritizeVP8 = false
|
||||||
|
#if DEBUG
|
||||||
|
if "".isEmpty {
|
||||||
|
prioritizeVP8 = true
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if let data = self.accountContext.currentAppConfiguration.with({ $0 }).data, let value = data["ios_calls_prioritize_vp8"] as? Double {
|
||||||
|
prioritizeVP8 = value != 0.0
|
||||||
|
}
|
||||||
|
|
||||||
genericCallContext = .call(OngoingGroupCallContext(audioSessionActive: contextAudioSessionActive, video: self.videoCapturer, requestMediaChannelDescriptions: { [weak self] ssrcs, completion in
|
genericCallContext = .call(OngoingGroupCallContext(audioSessionActive: contextAudioSessionActive, video: self.videoCapturer, requestMediaChannelDescriptions: { [weak self] ssrcs, completion in
|
||||||
let disposable = MetaDisposable()
|
let disposable = MetaDisposable()
|
||||||
Queue.mainQueue().async {
|
Queue.mainQueue().async {
|
||||||
@ -2134,7 +2144,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
self.requestCall(movingFromBroadcastToRtc: false)
|
self.requestCall(movingFromBroadcastToRtc: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, outgoingAudioBitrateKbit: outgoingAudioBitrateKbit, videoContentType: self.isVideoEnabled ? .generic : .none, enableNoiseSuppression: false, disableAudioInput: self.isStream, enableSystemMute: self.accountContext.sharedContext.immediateExperimentalUISettings.experimentalCallMute, preferX264: self.accountContext.sharedContext.immediateExperimentalUISettings.preferredVideoCodec == "H264", logPath: allocateCallLogPath(account: self.account), onMutedSpeechActivityDetected: { [weak self] value in
|
}, outgoingAudioBitrateKbit: outgoingAudioBitrateKbit, videoContentType: self.isVideoEnabled ? .generic : .none, enableNoiseSuppression: false, disableAudioInput: self.isStream, enableSystemMute: self.accountContext.sharedContext.immediateExperimentalUISettings.experimentalCallMute, prioritizeVP8: prioritizeVP8, logPath: allocateCallLogPath(account: self.account), onMutedSpeechActivityDetected: { [weak self] value in
|
||||||
Queue.mainQueue().async {
|
Queue.mainQueue().async {
|
||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
@ -3979,13 +3989,6 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setConferenceInvitedPeers(_ invitedPeers: [(id: PeerId, isVideo: Bool)]) {
|
|
||||||
//TODO:release
|
|
||||||
/*self.invitedPeersValue = peerIds.map {
|
|
||||||
PresentationGroupCallInvitedPeer(id: $0, state: .requesting)
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
public func removedPeer(_ peerId: PeerId) {
|
public func removedPeer(_ peerId: PeerId) {
|
||||||
var updatedInvitedPeers = self.invitedPeersValue
|
var updatedInvitedPeers = self.invitedPeersValue
|
||||||
updatedInvitedPeers.removeAll(where: { $0.id == peerId})
|
updatedInvitedPeers.removeAll(where: { $0.id == peerId})
|
||||||
|
@ -499,7 +499,7 @@ public final class OngoingGroupCallContext {
|
|||||||
enableNoiseSuppression: Bool,
|
enableNoiseSuppression: Bool,
|
||||||
disableAudioInput: Bool,
|
disableAudioInput: Bool,
|
||||||
enableSystemMute: Bool,
|
enableSystemMute: Bool,
|
||||||
preferX264: Bool,
|
prioritizeVP8: Bool,
|
||||||
logPath: String,
|
logPath: String,
|
||||||
onMutedSpeechActivityDetected: @escaping (Bool) -> Void,
|
onMutedSpeechActivityDetected: @escaping (Bool) -> Void,
|
||||||
isConference: Bool,
|
isConference: Bool,
|
||||||
@ -633,7 +633,7 @@ public final class OngoingGroupCallContext {
|
|||||||
enableNoiseSuppression: enableNoiseSuppression,
|
enableNoiseSuppression: enableNoiseSuppression,
|
||||||
disableAudioInput: disableAudioInput,
|
disableAudioInput: disableAudioInput,
|
||||||
enableSystemMute: enableSystemMute,
|
enableSystemMute: enableSystemMute,
|
||||||
preferX264: preferX264,
|
prioritizeVP8: prioritizeVP8,
|
||||||
logPath: logPath,
|
logPath: logPath,
|
||||||
statsLogPath: tempStatsLogPath,
|
statsLogPath: tempStatsLogPath,
|
||||||
onMutedSpeechActivityDetected: { value in
|
onMutedSpeechActivityDetected: { value in
|
||||||
@ -746,7 +746,7 @@ public final class OngoingGroupCallContext {
|
|||||||
videoContentType: _videoContentType,
|
videoContentType: _videoContentType,
|
||||||
enableNoiseSuppression: enableNoiseSuppression,
|
enableNoiseSuppression: enableNoiseSuppression,
|
||||||
disableAudioInput: disableAudioInput,
|
disableAudioInput: disableAudioInput,
|
||||||
preferX264: preferX264,
|
prioritizeVP8: prioritizeVP8,
|
||||||
logPath: logPath,
|
logPath: logPath,
|
||||||
statsLogPath: tempStatsLogPath,
|
statsLogPath: tempStatsLogPath,
|
||||||
audioDevice: nil,
|
audioDevice: nil,
|
||||||
@ -1209,10 +1209,10 @@ public final class OngoingGroupCallContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(inputDeviceId: String = "", outputDeviceId: String = "", audioSessionActive: Signal<Bool, NoError>, video: OngoingCallVideoCapturer?, requestMediaChannelDescriptions: @escaping (Set<UInt32>, @escaping ([MediaChannelDescription]) -> Void) -> Disposable, rejoinNeeded: @escaping () -> Void, outgoingAudioBitrateKbit: Int32?, videoContentType: VideoContentType, enableNoiseSuppression: Bool, disableAudioInput: Bool, enableSystemMute: Bool, preferX264: Bool, logPath: String, onMutedSpeechActivityDetected: @escaping (Bool) -> Void, isConference: Bool, audioIsActiveByDefault: Bool, isStream: Bool, sharedAudioDevice: OngoingCallContext.AudioDevice?, encryptionContext: OngoingGroupCallEncryptionContext?) {
|
public init(inputDeviceId: String = "", outputDeviceId: String = "", audioSessionActive: Signal<Bool, NoError>, video: OngoingCallVideoCapturer?, requestMediaChannelDescriptions: @escaping (Set<UInt32>, @escaping ([MediaChannelDescription]) -> Void) -> Disposable, rejoinNeeded: @escaping () -> Void, outgoingAudioBitrateKbit: Int32?, videoContentType: VideoContentType, enableNoiseSuppression: Bool, disableAudioInput: Bool, enableSystemMute: Bool, prioritizeVP8: Bool, logPath: String, onMutedSpeechActivityDetected: @escaping (Bool) -> Void, isConference: Bool, audioIsActiveByDefault: Bool, isStream: Bool, sharedAudioDevice: OngoingCallContext.AudioDevice?, encryptionContext: OngoingGroupCallEncryptionContext?) {
|
||||||
let queue = self.queue
|
let queue = self.queue
|
||||||
self.impl = QueueLocalObject(queue: queue, generate: {
|
self.impl = QueueLocalObject(queue: queue, generate: {
|
||||||
return Impl(queue: queue, inputDeviceId: inputDeviceId, outputDeviceId: outputDeviceId, audioSessionActive: audioSessionActive, video: video, requestMediaChannelDescriptions: requestMediaChannelDescriptions, rejoinNeeded: rejoinNeeded, outgoingAudioBitrateKbit: outgoingAudioBitrateKbit, videoContentType: videoContentType, enableNoiseSuppression: enableNoiseSuppression, disableAudioInput: disableAudioInput, enableSystemMute: enableSystemMute, preferX264: preferX264, logPath: logPath, onMutedSpeechActivityDetected: onMutedSpeechActivityDetected, isConference: isConference, audioIsActiveByDefault: audioIsActiveByDefault, isStream: isStream, sharedAudioDevice: sharedAudioDevice, encryptionContext: encryptionContext)
|
return Impl(queue: queue, inputDeviceId: inputDeviceId, outputDeviceId: outputDeviceId, audioSessionActive: audioSessionActive, video: video, requestMediaChannelDescriptions: requestMediaChannelDescriptions, rejoinNeeded: rejoinNeeded, outgoingAudioBitrateKbit: outgoingAudioBitrateKbit, videoContentType: videoContentType, enableNoiseSuppression: enableNoiseSuppression, disableAudioInput: disableAudioInput, enableSystemMute: enableSystemMute, prioritizeVP8: prioritizeVP8, logPath: logPath, onMutedSpeechActivityDetected: onMutedSpeechActivityDetected, isConference: isConference, audioIsActiveByDefault: audioIsActiveByDefault, isStream: isStream, sharedAudioDevice: sharedAudioDevice, encryptionContext: encryptionContext)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ typedef NS_ENUM(int32_t, OngoingGroupCallRequestedVideoQuality) {
|
|||||||
enableNoiseSuppression:(bool)enableNoiseSuppression
|
enableNoiseSuppression:(bool)enableNoiseSuppression
|
||||||
disableAudioInput:(bool)disableAudioInput
|
disableAudioInput:(bool)disableAudioInput
|
||||||
enableSystemMute:(bool)enableSystemMute
|
enableSystemMute:(bool)enableSystemMute
|
||||||
preferX264:(bool)preferX264
|
prioritizeVP8:(bool)prioritizeVP8
|
||||||
logPath:(NSString * _Nonnull)logPath
|
logPath:(NSString * _Nonnull)logPath
|
||||||
statsLogPath:(NSString * _Nonnull)statsLogPath
|
statsLogPath:(NSString * _Nonnull)statsLogPath
|
||||||
onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDetected
|
onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDetected
|
||||||
|
@ -2371,7 +2371,7 @@ private:
|
|||||||
enableNoiseSuppression:(bool)enableNoiseSuppression
|
enableNoiseSuppression:(bool)enableNoiseSuppression
|
||||||
disableAudioInput:(bool)disableAudioInput
|
disableAudioInput:(bool)disableAudioInput
|
||||||
enableSystemMute:(bool)enableSystemMute
|
enableSystemMute:(bool)enableSystemMute
|
||||||
preferX264:(bool)preferX264
|
prioritizeVP8:(bool)prioritizeVP8
|
||||||
logPath:(NSString * _Nonnull)logPath
|
logPath:(NSString * _Nonnull)logPath
|
||||||
statsLogPath:(NSString * _Nonnull)statsLogPath
|
statsLogPath:(NSString * _Nonnull)statsLogPath
|
||||||
onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDetected
|
onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDetected
|
||||||
@ -2383,8 +2383,6 @@ encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, bool))encryp
|
|||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_queue = queue;
|
_queue = queue;
|
||||||
|
|
||||||
tgcalls::PlatformInterface::SharedInstance()->preferX264 = preferX264;
|
|
||||||
|
|
||||||
_sinks = [[NSMutableDictionary alloc] init];
|
_sinks = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
_networkStateUpdated = [networkStateUpdated copy];
|
_networkStateUpdated = [networkStateUpdated copy];
|
||||||
@ -2436,6 +2434,9 @@ encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, bool))encryp
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<tgcalls::VideoCodecName> videoCodecPreferences;
|
std::vector<tgcalls::VideoCodecName> videoCodecPreferences;
|
||||||
|
if (prioritizeVP8) {
|
||||||
|
videoCodecPreferences.push_back(tgcalls::VideoCodecName::VP8);
|
||||||
|
}
|
||||||
|
|
||||||
int minOutgoingVideoBitrateKbit = 500;
|
int minOutgoingVideoBitrateKbit = 500;
|
||||||
bool disableOutgoingAudioProcessing = false;
|
bool disableOutgoingAudioProcessing = false;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit a15014304d25193157ee809e8faceaca95dd8192
|
Subproject commit 18ef54fd10115ad7fe73585b7bf8a7ddbe527124
|
Loading…
x
Reference in New Issue
Block a user