Merge commit '9e3524019a74c1c789459d22e1da3d7efcff94d5'

This commit is contained in:
Isaac 2024-01-10 00:45:03 +04:00
commit 7b0979b87f
6 changed files with 71 additions and 4 deletions

View File

@ -0,0 +1,47 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MediaPlayer",
platforms: [.macOS(.v10_13)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "MediaPlayer",
targets: ["MediaPlayer"]),
],
dependencies: [
.package(name: "TelegramCore", path: "../TelegramCore"),
.package(name: "Postbox", path: "../Postbox"),
.package(name: "FFMpegBinding", path: "../FFMpegBinding"),
.package(name: "YuvConversion", path: "../YuvConversion"),
.package(name: "RingBuffer", path: "../RingBuffer"),
.package(name: "TGUIKit", path: "../../../../packages/TGUIKit"),
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "MediaPlayer",
dependencies: [.product(name: "TelegramCore", package: "TelegramCore", condition: nil),
.product(name: "Postbox", package: "Postbox", condition: nil),
.product(name: "FFMpegBinding", package: "FFMpegBinding", condition: nil),
.product(name: "YuvConversion", package: "YuvConversion", condition: nil),
.product(name: "RingBuffer", package: "RingBuffer", condition: nil),
.product(name: "TGUIKit", package: "TGUIKit", condition: nil),
],
path: "Sources",
exclude: ["MediaPlayer.swift",
"MediaPlayerScrubbingNode.swift",
"MediaPlayerTimeTextNode.swift",
"MediaPlayerNode.swift",
"MediaPlayerAudioRenderer.swift",
"MediaPlayerFramePreview.swift",
"VideoPlayerProxy.swift"]),
]
)

View File

@ -5,7 +5,7 @@ public final class MediaPlaybackBuffers {
public let audioBuffer: MediaTrackFrameBuffer?
public let videoBuffer: MediaTrackFrameBuffer?
init(audioBuffer: MediaTrackFrameBuffer?, videoBuffer: MediaTrackFrameBuffer?) {
public init(audioBuffer: MediaTrackFrameBuffer?, videoBuffer: MediaTrackFrameBuffer?) {
self.audioBuffer = audioBuffer
self.videoBuffer = videoBuffer
}

View File

@ -33,10 +33,10 @@ public final class MediaTrackFrameBuffer {
private let decoder: MediaTrackFrameDecoder
private let type: MediaTrackFrameType
public let duration: CMTime
let rotationAngle: Double
let aspect: Double
public let rotationAngle: Double
public let aspect: Double
var statusUpdated: () -> Void = { }
public var statusUpdated: () -> Void = { }
private var frameSourceSinkIndex: Int?

View File

@ -1,5 +1,9 @@
import Foundation
#if !os(macOS)
import UIKit
#else
import AppKit
#endif
import SwiftSignalKit
import Postbox
import TelegramCore

View File

@ -203,6 +203,7 @@ public struct CachedUserFlags: OptionSet {
public static let translationHidden = CachedUserFlags(rawValue: 1 << 0)
public static let isBlockedFromStories = CachedUserFlags(rawValue: 1 << 1)
public static let readDatesPrivate = CachedUserFlags(rawValue: 1 << 2)
}
public final class EditableBotInfo: PostboxCoding, Equatable {

View File

@ -235,6 +235,20 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
let voiceCallsAvailable = (userFullFlags & (1 << 4)) != 0
let videoCallsAvailable = (userFullFlags & (1 << 13)) != 0
let voiceMessagesAvailable = (userFullFlags & (1 << 20)) == 0
let readDatesPrivate = (userFullFlags & (1 << 30)) != 0
let translationsDisabled = (userFullFlags & (1 << 23)) != 0
var flags: CachedUserFlags = previous.flags
if readDatesPrivate {
flags.insert(.readDatesPrivate)
} else {
flags.remove(.readDatesPrivate)
}
if translationsDisabled {
flags.insert(.translationHidden)
} else {
flags.remove(.translationHidden)
}
let callsPrivate = (userFullFlags & (1 << 5)) != 0
let canPinMessages = (userFullFlags & (1 << 7)) != 0
@ -286,6 +300,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
.withUpdatedPremiumGiftOptions(premiumGiftOptions)
.withUpdatedVoiceMessagesAvailable(voiceMessagesAvailable)
.withUpdatedWallpaper(wallpaper)
.withUpdatedFlags(flags)
}
})
}