react-native-rectangle-doc-scanner 3.9.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -140,7 +140,9 @@
140
140
  AVCaptureVideoDataOutput *dataOutput = [[AVCaptureVideoDataOutput alloc] init];
141
141
  [dataOutput setAlwaysDiscardsLateVideoFrames:YES];
142
142
  [dataOutput setVideoSettings:@{(id)kCVPixelBufferPixelFormatTypeKey:@(kCVPixelFormatType_32BGRA)}];
143
- [dataOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];
143
+ // Use background queue for video processing to avoid blocking UI
144
+ dispatch_queue_t videoQueue = dispatch_queue_create("com.scanner.videoQueue", DISPATCH_QUEUE_SERIAL);
145
+ [dataOutput setSampleBufferDelegate:self queue:videoQueue];
144
146
  [session addOutput:dataOutput];
145
147
 
146
148
  // Use modern AVCapturePhotoOutput for best quality
@@ -298,10 +300,15 @@
298
300
  fromRect = CGRectMake(0, yOffset, imageExtent.size.width, newHeight);
299
301
  }
300
302
 
301
- [_coreImageContext drawImage:image inRect:drawRect fromRect:fromRect];
302
- [self.context presentRenderbuffer:GL_RENDERBUFFER];
303
-
304
- [_glkView setNeedsDisplay];
303
+ // Render on main thread for OpenGL operations
304
+ dispatch_async(dispatch_get_main_queue(), ^{
305
+ if (self.context && _coreImageContext && _glkView) {
306
+ [EAGLContext setCurrentContext:self.context];
307
+ [_coreImageContext drawImage:image inRect:drawRect fromRect:fromRect];
308
+ [self.context presentRenderbuffer:GL_RENDERBUFFER];
309
+ [_glkView setNeedsDisplay];
310
+ }
311
+ });
305
312
  }
306
313
  }
307
314