Feat/row align bytes (#7)
* better bytes alignment Signed-off-by: fufesou <shuanglongchen@yeah.net> * debug macos Signed-off-by: fufesou <shuanglongchen@yeah.net> * debug linux Signed-off-by: fufesou <shuanglongchen@yeah.net> * windows switch_rgba Signed-off-by: fufesou <shuanglongchen@yeah.net> * better switch_rgba Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
044bb260d9
commit
873919902e
16 changed files with 94 additions and 60 deletions
|
|
@ -34,7 +34,7 @@ import CoreVideo
|
|||
}
|
||||
|
||||
|
||||
@objc public func markFrameAvaliable(data: Data, width: Int, height: Int, stride_align: Int) -> Bool {
|
||||
@objc public func markFrameAvaliable(data: Data, width: Int, height: Int, row_align_bytes: Int) -> Bool {
|
||||
queue.sync {
|
||||
self.data = data.withUnsafeBytes { buffer in
|
||||
var pixelBufferCopy: CVPixelBuffer!
|
||||
|
|
@ -44,7 +44,7 @@ import CoreVideo
|
|||
kCVPixelBufferMetalCompatibilityKey: true,
|
||||
kCVPixelBufferOpenGLCompatibilityKey: true,
|
||||
// https://developer.apple.com/forums/thread/712709
|
||||
kCVPixelBufferBytesPerRowAlignmentKey: stride_align * 4
|
||||
kCVPixelBufferBytesPerRowAlignmentKey: 64
|
||||
] as CFDictionary, &pixelBufferCopy)
|
||||
guard result == kCVReturnSuccess else {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue