Files
HaishinKit.swift/HaishinKit/Sources/Extension/CMSampleBuffer+Extension.swift
2025-07-13 12:43:53 +09:00

27 lines
662 B
Swift

import Accelerate
import AVFoundation
import CoreMedia
package extension CMSampleBuffer {
@inlinable @inline(__always) var isNotSync: Bool {
get {
guard !sampleAttachments.isEmpty else {
return false
}
return sampleAttachments[0][.notSync] != nil
}
set {
guard !sampleAttachments.isEmpty else {
return
}
sampleAttachments[0][.notSync] = newValue ? 1 : nil
}
}
}
#if hasAttribute(retroactive)
extension CMSampleBuffer: @retroactive @unchecked Sendable {}
#else
extension CMSampleBuffer: @unchecked Sendable {}
#endif