JLChen
2021-11-04 1443556e9ccb1a19ed8e6710c16c8adc4d4f4fb3
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//
//  Copyright © 2016 dahua. All rights reserved.
//
//  定义枚举
 
#import <Foundation/Foundation.h>
 
#define WAKEUP_TIME             5      // 默认唤醒时间
#define LOADING_TIME_OUT        40
#define HIDE_BAR_TIME           5.0f
#define TAP_TIMEINTERVAL        200     //云台控制时长:TAP时长 200ms
#define PAN_TIMEINTERVAL        30000   //云台控制时长:TAP时长 1000ms
 
typedef NSInteger Index;
 
//播放类型
typedef NS_ENUM(NSInteger, VPSourceType) {
    VPSourceTypeLive,   //实时视频
    VPSourceTypeRecord, //录像视频
    VPSourceTypeFile,   //本地文件
    VPSourceTypeHls,    //Hls流
};
 
// 当前正在播放的录像类型
typedef NS_ENUM(NSUInteger, VPVideotapePlayingType) {
    VPVideotapePlayingTypeUnknow = 0,   /// 未知类型,或者不是播放录像
    VPVideotapePlayingTypeCloud = 1,    /// 云录像
    VPVideotapePlayingTypeDevice = 2,   /// 设备录像
};
 
//播放类型
typedef NS_ENUM(NSInteger, VPPercentType) {
    VPPercentTypeDevice,   // 从设备加载
    VPPercentTypeCloud,    // 从云加载
    VPPercentTypeLocal,    // 从本地加载
};
 
//屏幕状态
typedef NS_ENUM(NSInteger, VPWindowMode) {
    VPWindowModeOne,       //单屏
    VPWindowModeQuarter,   //4分屏
    VPWindowModeNinth,     //9分屏
    VPWindowModeSixteenth, //16分屏
} ;
 
//播放错误码
typedef NS_ENUM(NSInteger, VPVideoError) {
    VPVideoErrorUnknown,             //未知错误
    VPVideoErrorPlayFail,             //播放失败
    VPVideoErrorVideoDecryptFail,       //视频解密失败
    VPVideoErrorDeviceDecryptFail,   //设备解密失败
    VPVideoErrorAuthFail,            //鉴权失败
    VPVideoErrorAccountLock,         //账号锁定
    VPVideoErrorStreamLimit,         //流量限制
    VPVideoErrorUserOrPswWrong,      //用户或密码错误
    VPVideoErrorLoginTimeout,        //登录超时
    VPVideoErrorUserLocked,          //用户被锁定
    VPVideoErrorUserInBlackList,     //用户加入黑名单
    VPVideoErrorConnectFail,         //连接失败
    VPVideoErrorDeviceSleep,         //设备处于休眠
    VPVideoErrorExtractFailed,       //抽帧失败
    VPVideoErrorWrongFormat,         //参数格式错误
    VPVideoErrorCamSleep,               //Hub摄像机休眠
    VPVideoErrorDeviceLocked,         //13031设备被锁定
    VPVideoErrorDHHTTPTimeout,       //私有协议拉流超时
};
 
//播放器播放状态
typedef NS_ENUM(NSInteger, VPPlayStatus) {
    VPPlayStatusReady,            //默认待播状态
    VPPlayStatusIfLoad,           //判断是否加载
    VPPlayStatusWillLoad,         //即将加载
    VPPlayStatusLoading,          //加载中
    VPPlayStatusPlaying,          //播放中
    VPPlayStatusStop,             //停止播放
    VPPlayStatusPause,            //暂停播放
    VPPlayStatusEnd,              //播放结束
    VPPlayStatusError,            //播放异常
    VPPlayStatusVideoDecryptFail, //视频解密失败
    VPPlayStatusDeviceDecryptFail,//设备解密失败
    VPPlayStatusStreamLimit,      //长时间观看
    VPPlayStatusUserOrPswWrong,   //用户或密码错误
    VPPlayStatusLoginTimeout,     //登录超时
    VPPlayStatusUserLocked,       //用户被锁定
    VPPlayStatusUserInBlackList,  //用户加入黑名单
    VPPlayStatusConnectFail,      //连接失败
    VPPlayStatusExtractFailed,    //抽帧失败
    VPPlayStatusWrongFormat,      //参数格式错误
    VPPlayStatusCamSleep,         //Hub类摄像头休眠
    VPPlayStatusDeviceLocked,      //13031 设备被锁定
    VPPlayStatusDHHTTPTimeout,    //私有协议拉流超时
};
 
/// 遮罩状态,0:关闭遮罩  1:打开遮罩   2:正在打开遮罩   3:正在关闭遮罩
typedef NS_ENUM(NSInteger, VPMaskStatus) {
    VPMaskStatusClose = 0,
    VPMaskStatusOpen = 1,
    VPMaskStatusOpening = -1,
    VPMaskStatusClosing = -2,
};
 
//播放错误码
typedef NS_ENUM(NSInteger, VPVideoStreamType) {
    VPVideoStreamTypeRtsp = 0,   //(实时预览、本地录像回放、对讲)
    VPVideoStreamTypeHls = 1,    //(云录像播放、云录像下载)
    VPVideoStreamTypeFile = 2,   //(包括本地文件播放)
    VPVideoStreamTypeNetsdk = 3, //(包括大华P2P设备实时预览、录像回放)
    VPVideoStreamTypeSip = 4,    //(包括大华Meeting)
    VPVideoStreamTypeRest = 99,  //(涉及以上RTSP、HLS、SIP业务)
};
 
 
//播放器播放控制
typedef NS_ENUM(NSInteger, VPPlayControl) {
    VPPlayControlUnknown, //未知
    VPPlayControlPlay,    //播放
    VPPlayControlRefresh, //刷新
    VPPlayControlReplay,  //重播
} ;
 
//码流类型
typedef NS_ENUM(NSInteger, VPStreamType) {
    VPStreamTypeMain = 0,    //主码流
    VPStreamTypeAided,   //辅码流1
    VPStreamTypeAided2,  //辅码流2
    VPStreamTypeAided3   //辅码流3
} ;
 
//码流方向
typedef NS_ENUM(NSInteger, VPStreamOrientation) {
    VPStreamOrientationDefault,     //默认
    VPStreamOrientationVertical,    //竖屏
    VPStreamOrientationHorizontal,  //横屏
} ;
 
//方向
typedef NS_ENUM(NSInteger, VPDirection) {
    VPDirectionUp,        //上
    VPDirectionDown,      //下
    VPDirectionLeft,      //左
    VPDirectionRight,     //右
    VPDirectionLeftUp,    //左上
    VPDirectionLeftDown,  //左下
    VPDirectionRightUp,   //右上
    VPDirectionRightDown, //右下
    VPDirectionUnknown = 10,   //未知
} ; //方向
 
//手势
typedef NS_ENUM(NSInteger, VPGesture) {
    VPGestureDefault,   //未知
    VPGestureTap,       //单击
    VPGestureDblclick,  //双击
    VPGesturePanUp,     //上滑
    VPGesturePanDown,   //下滑
    VPGesturePanLeft,   //左滑
    VPGesturePanRight,  //右滑
    LVPGestureZoomOut,  //放大
    VPGestureZoomIn,    //缩小
} ; //手势
 
typedef enum : NSUInteger {
    DHPtzDirectionUnknown = 0,
    DHPtzDirectionLeft ,
    DHPtzDirectionTop ,
    DHPtzDirectionRight ,
    DHPtzDirectionBottom ,
} DHPtzDirection;