//
//  NXLiveOptions.h
//  NXLive
//
//  Created by Neuxnet on 2021/12/8.
//  Copyright © 2021 wangran. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, NXLiveCaptureType)
{
    NXLiveCaptureAudio,    ///< capture only audio
    NXLiveCaptureVideo,    ///< capture only video
    NXLiveInputAudio,      ///< only audio (External input audio)
    NXLiveInputVideo,      ///< only video (External input video)
    NXLiveScreenAudio,     ///< screen record
    NXLiveScreenVideo,     ///< screen record
};

///< 用来控制采集类型（可以内部采集也可以外部传入等各种组合，支持单音频与单视频，外部输入适用于录屏，无人机等外设介入）
typedef NS_ENUM(NSInteger, NXLiveCaptureTypeMask)
{
    /// only inner capture audio (no video)
    NXLiveCaptureMaskAudio = (1 << NXLiveCaptureAudio),
    /// only inner capture video (no audio)
    NXLiveCaptureMaskVideo = (1 << NXLiveCaptureVideo),
    /// only outer input audio (no video)
    NXLiveInputMaskAudio   = (1 << NXLiveInputAudio),
    /// only outer input video (no audio)
    NXLiveInputMaskVideo   = (1 << NXLiveInputVideo),
    /// screen record audio
    NXLiveScreenMaskAudio  = (1 << NXLiveScreenAudio),
    /// screen record video
    NXLiveScreenMaskVideo  = (1 << NXLiveScreenVideo),
    /// inner capture audio and video
    NXLiveCaptureMaskAll             = (NXLiveCaptureMaskAudio | NXLiveCaptureMaskVideo),
    /// outer input audio and video (method see pushVideo and push Audio)
    NXLiveInputMaskAll               = (NXLiveInputMaskAudio | NXLiveInputMaskVideo),
    /// inner capture audio and outer input video (method pushVideo and setRunning)
    NXLiveCaptureMaskAudioInputVideo = (NXLiveCaptureMaskAudio | NXLiveInputMaskVideo),
    /// inner capture video and outer input audio (method pushAudio and setRunning)
    NXLiveCaptureMaskVideoInputAudio = (NXLiveCaptureMaskVideo | NXLiveInputMaskAudio),
    /// inner screen record audio and video
    NXLiveScreenMaskAll              = (NXLiveScreenMaskAudio | NXLiveScreenMaskVideo),
    /// inner screen record video and out input audio. It does not support more than 30 seconds in the background.
    NXLiveScreenMaskVideoInputAudio  = (NXLiveScreenMaskVideo | NXLiveInputMaskAudio),
    /// default is innner caoture audio and video
    NXLiveCaptureDefaultMask         = NXLiveCaptureMaskAll
};


typedef NS_ENUM(NSUInteger, NXLiveState)
{
    NXLiveReady   = 0,   /// 准备
    NXLivePending = 1,   /// 连接中
    NXLiveStart   = 2,   /// 已连接
    NXLiveStop    = 3,   /// 已断开
    NXLiveError   = 4,   /// 连接出错
    NXLiveRefresh = 5,   /// 正在刷新
    NXLiveReplayError = 6,      /// 录屏错误
    NXLiveReplayDeclined = 7,   /// 用户拒绝录屏
    NXLiveReplayInterrupt = 8,  /// 录屏被中断
    NXLiveReplayRecover   = 9,  /// 录屏中断恢复
    NXLiveNoHaveInputAudioStream = 20, /// input audio，未输入音频流
    NXLiveNoHaveInputVideoStream = 21, /// input video，未输入视频流
    NXLiveNoExist    = 640,     /// 直播房间不存在
    NXLiveNoAuth     = 641,     /// 无权限
    NXLiveEnd        = 642,     /// 直播已结束，roomID已失效，请重新创建
    NXLiveAppIdError = 643,     /// appid 错误
    NXLiveNoUser     = 644,     /// 用户不存在
};

typedef NS_ENUM(NSUInteger, NXLiveSocketErrorCode)
{
    NXLiveSocketError_Preview          = 201,    /// 预览失败
    NXLiveSocketError_GetStreamInfo    = 202,    /// 获取流媒体信息失败
    NXLiveSocketError_ConnectSocket    = 203,    /// 连接socket失败
    NXLiveSocketError_Verification     = 204,    /// 验证服务器失败
    NXLiveSocketError_ReconnectTimeout = 205     /// 重新连接服务器超时
};
