Refact/stride align (#8)
* rename row_align_bytes to stride_align Signed-off-by: fufesou <shuanglongchen@yeah.net> * trivail changes Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
873919902e
commit
8d66a7c55e
13 changed files with 26 additions and 26 deletions
|
|
@ -34,7 +34,7 @@ import CoreVideo
|
|||
}
|
||||
|
||||
|
||||
@objc public func markFrameAvaliable(data: Data, width: Int, height: Int, row_align_bytes: Int) -> Bool {
|
||||
@objc public func markFrameAvaliable(data: Data, width: Int, height: Int, stride_align: Int) -> Bool {
|
||||
queue.sync {
|
||||
self.data = data.withUnsafeBytes { buffer in
|
||||
var pixelBufferCopy: CVPixelBuffer!
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/// Keep the same name with Windows.
|
||||
void FlutterRgbaRendererPluginOnRgba(void* texture_rgba_ptr, const uint8_t* buffer, int len, int width, int height, int row_align_bytes) {
|
||||
void FlutterRgbaRendererPluginOnRgba(void* texture_rgba_ptr, const uint8_t* buffer, int len, int width, int height, int stride_align) {
|
||||
TextRgba* texture_rgba = (__bridge TextRgba *)(texture_rgba_ptr);
|
||||
NSData* data = [NSData dataWithBytesNoCopy:(void*)buffer length:len freeWhenDone:FALSE];
|
||||
[texture_rgba markFrameAvaliableWithData:data width:width height:height row_align_bytes: row_align_bytes];
|
||||
[texture_rgba markFrameAvaliableWithData:data width:width height:height stride_align: stride_align];
|
||||
}
|
||||
|
||||
#if __cplusplus
|
||||
|
|
|
|||
|
|
@ -49,12 +49,12 @@ public class TextureRgbaRendererPlugin: NSObject, FlutterPlugin {
|
|||
let data = args["data"] as! FlutterStandardTypedData
|
||||
let height = args["height"] as! Int
|
||||
let width = args["width"] as! Int
|
||||
let row_align_bytes = args["row_align_bytes"] as! Int
|
||||
let stride_align = args["stride_align"] as! Int
|
||||
let textureRgba = renderer[key]
|
||||
if (textureRgba == nil) {
|
||||
result(false)
|
||||
} else {
|
||||
result(textureRgba!.markFrameAvaliable(data: data.data, width: width, height: height, row_align_bytes: row_align_bytes))
|
||||
result(textureRgba!.markFrameAvaliable(data: data.data, width: width, height: height, stride_align: stride_align))
|
||||
}
|
||||
case "getTexturePtr":
|
||||
let args = call.arguments as! Dictionary<String, Any?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue