//
//  RTCXPlayerEnumDef.h
//  LinkvisualMedia
//
//  Created by Apple on 2024/8/27.
//

#ifndef RTCXPlayerEnumDef_h
#define RTCXPlayerEnumDef_h
/// 播放器状态回调
typedef NS_ENUM(NSInteger, RTCXCameraPlayerState) {
    // 播放初始化播放未开始
    RTCXCameraPlayerStateInitial = -1,
    // 播放准备就绪
    RTCXCameraPlayerStatePrepared = 0,
    // 播放状态
    RTCXCameraPlayerStatePlaying,
    // 开始图像渲染
    RTCXCameraPlayerStateRenderingStart,
    // 暂停状态
    RTCXCameraPlayerStatePaused,
    // 缓冲状态开始
    RTCXCameraPlayerStateBuffingStart,
    // 缓冲状态结束
    RTCXCameraPlayerStateBuffingEnd,
    // 事件，剪辑视频等，播放完毕
    RTCXCameraPlayerStatePlaybackCompleted,
    // 播放停止
    RTCXCameraPlayerStateStopped,
    /// 播放错误
    RTCXCameraPlayerStateError
};
/// 播放错误码
typedef NS_ENUM(NSInteger, RTCXPlayerErrorCode) {
    // 播放流通道连接失败或断开连接
    RTCXPlayerErrorCode_ChannelConnectFailed = -2,
    // 播放流通道连接异常
    RTCXPlayerErrorCode_ChannelConnectAbnormal = -5,
    // 复用P2P播放通道超时
    RTCXPlayerErrorCode_ReuseP2pPlayTimeout = -500,
    // SDCard回放已经没有更多数据了
    RTCXPlayerErrorCode_SDCardPlaybackEnd = -501,
    // 播放时长限制
    RTCXPlayerErrorCode_PlayDurationLimit = -10010,
    // SD卡回放已达设备最大支持数量
    RTCXPlayerErrorCode_SDCardMaxLimit = -10025,
    // 无效的RTC通道
    RTCXPlayerErrorCode_InvalidRtcChannel = -10028,
    // P2P播放通道已达设备最大支持数量
    RTCXPlayerErrorCode_P2PChannelMaxLimit = -10029,
    // 低功耗设备正在进入休眠
    RTCXPlayerErrorCode_DeviceSleeping = -10047,
    // CMS流通道连接失败或断开连接
    RTCXPlayerErrorCode_CMSChannelConnectFailed = 100000,
    // P2P流通道连接失败或断开连接
    RTCXPlayerErrorCode_P2PChannelConnectFailed = 1000001,
    // P2P流通道连接超时
    RTCXPlayerErrorCode_P2PChannelConnectTimeout = 1000003,
    // SD卡回放获取SDP失败
    RTCXPlayerErrorCode_SDCardSdpFailed = 1000008,
    // 直播获取SDP失败
    RTCXPlayerErrorCode_LiveSdpFailed = 1000011,
    // SD卡回放获取SDP超时
    RTCXPlayerErrorCode_SDCardSdpTimeout = 1000013,
    // 直播获取SDP超时
    RTCXPlayerErrorCode_LiveSdpTimeout = 1000014,
    // 调用云回看播放地址失败
    RTCXPlayerErrorCode_CloudPlaybackUrlFailed = 1000016,
    // 播放首帧出图失败
    RTCXPlayerErrorCode_FirstFrameFail = 1000025,
    // 事件开始时间大于结束时间
    RTCXPlayerErrorCode_EventTimeUnreasonable = 1000026,
    // 当前镜头没有可播放数据
    RTCXPlayerErrorCode_LensNoData = 1000027,
    // 设备端与服务器流通道连接失败
    RTCXPlayerErrorCode_CameraChannelConnectFail = 1000028,
};
/// 音视频通话错误码
typedef NS_ENUM(NSInteger, RTCXTalkErrorCode) {
    // 语音对讲busy
    RTCXTalkErrorCode_TalkBusy = -10023,
    // 通道连接失败
    RTCXTalkErrorCode_ChannelConnectFail = 1002,
    // 设备未收到对讲数据
    RTCXTalkErrorCode_DeviceNoTalkData = 1005,
};
/// 日志等级
typedef NS_ENUM(NSInteger, IOTPlayerLogLevel) {
    IOT_PLAYER_LOG_LEVEL_VERBOSE,
    IOT_PLAYER_LOG_LEVEL_INFO,
    IOT_PLAYER_LOG_LEVEL_WARN,
    IOT_PLAYER_LOG_LEVEL_ERROR,
    IOT_PLAYER_LOG_LEVEL_OFF
};
/// 水印位置
typedef NS_ENUM(NSInteger, IOTLogoWatermarkPosition) {
    IOTLogoWatermarkPosition_DefaultPos,   //logo水印默认位置
    IOTLogoWatermarkPosition_LeftTop,      //logo水印位于左上角
    IOTLogoWatermarkPosition_RightTop,     //logo水印位于右上角
    IOTLogoWatermarkPosition_RightBottom,  //logo水印位于右下角
    IOTLogoWatermarkPosition_Left_Bottom,  //logo水印位于左下角
};
/// 回放类型
typedef NS_ENUM(NSInteger, IOTPlaybackType) {
    /// 未知
    IOTPlaybackTypeUnknow,
    /// 云录像回放
    IOTPlaybackTypeCloudRecord,
    /// 云事件回放
    IOTPlaybackTypeCloudEvent,
    /// SD卡录像回放
    IOTPlaybackTypeSDCardRecord,
    /// SD卡事件回放
    IOTPlaybackTypeSDCardEvent
};

