Skip to content

Commit

Permalink
Flashlight possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vasicvuk committed Mar 24, 2017
1 parent e61b0d6 commit a6f107c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LFLiveKit/LFLiveSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ typedef NS_ENUM(NSInteger,LFLiveCaptureTypeMask) {
/** support outer input pcm audio(set LFLiveCaptureTypeMask) .*/
- (void)pushAudio:(nullable NSData*)audioData;
-(void)loadCustomFilter:(int)input;
- (void) turnFlashLightOff;
- (void) turnFlashLightOn;

@end

8 changes: 8 additions & 0 deletions LFLiveKit/LFLiveSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -428,5 +428,13 @@ - (BOOL)AVAlignment{
return YES;
}
}
- (void) turnFlashLightOff{
[_videoCaptureSource turnFlashLightOff];

}

- (void) turnFlashLightOn{
[_videoCaptureSource turnFlashLightOn];
}

@end
2 changes: 2 additions & 0 deletions LFLiveKit/capture/LFVideoCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@
*/
- (nullable instancetype)initWithVideoConfiguration:(nullable LFLiveVideoConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
-(void)loadCustomFilter:(int)input;
- (void) turnFlashLightOff;
- (void) turnFlashLightOn;
@end
8 changes: 8 additions & 0 deletions LFLiveKit/capture/LFVideoCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ - (void)dealloc {
}
}


- (void) turnFlashLightOn{
[_videoCamera.inputCamera setTorchModeOnWithLevel:1.0 error:nil];
}

- (void) turnFlashLightOff{
[_videoCamera.inputCamera setTorchModeOnWithLevel:0 error:nil];
}
#pragma mark -- Setter Getter

- (GPUImageVideoCamera *)videoCamera{
Expand Down

0 comments on commit a6f107c

Please sign in to comment.