Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,66 @@
import Foundation
public struct MediaResourceId: Equatable, Hashable {
public var stringRepresentation: String
public init(_ stringRepresentation: String) {
self.stringRepresentation = stringRepresentation
}
}
public protocol MediaResource: AnyObject {
var id: MediaResourceId { get }
var size: Int64? { get }
var streamable: Bool { get }
var headerSize: Int32 { get }
func isEqual(to: MediaResource) -> Bool
}
public extension MediaResource {
var streamable: Bool {
return false
}
var headerSize: Int32 {
return 0
}
}
public protocol CachedMediaResourceRepresentation {
var uniqueId: String { get }
var keepDuration: CachedMediaRepresentationKeepDuration { get }
func isEqual(to: CachedMediaResourceRepresentation) -> Bool
}
public protocol MediaResourceFetchTag {
}
public protocol MediaResourceFetchInfo {
}
public final class MediaResourceStorageLocation {
public let peerId: PeerId
public let messageId: MessageId?
public init(peerId: PeerId, messageId: MessageId?) {
self.peerId = peerId
self.messageId = messageId
}
}
public struct MediaResourceFetchParameters {
public let tag: MediaResourceFetchTag?
public let info: MediaResourceFetchInfo?
public let location: MediaResourceStorageLocation?
public let contentType: UInt8
public let isRandomAccessAllowed: Bool
public init(tag: MediaResourceFetchTag?, info: MediaResourceFetchInfo?, location: MediaResourceStorageLocation?, contentType: UInt8, isRandomAccessAllowed: Bool) {
self.tag = tag
self.info = info
self.location = location
self.contentType = contentType
self.isRandomAccessAllowed = isRandomAccessAllowed
}
}