大强哥
大强哥
stop操作的时候少remove了个KVO
需要真机测,模拟器是好的,不知道为啥
[bufferAttributes setObject:[NSNumber numberWithUnsignedInt:(int)size.width/16*16] forKey:(NSString*)kCVPixelBufferWidthKey];//这个位置包括下面的两个,必须写成(int)size.width/16*16,因为这个的大小必须是16的倍数,否则图像会发生拉扯、挤压、旋转。。。。不知道为啥 [bufferAttributes setObject:[NSNumber numberWithUnsignedInt:(int)size.height/16*16] forKey:(NSString*)kCVPixelBufferHeightKey]; [bufferAttributes setObject:@YES forKey:(NSString*)kCVPixelBufferCGBitmapContextCompatibilityKey]; 这边也按照你的注释修改了,一运行就奔溃了