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

Merge KhanFu fork (add video support) with last IFTTT master #79

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[I] add customization of capture session preset
  • Loading branch information
QuentinArnault committed Feb 6, 2018
commit 7e9ecdec893834200293553051beb5c98dba64b0
6 changes: 4 additions & 2 deletions FastttCamera/FastttCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ @implementation FastttCamera
cameraTorchMode = _cameraTorchMode,
movieFileOutput = _movieFileOutput,
normalizesVideoOrientation = _normalizesVideoOrientation,
cropsVideoToVisibleAspectRatio = _cropsVideoToVisibleAspectRatio;
cropsVideoToVisibleAspectRatio = _cropsVideoToVisibleAspectRatio,
sessionPreset = _sessionPreset;

- (instancetype)init
{
Expand All @@ -77,6 +78,7 @@ - (instancetype)init
_cameraDevice = FastttCameraDeviceRear;
_cameraFlashMode = FastttCameraFlashModeOff;
_cameraTorchMode = FastttCameraTorchModeOff;
_sessionPreset = AVCaptureSessionPresetMedium;

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
Expand Down Expand Up @@ -417,7 +419,7 @@ - (void)_setupCaptureSession
dispatch_async(dispatch_get_main_queue(), ^{

_session = [AVCaptureSession new];
_session.sessionPreset = AVCaptureSessionPresetMedium;
_session.sessionPreset = _sessionPreset;

AVCaptureDevice *device = [AVCaptureDevice cameraDevice:self.cameraDevice];

Expand Down
6 changes: 6 additions & 0 deletions FastttCamera/FastttCameraInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
*/
@property(nonatomic, assign) BOOL cropsVideoToVisibleAspectRatio;

/**
* Default to AVCaptureSessionPresetMedium.
*/

@property (nonatomic, assign) AVCaptureSessionPreset sessionPreset;

#pragma mark - Camera State

/**
Expand Down