From 00a224aecb8eb2ad7bff0b4eb028dcf65c108be5 Mon Sep 17 00:00:00 2001 From: overtake Date: Wed, 30 Jun 2021 22:55:53 +0300 Subject: [PATCH 1/2] no message --- .../Sources/GroupCallContext.swift | 43 +++---------------- .../OngoingCallThreadLocalContext.h | 2 + .../Sources/OngoingCallThreadLocalContext.mm | 4 +- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/submodules/TelegramVoip/Sources/GroupCallContext.swift b/submodules/TelegramVoip/Sources/GroupCallContext.swift index 98f829d5e3..68e4900a64 100644 --- a/submodules/TelegramVoip/Sources/GroupCallContext.swift +++ b/submodules/TelegramVoip/Sources/GroupCallContext.swift @@ -601,44 +601,15 @@ public final class OngoingGroupCallContext { mainView?.setOnIsMirroredUpdated { value in f?(value) } + }, + setIsPaused: { [weak mainView] paused in + mainView?.setIsPaused(paused) + }, + renderToSize: { [weak mainView] size, animated in + mainView?.render(to: size, animated: animated) } ) - var cloneVideoView: OngoingCallContextPresentationCallVideoView? - if let cloneView = cloneView { - cloneVideoView = OngoingCallContextPresentationCallVideoView( - view: cloneView, - setOnFirstFrameReceived: { [weak cloneView] f in - cloneView?.setOnFirstFrameReceived(f) - }, - getOrientation: { [weak cloneView] in - if let cloneView = cloneView { - return OngoingCallVideoOrientation(cloneView.orientation) - } else { - return .rotation0 - } - }, - getAspect: { [weak cloneView] in - if let cloneView = cloneView { - return cloneView.aspect - } else { - return 0.0 - } - }, - setOnOrientationUpdated: { [weak cloneView] f in - cloneView?.setOnOrientationUpdated { value, aspect in - f?(OngoingCallVideoOrientation(value), aspect) - } - }, setVideoContentMode: { [weak cloneView] mode in - cloneView?.setVideoContentMode(mode) - }, - setOnIsMirroredUpdated: { [weak cloneView] f in - cloneView?.setOnIsMirroredUpdated { value in - f?(value) - } - } - ) - } - completion(mainVideoView, cloneVideoView) + completion(mainVideoView, nil) #endif } else { completion(nil, nil) diff --git a/submodules/TgVoipWebrtc/PublicHeaders/TgVoipWebrtc/OngoingCallThreadLocalContext.h b/submodules/TgVoipWebrtc/PublicHeaders/TgVoipWebrtc/OngoingCallThreadLocalContext.h index 6e8ca83fb0..35dbb76c1f 100644 --- a/submodules/TgVoipWebrtc/PublicHeaders/TgVoipWebrtc/OngoingCallThreadLocalContext.h +++ b/submodules/TgVoipWebrtc/PublicHeaders/TgVoipWebrtc/OngoingCallThreadLocalContext.h @@ -105,6 +105,8 @@ typedef NS_ENUM(int32_t, OngoingCallDataSavingWebrtc) { #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - (void)setVideoContentMode:(CALayerContentsGravity _Nonnull )mode; - (void)setForceMirrored:(bool)forceMirrored; +- (void)setIsPaused:(bool)paused; +- (void)renderToSize:(NSSize)size animated: (bool)animated; #endif @end diff --git a/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm b/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm index 7f76974a47..677c41ef41 100644 --- a/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm +++ b/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm @@ -1110,8 +1110,8 @@ private: } std::vector videoCodecPreferences; - videoCodecPreferences.push_back(tgcalls::VideoCodecName::VP8); - //videoCodecPreferences.push_back(tgcalls::VideoCodecName::VP9); + videoCodecPreferences.push_back(tgcalls::VideoCodecName::H264); + //videoCodecPreferences.push_back(tgcalls::VideoCodecName::VP9);/ int minOutgoingVideoBitrateKbit = 500; From 10bf97e9e01b8d3b2e744c6a3086bcb72b51b1fb Mon Sep 17 00:00:00 2001 From: overtake Date: Fri, 2 Jul 2021 15:49:51 +0300 Subject: [PATCH 2/2] metal drawing improvements --- .../TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm b/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm index 677c41ef41..33eb99070e 100644 --- a/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm +++ b/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm @@ -1110,7 +1110,7 @@ private: } std::vector videoCodecPreferences; - videoCodecPreferences.push_back(tgcalls::VideoCodecName::H264); +// videoCodecPreferences.push_back(tgcalls::VideoCodecName::H264); //videoCodecPreferences.push_back(tgcalls::VideoCodecName::VP9);/ int minOutgoingVideoBitrateKbit = 500;