mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Video avatar fixes
This commit is contained in:
parent
94ef5b9acf
commit
9d6d332623
@ -46,6 +46,8 @@
|
||||
- (void)setPlayerItem:(AVPlayerItem *)playerItem forCropRect:(CGRect)cropRect cropRotation:(CGFloat)cropRotation cropOrientation:(UIImageOrientation)cropOrientation cropMirrored:(bool)cropMirrored;
|
||||
- (void)setCIImage:(CIImage *)ciImage;
|
||||
|
||||
- (void)updateProcessChain:(bool)force;
|
||||
|
||||
- (void)processAnimated:(bool)animated completion:(void (^)(void))completion;
|
||||
- (void)reprocess;
|
||||
|
||||
|
@ -383,6 +383,10 @@
|
||||
}
|
||||
|
||||
- (void)updateProcessChain {
|
||||
[self updateProcessChain:false];
|
||||
}
|
||||
|
||||
- (void)updateProcessChain:(bool)force {
|
||||
[GPUImageFramebuffer setMark:self.forVideo];
|
||||
|
||||
NSMutableArray *processChain = [NSMutableArray array];
|
||||
@ -398,7 +402,7 @@
|
||||
|
||||
TGPhotoEditorPreviewView *previewOutput = self.previewOutput;
|
||||
|
||||
if (![_currentProcessChain isEqualToArray:processChain])
|
||||
if (![_currentProcessChain isEqualToArray:processChain] || force)
|
||||
{
|
||||
[_currentInput removeAllTargets];
|
||||
[_cropFilter removeAllTargets];
|
||||
|
@ -513,7 +513,7 @@ const CGFloat TGPhotoAvatarPreviewLandscapePanelSize = TGPhotoAvatarPreviewPanel
|
||||
if (!self.initialAppearance)
|
||||
[_cropView openCurtains];
|
||||
[_cropView transitionInFinishedFromCamera:(self.fromCamera && self.initialAppearance)];
|
||||
|
||||
|
||||
PGPhotoEditor *photoEditor = self.photoEditor;
|
||||
[photoEditor processAnimated:false completion:nil];
|
||||
}
|
||||
|
@ -1656,6 +1656,9 @@
|
||||
self.view.frame = targetFrame;
|
||||
} completion:^(__unused BOOL finished)
|
||||
{
|
||||
TGDispatchAfter(1.0, dispatch_get_main_queue(), ^{
|
||||
[_photoEditor updateProcessChain:true];
|
||||
});
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
@ -629,6 +629,24 @@ public class AvatarGalleryController: ViewController, StandalonePresentableContr
|
||||
let media = TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: rawEntry.representations.map({ $0.representation }), immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: [])
|
||||
mediaReference = .standalone(media: media)
|
||||
}
|
||||
|
||||
|
||||
// var cancelImpl: (() -> Void)?
|
||||
// let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
|
||||
// let progressSignal = Signal<Never, NoError> { subscriber in
|
||||
// let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
|
||||
// cancelImpl?()
|
||||
// }))
|
||||
// strongSelf.present(controller, in: .window(.root), with: ViewControllerPresentationArguments(presentationAnimation: .modalSheet))
|
||||
// return ActionDisposable { [weak controller] in
|
||||
// Queue.mainQueue().async() {
|
||||
// controller?.dismiss()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// |> runOn(Queue.mainQueue())
|
||||
// |> delay(0.15, queue: Queue.mainQueue())
|
||||
|
||||
|
||||
self.editDisposable.set((fetchMediaData(context: self.context, postbox: self.context.account.postbox, mediaReference: mediaReference)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] state, isImage in
|
||||
|
Loading…
x
Reference in New Issue
Block a user