update to 9.2.0

This commit is contained in:
xaxtix 2022-12-06 23:13:44 +04:00
parent 0e17caa7a6
commit b73fc8de38
242 changed files with 14252 additions and 5037 deletions

View file

@ -5099,6 +5099,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
requestVideoPreview(2);
});
qualityPicker.doneButton.setOnClickListener(view -> {
Object object = imagesArrLocals.get(currentIndex);
if (object instanceof MediaController.MediaEditState) {
((MediaController.MediaEditState) object).editedInfo = getCurrentVideoEditedInfo();
}
showQualityView(false);
requestVideoPreview(2);
});
@ -7492,6 +7496,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
videoEditedInfo.endTime *= 2;
}
videoEditedInfo.end = videoEditedInfo.endTime;
videoEditedInfo.compressQuality = selectedCompression;
videoEditedInfo.rotationValue = 0;
videoEditedInfo.originalPath = currentImagePath;
videoEditedInfo.estimatedSize = (int) (videoEditedInfo.endTime / 1000.0f * 115200);
@ -7548,6 +7553,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
videoEditedInfo.endTime = endTime;
videoEditedInfo.start = videoCutStart;
videoEditedInfo.end = videoCutEnd;
videoEditedInfo.compressQuality = selectedCompression;
videoEditedInfo.rotationValue = rotationValue;
videoEditedInfo.originalWidth = originalWidth;
videoEditedInfo.originalHeight = originalHeight;
@ -10619,7 +10625,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
}
} else if (MessageObject.getMedia(message.messageOwner) instanceof TLRPC.TL_messageMediaInvoice) {
return ImageLocation.getForWebFile(WebFile.createWithWebDocument(((TLRPC.TL_messageMediaInvoice) MessageObject.getMedia(message.messageOwner)).photo));
return ImageLocation.getForWebFile(WebFile.createWithWebDocument(((TLRPC.TL_messageMediaInvoice) MessageObject.getMedia(message.messageOwner)).webPhoto));
} else if (message.getDocument() != null) {
TLRPC.Document document = message.getDocument();
if (sharedMediaType == MediaDataController.MEDIA_GIF) {
@ -11554,15 +11560,17 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
boolean isMuted = false;
float start = 0.0f;
float end = 1.0f;
int compressQuality = -1;
if (object instanceof MediaController.PhotoEntry) {
MediaController.PhotoEntry photoEntry = ((MediaController.PhotoEntry) object);
if (photoEntry.editedInfo != null) {
isMuted = photoEntry.editedInfo.muted;
start = photoEntry.editedInfo.start;
end = photoEntry.editedInfo.end;
compressQuality = photoEntry.editedInfo.compressQuality;
}
}
processOpenVideo(currentPathObject, isMuted, start, end);
processOpenVideo(currentPathObject, isMuted, start, end, compressQuality);
if (isDocumentsPicker || Build.VERSION.SDK_INT < 18) {
showVideoTimeline(false, animated);
videoAvatarTooltip.setVisibility(View.GONE);
@ -11882,8 +11890,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
if (isVideo || isEmbedVideo) {
speedItem.setVisibility(View.VISIBLE);
speedGap.setVisibility(View.VISIBLE);
menuItem.showSubItem(gallery_menu_speed);
speedGap.setVisibility(menuItem.getVisibleSubItemsCount() > 1 ? View.VISIBLE : View.GONE);
} else {
speedItem.setVisibility(View.GONE);
speedGap.setVisibility(View.GONE);
@ -16799,7 +16807,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
return new ByteArrayInputStream(output, 0, outPos);
}
private void processOpenVideo(final String videoPath, boolean muted, float start, float end) {
private void processOpenVideo(final String videoPath, boolean muted, float start, float end, int compressQality) {
if (currentLoadingVideoRunnable != null) {
Utilities.globalQueue.cancelRunnable(currentLoadingVideoRunnable);
currentLoadingVideoRunnable = null;
@ -16852,7 +16860,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
resultHeight = originalHeight = params[AnimatedFileDrawable.PARAM_NUM_HEIGHT];
updateCompressionsCount(originalWidth, originalHeight);
selectedCompression = selectCompression();
if (compressQality == -1) {
selectedCompression = selectCompression();
} else {
selectedCompression = compressQality;
}
updateWidthHeightBitrateForCompression();
if (selectedCompression > compressionsCount - 1) {