MeiCam SDK For iOS  3.14.0
NvsPassthroughConvertor.h
Go to the documentation of this file.
1 //================================================================================
2 //
3 // (c) Copyright Meishe Co. Ltd, 2022. All rights reserved.
4 //
5 // This code and information is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the implied
7 // warranties of merchantability and/or fitness for a particular purpose.
8 //
9 //--------------------------------------------------------------------------------
10 // Birth Date: Mar 21. 2022
11 // Author: Meishe video team
12 //================================================================================
13 #pragma once
14 
15 #import <Foundation/Foundation.h>
16 #import "NvsCommonDef.h"
17 
26 typedef enum {
27  NvsPassthroughConvertorErrorType_NoError = 0,
28  NvsPassthroughConvertorErrorType_Cancled = 1,
29  NvsPassthroughConvertorErrorType_SetupAudioEncoder = 2,
30  NvsPassthroughConvertorErrorType_SetupAudioDecoder = 3,
31  NvsPassthroughConvertorErrorType_ProcessVideo = 4,
32  NvsPassthroughConvertorErrorType_ProcessAudio = 5,
33  NvsPassthroughConvertorErrorType_InvalidData = 6,
34  NvsPassthroughConvertorErrorType_IO = 7,
35  NvsPassthroughConvertorErrorType_ConvertFile = 8,
36  NvsPassthroughConvertorErrorType_UnkownError = 65535
37 } NvsPassthroughConvertorErrorType;
38 
45 typedef enum {
46  NvsPassthroughType_All = 0,
47  NvsPassthroughType_OnlyVideo = 1,
48  NvsPassthroughType_DisableTranscode = 2
49 } NvsPassthroughType;
50 
51 #define PASSTHROUGH_OPTIMIZE_FOR_NETWORK_USE @"optimize-for-network-use"
52 #define PASSTHROUGH_CREATION_TIME @"creation time"
53 #define PASSTHROUGH_METADATADESCRIPTION @"metadata description"
54 
55 @protocol NvsPassthroughConvertorDelegate<NSObject>
56 
57 - (void)didConvertorProgress:(int64_t)taskId progress:(float)progress;
58 
59 - (void)didConvertorFinish:(int64_t)taskId errorCode:(NvsPassthroughConvertorErrorType)error errorString:(NSString*)errorString;
60 
61 @end
62 
70 NVS_EXPORT @interface NvsPassthroughFileInfo : NSObject
71 
72 @property (nonatomic) NSString *mediaFilePath;
73 @property (nonatomic) int64_t trimIn;
74 @property (nonatomic) int64_t trimOut;
75 
76 @end
77 
78 
79 NVS_EXPORT @interface NvsPassthroughConvertor : NSObject
80 
81 @property (nonatomic, weak) id<NvsPassthroughConvertorDelegate> delegate;
82 
83 - (instancetype)init;
84 
101 - (int64_t)convertMediaFile:(NSArray<NvsPassthroughFileInfo*>*)srcFileInfos
102  outputFile:(NSString *)outputFilePath
103  options:(NSMutableDictionary *)options
104  passthroughType:(int)passthroughType;
105 
106 - (void)cancelTask:(int64_t)taskId;
107 
108 @end
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
NvsCommonDef.h