JLChen
2021-10-19 feb1c3628a4d5da3c85bd3f3dae3be22ed4f5625
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
//
//  EZMediaSessionDefines.h
//  H264 Encode and Decode
//
//  Created by kanhaiping on 2018/6/22.
//  Copyright © 2018年 AJB. All rights reserved.
//
 
#import <Foundation/Foundation.h>
 
#define EZMediaSessionEncodeResolutionRatioHigh  1  //分辨率 1:480*480 0:320*320
#define EZMediaSessionDstVideoFPS (15)
#define EZMediaSessionDstVideoMaxKeyFrameInterval (300)//单位秒
 
#define EZMediaSessionSmallStreamWidth (320)
#define EZMediaSessionSmallStreamHeight (320)
 
#define EZMediaSessionDstVideoAverageBitRate480x480 (4 * 128 * 1024)//单位 bps  //averageBPS
#define EZMediaSessionDstVideoDataRateLimits480x480 (6 * 128 * 1024)//单位 bps  //maxBPS
#define EZMediaSessionDstVideoAverageBitRate320x320 (4 * 128 * 1024 * 5 / 8)//单位 bps  //averageBPS
#define EZMediaSessionDstVideoDataRateLimits320x320 (6 * 128 * 1024 * 5 / 8)//单位 bps  //maxBPS
 
 
typedef NS_OPTIONS(NSUInteger, EZMediaCaptureSessionType) {
    EZMediaSessionCaptureNone = 1 << 0,
    EZMediaSessionCaptureVideoType = 1 << 1,
    EZMediaSessionCaptureAudioType = 1 << 2,
    EZMediaSessionCaptureThumbnailType = 1 << 3,
    EZMediaSessionCaptureShareScreenType = 1 << 4,
 
};
 
typedef NS_ENUM(NSUInteger, EZMediaSessionErrorBase) {
    EZMediaSessionErrorUnknowError = 9000,
    EZMediaSessionErrorNotReadyToSendData,
    EZMediaSessionErrorCallSeqError,
    EZMediaSessionErrorDuplicated,
    EZMediaSessionErrorBaseAudioCapture = 10000,
    EZMediaSessionErrorBaseVideoCapture = 20000,
    EZMediaSessionErrorBaseAudioEncode = 30000,
    EZMediaSessionErrorBaseVideoEncode = 40000,
    EZMediaSessionErrorBaseStreamClient = 50000,
    EZMediaSessionErrorBasePlayer = 60000,
};
 
typedef NS_ENUM(NSUInteger, EZAudioRecorderError) {
    EZAudioRecorderErrorUnknown = EZMediaSessionErrorBaseAudioCapture,
    EZAudioRecorderErrorInitError = 10100,
    EZAudioRecorderErrorUnableToCreateSample,
    EZAudioRecorderErrorStateError,
    EZAudioRecorderErrorAuthorizeFailed = 10152,
    EZAudioRecorderErrorStopError = 10200,
};
 
typedef NS_ENUM(NSUInteger, EZMediaCaptureError) {
    EZMediaCaptureErrorUnknown = EZMediaSessionErrorBaseVideoCapture,
    EZMediaCaptureErrorInitError = 20100,
    EZMediaCaptureErrorAuthorizeFailed = 20153,
    EZMediaCaptureErrorSwitchCameraError = 20200,
    EZMediaCaptureErrorCroppedError = 20300,
    EZMediaCaptureErrorRenderError = 20400,
    EZMediaCaptureErrorScreenStartError = 20500,
    EZMediaCaptureErrorScreenStopError,
    EZMediaCaptureErrorScreenRecordError,
    EZMediaCaptureErrorUnsupport,
};
 
typedef NS_ENUM(NSUInteger, EZAudioAACEncoderError) {
    EZAudioAACEncoderErrorUnknown = EZMediaSessionErrorBaseAudioEncode,
    EZAudioAACEncoderErrorFailToInitConverter = 30100,
    EZAudioAACEncoderErrorFailToGetDataBuffer,
    EZAudioAACEncoderErrorFailToEncodeBuffer,
};
 
typedef NS_ENUM(NSUInteger, EZVideoH264EncoderError) {
    EZVideoH264EncoderErrorUnknown = EZMediaSessionErrorBaseVideoEncode,
    EZVideoH264EncoderErrorInitFailed = 40100,
    EZVideoH264EncoderErrorInvalidSample,
    EZVideoH264EncoderErrorSampleNotReady,
    EZVideoH264EncoderErrorNotRunning,
    EZVideoH264EncoderErrorSetMaxBPSFailed,
    EZVideoH264EncoderErrorSetAverageBPSFailed,
    EZVideoH264EncoderErrorEncodeFailed = 40200,
};
 
typedef NS_ENUM(NSUInteger, EZBAVStreamClientError) {
    EZBAVStreamClientErrorUnknow = EZMediaSessionErrorBaseStreamClient,
    EZBAVStreamClientErrorAudioEnableNotAllowed = EZMediaSessionErrorBaseStreamClient + 9000,
    EZBAVStreamClientErrorShareEnableNotAllowed,
 
};
 
@interface EZMediaSessionDefines : NSObject
 
@end