Use NotSync Parameter Instead Of DependsOnOthers

This commit is contained in:
shogo4405 2019-07-27 17:38:34 +09:00
parent 91dbcd3a49
commit fd29d05f07
3 changed files with 2 additions and 11 deletions

View File

@ -10,15 +10,6 @@ extension CMSampleBuffer {
}
}
var dependsOnOthers: Bool {
get {
return getAttachmentValue(for: kCMSampleAttachmentKey_DependsOnOthers) ?? true
}
set {
setAttachmentValue(for: kCMSampleAttachmentKey_DependsOnOthers, value: newValue)
}
}
var dataBuffer: CMBlockBuffer? {
get {
return CMSampleBufferGetDataBuffer(self)

View File

@ -262,7 +262,7 @@ extension TSWriter: VideoEncoderDelegate {
count: UInt32(length),
presentationTimeStamp: sampleBuffer.presentationTimeStamp,
decodeTimeStamp: sampleBuffer.decodeTimeStamp,
randomAccessIndicator: !sampleBuffer.dependsOnOthers
randomAccessIndicator: !sampleBuffer.isNotSync
)
}
}

View File

@ -59,7 +59,7 @@ extension RTMPMuxer: VideoEncoderDelegate {
}
func sampleOutput(video sampleBuffer: CMSampleBuffer) {
let keyframe: Bool = !sampleBuffer.dependsOnOthers
let keyframe: Bool = !sampleBuffer.isNotSync
var compositionTime: Int32 = 0
let presentationTimeStamp: CMTime = sampleBuffer.presentationTimeStamp
var decodeTimeStamp: CMTime = sampleBuffer.decodeTimeStamp