Skip to content

Commit 76d9818

Browse files
committed
Rename flt* fields to flutter*
1 parent 2744054 commit 76d9818

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraSessionPresetsTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ final class CameraSessionPresetsTests: XCTestCase {
2828
}
2929
let captureFormatMock = MockCaptureDeviceFormat()
3030
let captureDeviceMock = MockCaptureDevice()
31-
captureDeviceMock.fltFormats = [captureFormatMock]
32-
captureDeviceMock.fltActiveFormat = captureFormatMock
31+
captureDeviceMock.flutterFormats = [captureFormatMock]
32+
captureDeviceMock.flutterActiveFormat = captureFormatMock
3333
captureDeviceMock.lockForConfigurationStub = {
3434
lockForConfigurationExpectation.fulfill()
3535
}

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraSettingsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ final class CameraSettingsTests: XCTestCase {
203203
configuration.mediaSettings = settings
204204
let camera = CameraTestUtils.createTestCamera(configuration)
205205

206-
let range = camera.captureDevice.fltActiveFormat.videoSupportedFrameRateRanges[0]
206+
let range = camera.captureDevice.flutterActiveFormat.videoSupportedFrameRateRanges[0]
207207
XCTAssertLessThanOrEqual(range.minFrameRate, 60)
208208
XCTAssertGreaterThanOrEqual(range.maxFrameRate, 60)
209209
}

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraTestUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ enum CameraTestUtils {
4747
captureDeviceFormatMock2.videoSupportedFrameRateRanges = [frameRateRangeMock2]
4848

4949
let captureDeviceMock = MockCaptureDevice()
50-
captureDeviceMock.fltFormats = [captureDeviceFormatMock1, captureDeviceFormatMock2]
50+
captureDeviceMock.flutterFormats = [captureDeviceFormatMock1, captureDeviceFormatMock2]
5151

5252
var currentFormat: FLTCaptureDeviceFormat = captureDeviceFormatMock1
5353

packages/camera/camera_avfoundation/example/ios/RunnerTests/Mocks/MockCaptureDevice.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MockCaptureDevice: NSObject, CaptureDevice {
3434
var position = AVCaptureDevice.Position.unspecified
3535
var deviceType = AVCaptureDevice.DeviceType.builtInWideAngleCamera
3636

37-
var fltActiveFormat: FLTCaptureDeviceFormat {
37+
var flutterActiveFormat: FLTCaptureDeviceFormat {
3838
get {
3939
activeFormatStub?() ?? MockCaptureDeviceFormat()
4040
}
@@ -43,7 +43,7 @@ class MockCaptureDevice: NSObject, CaptureDevice {
4343
}
4444
}
4545

46-
var fltFormats: [FLTCaptureDeviceFormat] = []
46+
var flutterFormats: [FLTCaptureDeviceFormat] = []
4747
var hasFlash = false
4848
var hasTorch = false
4949
var isTorchAvailable = false

packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/CaptureDevice.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ protocol CaptureDevice: NSObjectProtocol {
2727
var deviceType: AVCaptureDevice.DeviceType { get }
2828

2929
// Format/Configuration
30-
var fltActiveFormat: FLTCaptureDeviceFormat { get set }
31-
var fltFormats: [FLTCaptureDeviceFormat] { get }
30+
var flutterActiveFormat: FLTCaptureDeviceFormat { get set }
31+
var flutterFormats: [FLTCaptureDeviceFormat] { get }
3232

3333
// Flash/Torch
3434
var hasFlash: Bool { get }
@@ -91,12 +91,12 @@ protocol CaptureDeviceInputFactory: NSObjectProtocol {
9191
extension AVCaptureDevice: CaptureDevice {
9292
var avDevice: AVCaptureDevice { self }
9393

94-
var fltActiveFormat: FLTCaptureDeviceFormat {
94+
var flutterActiveFormat: FLTCaptureDeviceFormat {
9595
get { FLTDefaultCaptureDeviceFormat.init(format: activeFormat) }
9696
set { activeFormat = newValue.format }
9797
}
9898

99-
var fltFormats: [FLTCaptureDeviceFormat] {
99+
var flutterFormats: [FLTCaptureDeviceFormat] {
100100
return self.formats.map { FLTDefaultCaptureDeviceFormat.init(format: $0) }
101101
}
102102
}

packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/DefaultCamera.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ final class DefaultCamera: NSObject, Camera {
248248
do {
249249
try captureDevice.lockForConfiguration()
250250
// Set the best device format found and finish the device configuration.
251-
captureDevice.fltActiveFormat = bestFormat
251+
captureDevice.flutterActiveFormat = bestFormat
252252
captureDevice.unlockForConfiguration()
253253
break
254254
}
@@ -301,7 +301,7 @@ final class DefaultCamera: NSObject, Camera {
301301
}
302302
}
303303

304-
let size = videoDimensionsConverter(captureDevice.fltActiveFormat)
304+
let size = videoDimensionsConverter(captureDevice.flutterActiveFormat)
305305
previewSize = CGSize(width: CGFloat(size.width), height: CGFloat(size.height))
306306
audioCaptureSession.sessionPreset = videoCaptureSession.sessionPreset
307307
}
@@ -312,12 +312,12 @@ final class DefaultCamera: NSObject, Camera {
312312
-> FLTCaptureDeviceFormat?
313313
{
314314
let preferredSubType = CMFormatDescriptionGetMediaSubType(
315-
captureDevice.fltActiveFormat.formatDescription)
315+
captureDevice.flutterActiveFormat.formatDescription)
316316
var bestFormat: FLTCaptureDeviceFormat? = nil
317317
var maxPixelCount: UInt = 0
318318
var isBestSubTypePreferred = false
319319

320-
for format in captureDevice.fltFormats {
320+
for format in captureDevice.flutterFormats {
321321
let resolution = videoDimensionsConverter(format)
322322
let height = UInt(resolution.height)
323323
let width = UInt(resolution.width)

packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/FormatUtils.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ enum FormatUtils {
4444
mediaSettings: FCPPlatformMediaSettings,
4545
videoDimensionsConverter: VideoDimensionsConverter
4646
) {
47-
let targetResolution = videoDimensionsConverter(captureDevice.fltActiveFormat)
47+
let targetResolution = videoDimensionsConverter(captureDevice.flutterActiveFormat)
4848
let targetFrameRate = mediaSettings.framesPerSecond?.doubleValue ?? 0
4949
let preferredSubType = CMFormatDescriptionGetMediaSubType(
50-
captureDevice.fltActiveFormat.formatDescription)
50+
captureDevice.flutterActiveFormat.formatDescription)
5151

52-
var bestFormat = captureDevice.fltActiveFormat
52+
var bestFormat = captureDevice.flutterActiveFormat
5353
var resolvedBastFrameRate = bestFrameRate(for: bestFormat, targetFrameRate: targetFrameRate)
5454
var minDistance = abs(resolvedBastFrameRate - targetFrameRate)
5555
var isBestSubTypePreferred = true
5656

57-
for format in captureDevice.fltFormats {
57+
for format in captureDevice.flutterFormats {
5858
let resolution = videoDimensionsConverter(format)
5959
if resolution.width != targetResolution.width || resolution.height != targetResolution.height
6060
{
@@ -76,7 +76,7 @@ enum FormatUtils {
7676
}
7777
}
7878

79-
captureDevice.fltActiveFormat = bestFormat
79+
captureDevice.flutterActiveFormat = bestFormat
8080
mediaSettings.framesPerSecond = NSNumber(value: resolvedBastFrameRate)
8181
}
8282
}

0 commit comments

Comments
 (0)