/// 旋转角度设置
typedef NS_ENUM (NSInteger, IOTRenderRotation){
    IOT_RENDER_ROTATION_0   = 0,
    IOT_RENDER_ROTATION_90  = 90,
    IOT_RENDER_ROTATION_180 = 180,
    IOT_RENDER_ROTATION_270 = 270
};
/// 播放Trace回调
typedef NS_ENUM(NSInteger, IOTPlayTraces) {
    // Tracek开始
    IOTPlayTracesStart = 0,
    // CMS本地sdp回调
    IOTPlayTracesCMSLocalSdp = 1,
    // CMS远程sdp回调
    IOTPlayTracesCMSRemoteSdp = 2,
    // CMS连接成功
    IOTPlayTracesCMSConnectSuccess = 3,
    // CMS播放成功
    IOTPlayTracesCMSPlaySuccess = 4,
    // P2P本地sdp回调
    IOTPlayTracesP2PLocalSdp = 5,
    // P2P远程sdp回调
    IOTPlayTracesP2PRemoteSdp = 6,
    // P2P连接成功
    IOTPlayTracesP2PConnectSuccess = 7,
    // P2P播放成功
    IOTPlayTracesP2PPlaySuccess = 8,
    // 开始获取URL
    IOTPlayTracesStartUrl = 9,
    // 结束获取URL
    IOTPlayTracesEndUrl = 10,
    // Tracek结束
    IOTPlayTracesEnd = 11,
    // p2p通道个数达到最大
    IOTPlayTracesP2PReachMax = 12,
    // 镜头没有数据
    IOTPlayTracesLensNoData = 13,
};
// P2P通道连接状态
typedef NS_ENUM(NSInteger, RTCXP2PChannelConnectStatus) {
    RTCXP2PChannelConnectStatus_Initial = 0,
    RTCXP2PChannelConnectStatus_Success = 1,
    RTCXP2PChannelConnectStatus_Failed = 2,
};
// CMS通道连接状态
typedef NS_ENUM(NSInteger, RTCXCMSChannelConnectStatus) {
    RTCXCMSChannelConnectStatus_Initial = 0,
    RTCXCMSChannelConnectStatus_Success = 1,
    RTCXCMSChannelConnectStatus_Failed = 2,
};
// Datachannel通道连接状态
typedef NS_ENUM(NSInteger, RTCXDataChannelConnectStatus) {
    RTCXDataChannelConnectStatus_Initial = 0,
    RTCXDataChannelConnectStatus_Success = 1,
    RTCXDataChannelConnectStatus_Failed = 2,
};
// 播放流通道类型: CMS/P2P
typedef NS_ENUM(NSInteger, RTCXPlyerChannelType) {
    RTCXPlyerChannelType_CMSChannel = 1,
    RTCXPlyerChannelType_P2PChannel  = 2,
};
#endif /* RTCXPlayerEnumDef_h */
