forked from rFlex/SCRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCRecorderDelegate.h
141 lines (113 loc) · 4.6 KB
/
SCRecorderDelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//
// SCRecorderDelegate.h
// SCRecorder
//
// Created by Simon CORSIN on 18/03/15.
// Copyright (c) 2015 rFlex. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "SCRecorder.h"
typedef NS_ENUM(NSInteger, SCFlashMode) {
SCFlashModeOff = AVCaptureFlashModeOff,
SCFlashModeOn = AVCaptureFlashModeOn,
SCFlashModeAuto = AVCaptureFlashModeAuto,
SCFlashModeLight
};
@class SCRecorder;
@protocol SCRecorderDelegate <NSObject>
@optional
/**
Called when the recorder has reconfigured the videoInput
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didReconfigureVideoInput:(NSError *__nullable)videoInputError;
/**
Called when the recorder has reconfigured the audioInput
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didReconfigureAudioInput:(NSError *__nullable)audioInputError;
/**
Called when the flashMode has changed
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didChangeFlashMode:(SCFlashMode)flashMode error:(NSError *__nullable)error;
/**
Called when the capture session outputs a video sample buffer.
This will be called in the SCRecorder internal queue, make sure
you don't block the thread for too long.
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didOutputVideoSampleBuffer:(__nonnull CMSampleBufferRef)videoSampleBuffer;
/**
Called when the capture session outputs an audio sample buffer.
This will be called in the SCRecorder internal queue, make sure
you don't block the thread for too long.
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didOutputAudioSampleBuffer:(__nonnull CMSampleBufferRef)audioSampleBuffer;
/**
Called when the recorder has lost the focus. Returning true will make the recorder
automatically refocus at the center.
*/
- (BOOL)recorderShouldAutomaticallyRefocus:(SCRecorder *__nonnull)recorder;
/**
Called before the recorder will start focusing
*/
- (void)recorderWillStartFocus:(SCRecorder *__nonnull)recorder;
/**
Called when the recorder has started focusing
*/
- (void)recorderDidStartFocus:(SCRecorder *__nonnull)recorder;
/**
Called when the recorder has finished focusing
*/
- (void)recorderDidEndFocus:(SCRecorder *__nonnull)recorder;
/**
Called before the recorder will start adjusting exposure
*/
- (void)recorderWillStartAdjustingExposure:(SCRecorder *__nonnull)recorder;
/**
Called when the recorder has started adjusting exposure
*/
- (void)recorderDidStartAdjustingExposure:(SCRecorder *__nonnull)recorder;
/**
Called when the recorder has finished adjusting exposure
*/
- (void)recorderDidEndAdjustingExposure:(SCRecorder *__nonnull)recorder;
/**
Called when the recorder has initialized the audio in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didInitializeAudioInSession:(SCRecordSession *__nonnull)session error:(NSError *__nullable)error;
/**
Called when the recorder has initialized the video in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didInitializeVideoInSession:(SCRecordSession *__nonnull)session error:(NSError *__nullable)error;
/**
Called when the recorder has started a segment in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didBeginSegmentInSession:(SCRecordSession *__nonnull)session error:(NSError *__nullable)error;
/**
Called when the recorder has completed a segment in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didCompleteSegment:(SCRecordSessionSegment *__nullable)segment inSession:(SCRecordSession *__nonnull)session error:(NSError *__nullable)error;
/**
Called when the recorder has appended a video buffer in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didAppendVideoSampleBufferInSession:(SCRecordSession *__nonnull)session;
/**
Called when the recorder has appended an audio buffer in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didAppendAudioSampleBufferInSession:(SCRecordSession *__nonnull)session;
/**
Called when the recorder has skipped an audio buffer in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didSkipAudioSampleBufferInSession:(SCRecordSession *__nonnull)session;
/**
Called when the recorder has skipped a video buffer in a session
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didSkipVideoSampleBufferInSession:(SCRecordSession *__nonnull)session;
/**
Called when a session has reached the maxRecordDuration
*/
- (void)recorder:(SCRecorder *__nonnull)recorder didCompleteSession:(SCRecordSession *__nonnull)session;
/**
Gives an opportunity to the delegate to create an info dictionary for a record segment.
*/
- (NSDictionary *__nullable)createSegmentInfoForRecorder:(SCRecorder *__nonnull)recorder;
@end