forked from rFlex/SCRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCRecordSession_Internal.h
More file actions
68 lines (50 loc) · 2.51 KB
/
SCRecordSession_Internal.h
File metadata and controls
68 lines (50 loc) · 2.51 KB
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
//
// SCRecordSession_Internal.h
// SCRecorder
//
// Created by Simon CORSIN on 24/11/14.
// Copyright (c) 2014 rFlex. All rights reserved.
//
#import "SCRecorder.h"
#import "SCRecordSession.h"
@interface SCRecordSession() {
AVAssetWriter *_assetWriter;
AVAssetWriterInput *_videoInput;
AVAssetWriterInput *_audioInput;
NSMutableArray *_segments;
BOOL _audioInitializationFailed;
BOOL _videoInitializationFailed;
BOOL _recordSegmentReady;
BOOL _currentSegmentHasVideo;
BOOL _currentSegmentHasAudio;
int _currentSegmentCount;
CMTime _timeOffset;
CMTime _lastTimeAudio;
CMTime _currentSegmentDuration;
CMTime _sessionStartTime;
SCVideoConfiguration *_videoConfiguration;
SCAudioConfiguration *_audioConfiguration;
AVAssetWriterInputPixelBufferAdaptor *_videoPixelBufferAdaptor;
CMTime _lastTimeVideo;
dispatch_queue_t _audioQueue;
// Used when the fastRecordMethod is enabled
AVCaptureMovieFileOutput *_movieFileOutput;
}
@property (weak, nonatomic) SCRecorder *recorder;
@property (readonly, nonatomic) BOOL videoInitialized;
@property (readonly, nonatomic) BOOL audioInitialized;
@property (readonly, nonatomic) BOOL videoInitializationFailed;
@property (readonly, nonatomic) BOOL audioInitializationFailed;
@property (readonly, nonatomic) BOOL recordSegmentReady;
@property (readonly, nonatomic) BOOL currentSegmentHasAudio;
@property (readonly, nonatomic) BOOL currentSegmentHasVideo;
@property (readonly, nonatomic) BOOL isUsingMovieFileOutput;
- (void)initializeVideo:(NSDictionary *)videoOptions formatDescription:(CMFormatDescriptionRef)formatDescription error:(NSError **)error;
- (void)initializeAudio:(NSDictionary *)audioOptions formatDescription:(CMFormatDescriptionRef)formatDescription error:(NSError **)error;
- (CVPixelBufferRef)createPixelBuffer;
- (void)appendVideoPixelBuffer:(CVPixelBufferRef)videoSampleBuffer atTime:(CMTime)time duration:(CMTime)duration completion:(void(^)(BOOL success))completion;
- (void)appendAudioSampleBuffer:(CMSampleBufferRef)audioSampleBuffer completion:(void(^)(BOOL success))completion;
- (void)beginRecordSegmentUsingMovieFileOutput:(AVCaptureMovieFileOutput *)movieFileOutput error:(NSError **)error delegate:(id<AVCaptureFileOutputRecordingDelegate>)delegate;
- (void)notifyMovieFileOutputIsReady;
- (void)appendRecordSegmentUrl:(NSURL *)url info:(NSDictionary *)info error:(NSError *)error completionHandler:(void(^)(SCRecordSessionSegment *segment, NSError* error))completionHandler;
@end