forked from rFlex/SCRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCAssetExportSession.h
77 lines (58 loc) · 2.08 KB
/
SCAssetExportSession.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
//
// SCAssetExportSession.h
// SCRecorder
//
// Created by Simon CORSIN on 14/05/14.
// Copyright (c) 2014 rFlex. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "SCFilterGroup.h"
#import "SCVideoConfiguration.h"
#import "SCAudioConfiguration.h"
@interface SCAssetExportSession : NSObject
/**
The input asset to use
*/
@property (strong, nonatomic) AVAsset *inputAsset;
/**
The outputUrl to which the asset will be exported
*/
@property (strong, nonatomic) NSURL *outputUrl;
/**
The type of file to be written by the export session
*/
@property (strong, nonatomic) NSString *outputFileType;
/**
If true, the export session will use the GPU for rendering the filters
*/
@property (assign, nonatomic) BOOL useGPUForRenderingFilters;
/**
Access the configuration for the video.
*/
@property (readonly, nonatomic) SCVideoConfiguration *videoConfiguration;
/**
Access the configuration for the audio.
*/
@property (readonly, nonatomic) SCAudioConfiguration *audioConfiguration;
// If an error occured during the export, this will contain that error
@property (readonly, nonatomic) NSError *error;
- (id)init;
// Init with the inputAsset
- (id)initWithAsset:(AVAsset*)inputAsset;
// Starts the asynchronous execution of the export session
- (void)exportAsynchronouslyWithCompletionHandler:(void(^)())completionHandler;
//////////////////
// PRIVATE API
////
// These are only exposed for inheritance purpose
@property (readonly, nonatomic) dispatch_queue_t dispatchQueue;
@property (readonly, nonatomic) dispatch_group_t dispatchGroup;
@property (readonly, nonatomic) AVAssetWriterInput *audioInput;
@property (readonly, nonatomic) AVAssetWriterInput *videoInput;
- (void)markInputComplete:(AVAssetWriterInput *)input error:(NSError *)error;
- (BOOL)processSampleBuffer:(CMSampleBufferRef)sampleBuffer;
- (BOOL)processPixelBuffer:(CVPixelBufferRef)pixelBuffer presentationTime:(CMTime)presentationTime;
- (void)beginReadWriteOnInput:(AVAssetWriterInput *)input fromOutput:(AVAssetReaderOutput *)output;
- (BOOL)needsInputPixelBufferAdaptor;
@end