Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize core-based synchronisation #258

Merged
merged 11 commits into from
Nov 18, 2019
Merged

Utilize core-based synchronisation #258

merged 11 commits into from
Nov 18, 2019

Conversation

chezzdev
Copy link
Contributor

@chezzdev chezzdev commented Nov 13, 2019

Checks:

  • Update changelog
  • Rebase to dev branch
  • Assign reviewers

Linked issues:
Another iOS part of #1739

@chezzdev chezzdev added the iOS label Nov 13, 2019
@chezzdev chezzdev self-assigned this Nov 13, 2019
@chezzdev chezzdev changed the title [WIP] Telemetry sync Utilize core-based synchronisation Nov 13, 2019
Copy link
Contributor

@dersim-davaod dersim-davaod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider some updates

@@ -89,6 +89,18 @@ class DeviceCheckerTests: XCTestCase {
// Given iPhone XR
// When // Then
XCTAssertTrue(UIDeviceIphoneXRStub().isHighPerformance)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a part of current PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was cleaning the tests, so for them to pass, I've added these cases.

@@ -41,23 +36,28 @@ final class VideoTrimmer {
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

completion is not called for else-branch of guard statement here and line 36 above.
IMHO we should call it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Will update.

guard let exportSession = AVAssetExportSession(asset: composition, presetName: preferredPreset) else { return }
guard
let exportSession = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetPassthrough)
else { return }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same concern about completion which is not called on else-branch.

@@ -50,7 +56,7 @@ final class VideoRecorder {
}

func stopRecording(completion: (() -> Void)?) {
writerQueue.async { [weak self] in
writerQueue.sync { [weak self] in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to weakify self?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that it's sync, no. Will update.

Copy link
Contributor

@dersim-davaod dersim-davaod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@IodaMikeMapbox IodaMikeMapbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just few suggestions

MapboxVision/Services/Recording/VideoRecorder.swift Outdated Show resolved Hide resolved
@@ -2,62 +2,68 @@ import AVFoundation
import Foundation

private let timeScale: CMTimeScale = 600
private let fileType: AVFileType = .mp4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we agree to store constants in caseless enums named Constants which is placed as private enum in classes, e.g. in MotionManager

@@ -18,6 +18,12 @@ private extension VideoSettings {
}
}

protocol FrameRecordable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it will be better to call it FrameRecorder?

@chezzdev chezzdev merged commit 5fb714f into dev Nov 18, 2019
@chezzdev chezzdev deleted the pad-telemetry-sync branch November 18, 2019 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants