diff --git a/build-system/bazel-rules/apple_support b/build-system/bazel-rules/apple_support index b8755bd288..501b4afb27 160000 --- a/build-system/bazel-rules/apple_support +++ b/build-system/bazel-rules/apple_support @@ -1 +1 @@ -Subproject commit b8755bd2884d6bf651827c30e00bd0ea318e41a2 +Subproject commit 501b4afb27745c4813a88ffa28acd901408014e4 diff --git a/build-system/bazel-rules/rules_apple b/build-system/bazel-rules/rules_apple index d6f9a87d70..748e7e2b1e 160000 --- a/build-system/bazel-rules/rules_apple +++ b/build-system/bazel-rules/rules_apple @@ -1 +1 @@ -Subproject commit d6f9a87d70781e92b95b9344c7d21d921ccc3ae2 +Subproject commit 748e7e2b1ee5e8976ba873394cbd5e32b61818c7 diff --git a/build-system/bazel-rules/rules_swift b/build-system/bazel-rules/rules_swift index 44e8c29afe..6408d85da7 160000 --- a/build-system/bazel-rules/rules_swift +++ b/build-system/bazel-rules/rules_swift @@ -1 +1 @@ -Subproject commit 44e8c29afe3baa7f5fc434f4a7e83f7ac786644e +Subproject commit 6408d85da799ec2af053c4e2883dce3ce6d30f08 diff --git a/build-system/tulsi b/build-system/tulsi index e890fb6c88..ee185c4c20 160000 --- a/build-system/tulsi +++ b/build-system/tulsi @@ -1 +1 @@ -Subproject commit e890fb6c88846454c4f69abd8d265a302c0e80e4 +Subproject commit ee185c4c20ea4384bc3cbf8ccd8705c904154abb diff --git a/submodules/TelegramCore/Sources/SearchMessages.swift b/submodules/TelegramCore/Sources/SearchMessages.swift index e0e3f0a79c..27301c4f54 100644 --- a/submodules/TelegramCore/Sources/SearchMessages.swift +++ b/submodules/TelegramCore/Sources/SearchMessages.swift @@ -323,8 +323,8 @@ public func searchMessages(account: Account, location: SearchMessagesLocation, q |> mapToSignal { result, additionalResult -> Signal<(SearchMessagesResult, SearchMessagesState), NoError> in return account.postbox.transaction { transaction -> (SearchMessagesResult, SearchMessagesState) in var additional: SearchMessagesPeerState? = mergedState(transaction: transaction, state: state?.additional, result: additionalResult) - if state?.additional == nil, case .general = location { - let secretMessages = transaction.searchMessages(peerId: nil, query: query, tags: nil) + if state?.additional == nil, case let .general(tags) = location { + let secretMessages = transaction.searchMessages(peerId: nil, query: query, tags: tags) var readStates: [PeerId: CombinedPeerReadState] = [:] for message in secretMessages { if let readState = transaction.getCombinedPeerReadState(message.id.peerId) { diff --git a/submodules/TgVoipWebrtc/PublicHeaders/TgVoip/OngoingCallThreadLocalContext.h b/submodules/TgVoipWebrtc/PublicHeaders/TgVoip/OngoingCallThreadLocalContext.h index 37ba55746f..a9e3bebfcd 100644 --- a/submodules/TgVoipWebrtc/PublicHeaders/TgVoip/OngoingCallThreadLocalContext.h +++ b/submodules/TgVoipWebrtc/PublicHeaders/TgVoip/OngoingCallThreadLocalContext.h @@ -102,14 +102,16 @@ typedef NS_ENUM(int32_t, OngoingCallDataSavingWebrtc) { - (void)setOnIsMirroredUpdated:(void (^ _Nullable)(bool))onIsMirroredUpdated; #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - (void)setVideoContentMode:(CALayerContentsGravity _Nonnull )mode; +- (void)setForceMirrored:(bool)forceMirrored; #endif @end @interface OngoingCallThreadLocalContextVideoCapturer : NSObject - (instancetype _Nonnull)init; +- (instancetype _Nonnull)initWithDeviceId:(NSString * _Nonnull)deviceId; -- (void)switchVideoInput:(bool)isFront; +- (void)switchVideoInput:(NSString * _Nonnull)deviceId; - (void)setIsVideoEnabled:(bool)isVideoEnabled; - (void)makeOutgoingVideoView:(void (^_Nonnull)(UIView * _Nullable))completion; @@ -132,7 +134,7 @@ typedef NS_ENUM(int32_t, OngoingCallDataSavingWebrtc) { - (void)stop:(void (^_Nullable)(NSString * _Nullable debugLog, int64_t bytesSentWifi, int64_t bytesReceivedWifi, int64_t bytesSentMobile, int64_t bytesReceivedMobile))completion; - (bool)needRate; - + - (NSString * _Nullable)debugInfo; - (NSString * _Nullable)version; - (NSData * _Nonnull)getDerivedState; diff --git a/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm b/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm index eb14febcf1..8f2b285ca5 100644 --- a/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm +++ b/submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm @@ -13,7 +13,7 @@ #ifndef WEBRTC_IOS #import "platform/darwin/VideoMetalViewMac.h" -#define GLVideoView VideoMetalView +#import "platform/darwin/GLVideoViewMac.h" #define UIViewContentModeScaleAspectFill kCAGravityResizeAspectFill #define UIViewContentModeScaleAspect kCAGravityResizeAspect @@ -142,18 +142,23 @@ @implementation OngoingCallThreadLocalContextVideoCapturer - (instancetype _Nonnull)init { + return [self initWithDeviceId:@""]; +} + +- (instancetype _Nonnull)initWithDeviceId:(NSString * _Nonnull)deviceId { self = [super init]; if (self != nil) { - _interface = tgcalls::VideoCaptureInterface::Create(); + _interface = tgcalls::VideoCaptureInterface::Create(deviceId.UTF8String); } return self; } + - (void)dealloc { } -- (void)switchVideoInput:(bool)isFront { - _interface->switchToDevice(isFront ? "" : "back"); +- (void)switchVideoInput:(NSString * _Nonnull)deviceeId { + _interface->switchToDevice(deviceeId.UTF8String); } - (void)setIsVideoEnabled:(bool)isVideoEnabled { @@ -210,7 +215,7 @@ NSString *_version; id _queue; int32_t _contextId; - + OngoingCallNetworkTypeWebrtc _networkType; NSTimeInterval _callReceiveTimeout; NSTimeInterval _callRingTimeout; @@ -260,29 +265,29 @@ static tgcalls::NetworkType callControllerNetworkTypeForType(OngoingCallNetworkTypeWebrtc type) { switch (type) { - case OngoingCallNetworkTypeWifi: - return tgcalls::NetworkType::WiFi; - case OngoingCallNetworkTypeCellularGprs: - return tgcalls::NetworkType::Gprs; - case OngoingCallNetworkTypeCellular3g: - return tgcalls::NetworkType::ThirdGeneration; - case OngoingCallNetworkTypeCellularLte: - return tgcalls::NetworkType::Lte; - default: - return tgcalls::NetworkType::ThirdGeneration; + case OngoingCallNetworkTypeWifi: + return tgcalls::NetworkType::WiFi; + case OngoingCallNetworkTypeCellularGprs: + return tgcalls::NetworkType::Gprs; + case OngoingCallNetworkTypeCellular3g: + return tgcalls::NetworkType::ThirdGeneration; + case OngoingCallNetworkTypeCellularLte: + return tgcalls::NetworkType::Lte; + default: + return tgcalls::NetworkType::ThirdGeneration; } } static tgcalls::DataSaving callControllerDataSavingForType(OngoingCallDataSavingWebrtc type) { switch (type) { - case OngoingCallDataSavingNever: - return tgcalls::DataSaving::Never; - case OngoingCallDataSavingCellular: - return tgcalls::DataSaving::Mobile; - case OngoingCallDataSavingAlways: - return tgcalls::DataSaving::Always; - default: - return tgcalls::DataSaving::Never; + case OngoingCallDataSavingNever: + return tgcalls::DataSaving::Never; + case OngoingCallDataSavingCellular: + return tgcalls::DataSaving::Mobile; + case OngoingCallDataSavingAlways: + return tgcalls::DataSaving::Always; + default: + return tgcalls::DataSaving::Never; } } @@ -706,11 +711,11 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL; dispatch_async(dispatch_get_main_queue(), ^{ if ([VideoMetalView isSupported]) { VideoMetalView *remoteRenderer = [[VideoMetalView alloc] initWithFrame:CGRectZero]; - #if TARGET_OS_IPHONE +#if TARGET_OS_IPHONE remoteRenderer.videoContentMode = UIViewContentModeScaleToFill; - #else +#else remoteRenderer.videoContentMode = UIViewContentModeScaleAspect; - #endif +#endif std::shared_ptr> sink = [remoteRenderer getSink]; __strong OngoingCallThreadLocalContextWebrtc *strongSelf = weakSelf; diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index b906b5a955..d8b106c94e 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit b906b5a955f1e6e195cb91c4513d4cb7b3620ea6 +Subproject commit d8b106c94e5a5e20020ad862d835e921d4f102d9 diff --git a/third-party/libvpx/libvpx b/third-party/libvpx/libvpx index 2d20a42ab6..c413c8f18e 160000 --- a/third-party/libvpx/libvpx +++ b/third-party/libvpx/libvpx @@ -1 +1 @@ -Subproject commit 2d20a42ab60f8fed37612361f2ea776d0bc7ca1a +Subproject commit c413c8f18eb1932b100850505031980e27160d5f