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,
|
||||
disableAudioInput: true,
|
||||
enableSystemMute: false,
|
||||
preferX264: false,
|
||||
prioritizeVP8: false,
|
||||
logPath: "",
|
||||
onMutedSpeechActivityDetected: { _ in },
|
||||
isConference: false,
|
||||
|
@ -1032,7 +1032,6 @@ public final class PresentationCallImpl: PresentationCall {
|
||||
self.conferenceCallImpl = conferenceCall
|
||||
conferenceCall.upgradedConferenceCall = self
|
||||
|
||||
conferenceCall.setConferenceInvitedPeers(self.pendingInviteToConferencePeerIds)
|
||||
for (peerId, isVideo) in self.pendingInviteToConferencePeerIds {
|
||||
let _ = conferenceCall.invitePeer(peerId, isVideo: isVideo)
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ private final class ScreencastInProcessIPCContext: ScreencastIPCContext {
|
||||
enableNoiseSuppression: false,
|
||||
disableAudioInput: true,
|
||||
enableSystemMute: false,
|
||||
preferX264: false,
|
||||
prioritizeVP8: false,
|
||||
logPath: "",
|
||||
onMutedSpeechActivityDetected: { _ in },
|
||||
isConference: self.isConference,
|
||||
@ -2115,6 +2115,16 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
// Prevent non-encrypted conference calls
|
||||
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
|
||||
let disposable = MetaDisposable()
|
||||
@ -2134,7 +2144,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
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 {
|
||||
guard let self else {
|
||||
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) {
|
||||
var updatedInvitedPeers = self.invitedPeersValue
|
||||
updatedInvitedPeers.removeAll(where: { $0.id == peerId})
|
||||
|
@ -499,7 +499,7 @@ public final class OngoingGroupCallContext {
|
||||
enableNoiseSuppression: Bool,
|
||||
disableAudioInput: Bool,
|
||||
enableSystemMute: Bool,
|
||||
preferX264: Bool,
|
||||
prioritizeVP8: Bool,
|
||||
logPath: String,
|
||||
onMutedSpeechActivityDetected: @escaping (Bool) -> Void,
|
||||
isConference: Bool,
|
||||
@ -633,7 +633,7 @@ public final class OngoingGroupCallContext {
|
||||
enableNoiseSuppression: enableNoiseSuppression,
|
||||
disableAudioInput: disableAudioInput,
|
||||
enableSystemMute: enableSystemMute,
|
||||
preferX264: preferX264,
|
||||
prioritizeVP8: prioritizeVP8,
|
||||
logPath: logPath,
|
||||
statsLogPath: tempStatsLogPath,
|
||||
onMutedSpeechActivityDetected: { value in
|
||||
@ -746,7 +746,7 @@ public final class OngoingGroupCallContext {
|
||||
videoContentType: _videoContentType,
|
||||
enableNoiseSuppression: enableNoiseSuppression,
|
||||
disableAudioInput: disableAudioInput,
|
||||
preferX264: preferX264,
|
||||
prioritizeVP8: prioritizeVP8,
|
||||
logPath: logPath,
|
||||
statsLogPath: tempStatsLogPath,
|
||||
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
|
||||
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
|
||||
disableAudioInput:(bool)disableAudioInput
|
||||
enableSystemMute:(bool)enableSystemMute
|
||||
preferX264:(bool)preferX264
|
||||
prioritizeVP8:(bool)prioritizeVP8
|
||||
logPath:(NSString * _Nonnull)logPath
|
||||
statsLogPath:(NSString * _Nonnull)statsLogPath
|
||||
onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDetected
|
||||
|
@ -2371,7 +2371,7 @@ private:
|
||||
enableNoiseSuppression:(bool)enableNoiseSuppression
|
||||
disableAudioInput:(bool)disableAudioInput
|
||||
enableSystemMute:(bool)enableSystemMute
|
||||
preferX264:(bool)preferX264
|
||||
prioritizeVP8:(bool)prioritizeVP8
|
||||
logPath:(NSString * _Nonnull)logPath
|
||||
statsLogPath:(NSString * _Nonnull)statsLogPath
|
||||
onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDetected
|
||||
@ -2382,8 +2382,6 @@ encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, bool))encryp
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_queue = queue;
|
||||
|
||||
tgcalls::PlatformInterface::SharedInstance()->preferX264 = preferX264;
|
||||
|
||||
_sinks = [[NSMutableDictionary alloc] init];
|
||||
|
||||
@ -2436,6 +2434,9 @@ encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, bool))encryp
|
||||
#endif
|
||||
|
||||
std::vector<tgcalls::VideoCodecName> videoCodecPreferences;
|
||||
if (prioritizeVP8) {
|
||||
videoCodecPreferences.push_back(tgcalls::VideoCodecName::VP8);
|
||||
}
|
||||
|
||||
int minOutgoingVideoBitrateKbit = 500;
|
||||
bool disableOutgoingAudioProcessing = false;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit a15014304d25193157ee809e8faceaca95dd8192
|
||||
Subproject commit 18ef54fd10115ad7fe73585b7bf8a7ddbe527124
|
Loading…
x
Reference in New Issue
Block a user