@@ -25,12 +25,14 @@ @interface FLTByteStreamHandler : NSObject<FlutterStreamHandler>
2525@property (readonly , nonatomic ) FlutterEventSink eventSink;
2626@end
2727
28- @implementation FLTByteStreamHandler {}
28+ @implementation FLTByteStreamHandler {
29+ }
2930- (FlutterError *_Nullable)onCancelWithArguments : (id _Nullable)arguments {
3031 return nil ;
3132}
3233
33- - (FlutterError *_Nullable)onListenWithArguments : (id _Nullable)arguments eventSink : (nonnull FlutterEventSink)events {
34+ - (FlutterError *_Nullable)onListenWithArguments : (id _Nullable)arguments
35+ eventSink : (nonnull FlutterEventSink)events {
3436 _eventSink = events;
3537 return nil ;
3638}
@@ -210,7 +212,6 @@ - (void)captureOutput:(AVCaptureOutput *)output
210212 // Lock the base address of the pixel buffer
211213 CVPixelBufferLockBaseAddress (pixelBuffer, kCVPixelBufferLock_ReadOnly );
212214
213-
214215 // Get the number of bytes per row for the pixel buffer
215216 void *baseAddress = CVPixelBufferGetBaseAddress (pixelBuffer);
216217
@@ -225,9 +226,10 @@ - (void)captureOutput:(AVCaptureOutput *)output
225226
226227 // Create a bitmap graphics context with the sample buffer data
227228 CGBitmapInfo bitmapInfo =
228- (kCGBitmapAlphaInfoMask & kCGImageAlphaPremultipliedFirst ) | kCGBitmapByteOrder32Little ;
229+ (kCGBitmapAlphaInfoMask & kCGImageAlphaPremultipliedFirst ) | kCGBitmapByteOrder32Little ;
229230
230- CGContextRef context = CGBitmapContextCreate (baseAddress, width, height, 8 , bytesPerRow, colorSpace, bitmapInfo);
231+ CGContextRef context =
232+ CGBitmapContextCreate (baseAddress, width, height, 8 , bytesPerRow, colorSpace, bitmapInfo);
231233
232234 // Create a Quartz image from the pixel data in the bitmap graphics context
233235 CGImageRef quartzImage = CGBitmapContextCreateImage (context);
@@ -382,16 +384,17 @@ - (void)stopVideoRecordingWithResult:(FlutterResult)result {
382384
383385- (void )startByteStreamWithMessenger : (NSObject <FlutterBinaryMessenger> *)messenger {
384386 if (!_isStreamingBytes) {
385- FlutterEventChannel *eventChannel = [FlutterEventChannel
386- eventChannelWithName: @" plugins.flutter.io/camera/bytes"
387- binaryMessenger: messenger];
387+ FlutterEventChannel *eventChannel =
388+ [FlutterEventChannel eventChannelWithName: @" plugins.flutter.io/camera/bytes"
389+ binaryMessenger: messenger];
388390
389391 _byteStreamHandler = [[FLTByteStreamHandler alloc ] init ];
390392 [eventChannel setStreamHandler: _byteStreamHandler];
391393
392394 _isStreamingBytes = YES ;
393395 } else {
394- _eventSink (@{@" event" : @" error" , @" errorDescription" : @" Bytes from camera are already streaming!" });
396+ _eventSink (
397+ @{@" event" : @" error" , @" errorDescription" : @" Bytes from camera are already streaming!" });
395398 }
396399}
397400
@@ -400,7 +403,8 @@ - (void)stopByteStream {
400403 _isStreamingBytes = NO ;
401404 _byteStreamHandler = nil ;
402405 } else {
403- _eventSink (@{@" event" : @" error" , @" errorDescription" : @" Bytes from camera are not streaming!" });
406+ _eventSink (
407+ @{@" event" : @" error" , @" errorDescription" : @" Bytes from camera are not streaming!" });
404408 }
405409}
406410
0 commit comments