//
//  YCKVideoCapture.h
//  YCKCall
//
//  Created by 徐家骏 on 2019/4/28.
//  Copyright © 2019 徐家骏. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "YCKVideoFrameContext.h"

NS_ASSUME_NONNULL_BEGIN

@protocol YCKVideoCaptureDelegate <NSObject>
@required
-(void) onNewVideoCaptureData:(CMSampleBufferRef)sampleBuffer andContext:(YCKVideoFrameContext *)frameContext;

@end


@interface YCKVideoCapture : NSObject
@property (atomic, weak)        id<YCKVideoCaptureDelegate> delegate;
@property (nonatomic)              AVCaptureDevicePosition  position;
@property (nonatomic,strong)       AVCaptureSessionPreset   preset;
@property (nonatomic)              int32_t                  frameRate;
@property (nonatomic)              BOOL                     mirror;

- (instancetype) init;
- (void) CaptureSessionCreate;
- (void) CaptureSessionStart;
- (void) CaptureSessionStop;
- (void) CaptureSessionDestroy;

- (void)handleCaptureRuntimeError:(NSNotification *)notification;
- (void)handleCaptureInterrupted:(NSNotification *)notification;
- (void)handleCaptureInterruptionEnded:(NSNotification *)notification;

@end

NS_ASSUME_NONNULL_END


