Skip to content

Commit

Permalink
Added capture possibilty
Browse files Browse the repository at this point in the history
  • Loading branch information
vasicvuk committed Mar 24, 2017
1 parent 0ab57b4 commit 97a910d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LFLiveKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|

s.name = "LFLiveKit"
s.version = "2.8"
s.version = "2.9"
s.summary = "LaiFeng ios Live. LFLiveKit."
s.homepage = "https://github.com/chenliming777"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
2 changes: 1 addition & 1 deletion LFLiveKit/LFLiveSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ typedef NS_ENUM(NSInteger,LFLiveCaptureTypeMask) {
-(void)loadCustomFilter:(int)input;
- (void) turnFlashLightOff;
- (void) turnFlashLightOn;

-(void)captureCamera;
@end

4 changes: 3 additions & 1 deletion LFLiveKit/LFLiveSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,7 @@ - (void) turnFlashLightOff{
- (void) turnFlashLightOn{
[_videoCaptureSource turnFlashLightOn];
}

-(void)captureCamera{
[_videoCaptureSource captureCamera];
}
@end
1 change: 1 addition & 0 deletions LFLiveKit/capture/LFVideoCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@
-(void)loadCustomFilter:(int)input;
- (void) turnFlashLightOff;
- (void) turnFlashLightOn;
-(void)captureCamera;
@end
8 changes: 8 additions & 0 deletions LFLiveKit/capture/LFVideoCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ - (void)dealloc {


- (void) turnFlashLightOn{

if(_videoCamera.inputCamera.hasTorch){
[_videoCamera.inputCamera lockForConfiguration:nil];
_videoCamera.inputCamera.torchMode = AVCaptureTorchModeOn;
Expand Down Expand Up @@ -100,6 +101,13 @@ - (GPUImageVideoCamera *)videoCamera{
return _videoCamera;
}

-(void)captureCamera{
[_filter useNextFrameForImageCapture];
UIImage *image = [_filter imageFromCurrentFramebuffer];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

}

- (void)setRunning:(BOOL)running {
if (_running == running) return;
_running = running;
Expand Down

0 comments on commit 97a910d

Please sign in to comment.