@@ -14,7 +14,7 @@ - (FlutterError *)flutterError {
1414}
1515@end
1616
17- @interface FLTSavePhotoDelegate : NSObject <AVCapturePhotoCaptureDelegate>
17+ @interface FLTSavePhotoDelegate : NSObject <AVCapturePhotoCaptureDelegate>
1818@property (readonly , nonatomic ) NSString *path;
1919@property (readonly , nonatomic ) FlutterResult result;
2020
@@ -59,8 +59,10 @@ - (void)captureOutput:(AVCapturePhotoOutput *)output
5959}
6060@end
6161
62- @interface FLTCam : NSObject <FlutterTexture, AVCaptureVideoDataOutputSampleBufferDelegate,
63- AVCaptureAudioDataOutputSampleBufferDelegate, FlutterStreamHandler>
62+ @interface FLTCam : NSObject <FlutterTexture,
63+ AVCaptureVideoDataOutputSampleBufferDelegate,
64+ AVCaptureAudioDataOutputSampleBufferDelegate,
65+ FlutterStreamHandler>
6466@property (readonly , nonatomic ) int64_t textureId;
6567@property (nonatomic , copy ) void (^onFrameAvailable)();
6668@property (nonatomic ) FlutterEventChannel *eventChannel;
@@ -111,8 +113,8 @@ - (instancetype)initWithCameraName:(NSString *)cameraName
111113 _captureSession.sessionPreset = preset;
112114 _captureDevice = [AVCaptureDevice deviceWithUniqueID: cameraName];
113115 NSError *localError = nil ;
114- _captureVideoInput =
115- [AVCaptureDeviceInput deviceInputWithDevice: _captureDevice error: &localError];
116+ _captureVideoInput = [AVCaptureDeviceInput deviceInputWithDevice: _captureDevice
117+ error: &localError];
116118 if (localError) {
117119 *error = localError;
118120 return nil ;
@@ -123,7 +125,7 @@ - (instancetype)initWithCameraName:(NSString *)cameraName
123125
124126 _captureVideoOutput = [AVCaptureVideoDataOutput new ];
125127 _captureVideoOutput.videoSettings =
126- @{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA ) };
128+ @{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA )};
127129 [_captureVideoOutput setAlwaysDiscardsLateVideoFrames: YES ];
128130 [_captureVideoOutput setSampleBufferDelegate: self queue: dispatch_get_main_queue ()];
129131
@@ -154,9 +156,9 @@ - (void)stop {
154156- (void )captureToFile : (NSString *)path result : (FlutterResult)result {
155157 AVCapturePhotoSettings *settings = [AVCapturePhotoSettings photoSettings ];
156158 [settings setHighResolutionPhotoEnabled: YES ];
157- [_capturePhotoOutput
158- capturePhotoWithSettings: settings
159- delegate: [[FLTSavePhotoDelegate alloc ] initWithPath: path result: result]];
159+ [_capturePhotoOutput capturePhotoWithSettings: settings
160+ delegate: [[FLTSavePhotoDelegate alloc ] initWithPath: path
161+ result: result]];
160162}
161163
162164- (void )captureOutput : (AVCaptureOutput *)output
@@ -330,8 +332,9 @@ - (BOOL)setupWriterForPath:(NSString *)path {
330332 if (!_isAudioSetup) {
331333 [self setUpCaptureSessionForAudio ];
332334 }
333- _videoWriter =
334- [[AVAssetWriter alloc ] initWithURL: outputURL fileType: AVFileTypeQuickTimeMovie error: &error];
335+ _videoWriter = [[AVAssetWriter alloc ] initWithURL: outputURL
336+ fileType: AVFileTypeQuickTimeMovie
337+ error: &error];
335338 NSParameterAssert (_videoWriter);
336339 if (error) {
337340 _eventSink (@{@" event" : @" error" , @" errorDescription" : error.description });
@@ -375,8 +378,8 @@ - (void)setUpCaptureSessionForAudio {
375378 // Create a device input with the device and add it to the session.
376379 // Setup the audio input.
377380 AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType: AVMediaTypeAudio];
378- AVCaptureDeviceInput *audioInput =
379- [AVCaptureDeviceInput deviceInputWithDevice: audioDevice error: &error];
381+ AVCaptureDeviceInput *audioInput = [AVCaptureDeviceInput deviceInputWithDevice: audioDevice
382+ error: &error];
380383 if (error) {
381384 _eventSink (@{@" event" : @" error" , @" errorDescription" : error.description });
382385 }
@@ -411,8 +414,8 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
411414 FlutterMethodChannel *channel =
412415 [FlutterMethodChannel methodChannelWithName: @" plugins.flutter.io/camera"
413416 binaryMessenger: [registrar messenger ]];
414- CameraPlugin *instance =
415- [[CameraPlugin alloc ] initWithRegistry: [registrar textures ] messenger: [registrar messenger ]];
417+ CameraPlugin *instance = [[CameraPlugin alloc ] initWithRegistry: [registrar textures ]
418+ messenger: [registrar messenger ]];
416419 [registrar addMethodCallDelegate: instance channel: channel];
417420}
418421
0 commit comments