You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

595 lines
22 KiB

//
// JCCall.h
// JCSDK-OC
//
// Created by maikireton on 2017/8/11.
// Copyright © 2017年 juphoon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JCCallCallback.h"
#import "JCCallItem.h"
/**
* @defgroup
* @{
*
*/
/**
* {@link JCCall#call:video:callParam: call}
*/
@interface JCCallParam : NSObject
/**
*
*
* {@link JCCall#call:video:callParam: call} <br>
* JCCallItem @ref JCCallItem#extraParam "extraParam"
*/
@property (nonatomic) NSString * __nullable extraParam;
/**
* 使 @ref JCCallMediaConfigModeIOT
*
* {@link JCCall#call:video:callParam: call} <br>
* JCCallItem @ref JCCallItem#ticket "ticket"
*/
@property (nonatomic) NSString * __nullable ticket;
/**
*
*
* @param extraParam
* @param ticket 使 @ref JCCallMediaConfigModeIOT
*/
+ (instancetype __nullable )callParamWithExtraParam:(NSString *__nullable)extraParam ticket:(NSString *__nullable)ticket;
@end
/**
* {@link call:video:callParam: call} @ref JCCall#mediaConfig "mediaConfig"
*/
@interface JCCallMediaConfig : NSObject
/**
*
*
* , ";", "opus;AMR;G729"
*/
@property (nonatomic, strong) NSString* __nonnull audioEnableCodecs;
/**
* @ref JCCallAecModeSDE
* - @ref JCCallAecModeAEC :
* - @ref JCCallAecModeOS : 使
* - @ref JCCallAecModeAES :
* - @ref JCCallAecModeFDE :
* - @ref JCCallAecModeSDE :
*/
@property (nonatomic) JCCallAecMode audioAecMode;
/**
*
* - true:
* - false:
*/
@property (nonatomic) bool audioArsEnable;
/**
* 20 kb
*/
@property (nonatomic) int audioArsBitrateMin;
/**
* 75 kb
*/
@property (nonatomic) int audioArsBitrateMax;
/**
* red抗丢包
*
* @note
*
* - true: payload码率
* - false:
*/
@property (nonatomic) bool audioRed;
/**
*
*
* @note , dsp处理,
*
* - true:
* - false:
*/
@property (nonatomic) bool audioRxAnr;
/**
* rtx重传
*
* @note
* - FECNACK一起用,
* - ,
* <p>
* - true:
* - false:
*/
@property (nonatomic) bool audioRtx;
/**
*
*
* @note ,
*
* - true:
* - false:
*/
@property (nonatomic) bool audioRxAgc;
/**
*
* - true:
* - false:
*/
@property (nonatomic) bool audioQosAec;
/**
*
*
* @note
* -
* -
*
* - true:
* - false:
*/
@property (nonatomic) bool audioQosAnr;
/**
*
* - true:
* - false:
*/
@property (nonatomic) bool audioQosAgc;
/**
*
* - true:
* - false:
*/
@property (nonatomic) bool audioQosVad;
/**
* 20
*/
@property (nonatomic) int audioPacketTime;
/**
* 9
*
* [0,90] @ref JCCallMediaConfig.audioQosAgc "audioQosAgc" true
*/
@property (nonatomic) int audioQosAgcGain;
/**
* "H264-SVC;H264;VP8"
*/
@property (nonatomic, strong) NSString* __nonnull videoEnableCodecs;
/**
* 640
*/
@property (nonatomic) int videoResolutionRecvWidth;
/**
* 360
*/
@property (nonatomic) int videoResolutionRecvHeight;
/**
* 640
*/
@property (nonatomic) int videoResolutionSendWidth;
/**
* 360
*/
@property (nonatomic) int videoResolutionSendHeight;
/**
* 800 kb
*/
@property (nonatomic) int videoBitrate;
/**
* 24
*/
@property (nonatomic) int videoSendFramerate;
/**
* ars
* - true
* - false:
*/
@property (nonatomic) bool videoArsEnable;
/**
* 50 kb
*/
@property (nonatomic) int videoArsBitrateMin;
/**
* 1500 kb
*/
@property (nonatomic) int videoArsBitrateMax;
/**
* 1 kb
*/
@property (nonatomic) int videoArsFramerateMin;
/**
* 30 kb
*/
@property (nonatomic) int videoArsFramerateMax;
/**
* rfc 2198 fec-red
*
* @note payload码率Opus 55kbps增加一倍码率后90kbps=55+35Opus 10kbps增加一倍码率后16kbps=10+6
*
* - true:
* - false:
*/
@property (nonatomic) bool videoRedFec;
/**
*
*
*
* 1. 640*360
* 2. 360*360
* - true 360*360
* - false: 640*360
* <p>
* - true:
* - false:
*/
@property (nonatomic) bool videoRecvFullScreen;
/**
* SmallNalu
*
*
*
* - true:
* - false:
*/
@property (nonatomic) bool videoSmallNalu;
/**
*
* - true: ,
* - false: ,
*/
@property (nonatomic) bool videoResolutionControl;
/**
* @ref JCCallMediaConfigMode "JCCallMediaConfigModeIOT" 5000
*
* @ref JCCallMediaConfigMode "JCCallMediaConfigModeIOT"
*/
@property (nonatomic) int videoKeyPeriod;
/**
* 30
*
* (0,3600) X 3*X {@link JCCallCallback.onCallItemRemove:reason:description: onCallItemRemove}
*/
@property (nonatomic) int heartbeatTime;
/**
*
* @return JCCall
*/
-(NSString* __nonnull)toString;
/**
*
*
* JCCallMediaConfig {@link JCCall#call:video:callParam: call} JCCallMediaConfig @ref JCCall#mediaConfig "mediaConfig"
*
* @param mode
* - @ref JCCallMediaConfigMode360P : 360P
* - @ref JCCallMediaConfigMode720P : 720P
* - @ref JCCallMediaConfigModeIntelligentHardware :
* - @ref JCCallMediaConfigModeIOT : asr
* @return JCCallMediaConfig
*/
+(JCCallMediaConfig* __nonnull)generateByMode:(JCCallMediaConfigMode)mode;
@end
/**
*
*
*
*/
@interface JCCall : NSObject
/**
*
*
* @ref maxCallNum > 1 callItems
*/
@property (nonatomic, readonly, strong) NSArray* __nullable callItems;
/**
* 1
*
* @note {@link call:video:callParam: call}
*/
@property (nonatomic) int maxCallNum;
/**
* false
*
* @ref JCCallItem.audioNetReceiveStatus "audioNetReceiveStatus" @ref JCCallNetWorkDisconnected
*
* - true:
* - false:
*/
@property (nonatomic) bool termWhenNetDisconnected;
/**
*
* @note
* {@link call:video:callParam: call} <br>
* JCCallMediaConfig {@link JCCallMediaConfig#generateByMode: generateByMode}
*/
@property (nonatomic, strong) JCCallMediaConfig* __nonnull mediaConfig;
/**
* JCCall
*
* JCCall 线
*
* @note
* - JCCall {@link destroy} JCCall
* - JCClient @ref JCClient.state "state" @ref JCClientStateNotInit
*
* @param client JCClient
* @param mediaDevice JCMediaDevice {@link JCMediaDevice#create:callback: create}
* @param callback JCCallCallback
* @return JCCall
* @exception "JCClient、JCMediaDevice、JCCallCallback 任意一个参数传空就会创建失败"
*/
+(JCCall* __nullable)create:(JCClient* __nonnull)client mediaDevice:(JCMediaDevice* __nonnull)mediaDevice callback:(id<JCCallCallback> __nonnull)callback;
/**
* JCCall
*
* JCCall 使 JCCall <br>
* **** JCSDK JCCall <br>
* JCCall @ref destroy
*/
+(void)destroy;
/**
*
*
* @ref maxCallNum <br>
* <br>
* {@link JCCallCallback#onCallItemAdd: onCallItemAdd} <br>
* {@link JCCallCallback#onCallItemRemove:reason:description: onCallItemRemove}
* -
* -
*
* @note
*
* @param userId
* @param video
* - true:
* - false:
* @param callParam JCCallParam : JCCallParam
* @return
* - true
* - false
*/
-(bool)call:(NSString* __nonnull)userId video:(bool)video callParam:(JCCallParam * __nullable)callParam;
/**
*
*
* {@link JCCallCallback#onCallItemRemove:reason:description: onCallItemRemove}
*
* @param item JCCallItem @ref callItems
* @param reason @ref JCCallReason "挂断原因"
* @param description
* @return
* - true
* - false
*/
-(bool)term:(JCCallItem* __nonnull)item reason:(JCCallReason)reason description:(NSString* __nullable)description;
/**
*
*
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate} <br>
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate} 1 2<br>
* {@link JCCallCallback.onCallItemRemove:reason:description: onCallItemRemove}
*
* @param item JCCallItem @ref callItems
* @param video
* - true:
* - false:
* @return
* - true
* - false
*/
-(bool)answer:(JCCallItem* __nonnull)item video:(bool)video;
/**
* /
*
* @deprecated v2.7.1 Juphoon 使/ {@link muteMicrophone:mute: muteMicrophone}
*
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate}
*
* @ref JCCallItem#mute "mute" /
* - @ref JCCallItem#mute "mute" true:
* - @ref JCCallItem#mute "mute" false:
*
* @param item JCCallItem @ref callItems
* @return
* - true
* - false
*/
-(bool)mute:(JCCallItem* __nonnull)item;
/**
* /
*
*
* - @ref JCCallItem#microphoneMute "microphoneMute" true:
* - @ref JCCallItem#microphoneMute "microphoneMute" false:
*
* @param item JCCallItem
* @param mute
* @return
* - true {@link JCCallCallback#onCallItemUpdate:changeParam: onCallItemUpdate}
* - false
*/
-(bool)muteMicrophone:(JCCallItem* __nonnull)item mute:(bool)mute;
/**
* /
*
*
* - @ref JCCallItem#speakerMute "speakerMute" true:
* - @ref JCCallItem#speakerMute "speakerMute" false:
*
* @param item JCCallItem
* @param mute
* @return
* - true {@link JCCallCallback#onCallItemUpdate:changeParam: onCallItemUpdate}
* - false
*/
-(bool)muteSpeaker:(JCCallItem* __nonnull)item mute:(bool)mute;
/**
* /
*
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate}
*
* @ref JCCallItem#hold "hold" /
* - @ref JCCallItem#hold "hold" true:
* - @ref JCCallItem#hold "hold" false:
*
* @note
*
* @param item JCCallItem @ref callItems
* @return
* - true
* - false
*/
-(bool)hold:(JCCallItem* __nonnull)item;
/**
* /
*
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate}
*
* <br>
*
*
* @param item JCCallItem @ref callItems
* @param enable /
* - true:
* - false:
* @param filePath **/Documents/JuphoonCloud/audio.wmv**
* @return
* - true
* - false
*/
-(bool)audioRecord:(JCCallItem* __nonnull)item enable:(bool)enable filePath:(NSString* __nullable)filePath;
/**
* /
*
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate}
*
* 1 2 3<br>
* 1 2
*
* @param item JCCallItem @ref callItems
* @param enable
* - true:
* - false:
* @param remote
* - true:
* - false:
* @param width
* @param height
* @param filePath **/Documents/JuphoonCloud/video.mp4**
* @param bothAudio
* - true:
* - false: remote true remote false
* @return
* - true
* - false
*/
-(bool)videoRecord:(JCCallItem* __nonnull)item enable:(bool)enable remote:(bool)remote width:(int)width height:(int)height filePath:(NSString* __nullable)filePath bothAudio:(bool)bothAudio;
/**
*
*
* JCCallItem {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate} <br>
* JCCallItem
*
* @param item JCCallItem
* @return
* - true
* - false
*/
-(bool)becomeActive:(JCCallItem* __nonnull)item;
/**
* /
*
* {@link JCCallCallback.onCallItemUpdate:changeParam: onCallItemUpdate}
*
* JCCallItem @ref JCCallItem.uploadVideoStreamSelf "uploadVideoStreamSelf"
* - @ref JCCallItem.uploadVideoStreamSelf "uploadVideoStreamSelf" true:
* - @ref JCCallItem.uploadVideoStreamSelf "uploadVideoStreamSelf" false:
*
* @note
*
* @param item JCCallItem @ref callItems
* @return
* - true
* - false
*/
-(bool)enableUploadVideoStream:(JCCallItem* __nonnull)item;
/**
*
*
* @param item JCCallItem @ref callItems
* @param type textxml等
* @param content
* @return
* - true
* - false
*/
-(bool)sendMessage:(JCCallItem * __nonnull)item type:(NSString * __nonnull)type content:(NSString * __nonnull)content;
/**
*
*
* Json字符串形式返回 "Audio""Video""Mtp"
*
* @return
*/
-(NSString * __nullable)getStatistics;
/**
*
*
* {@link JCCallCallback#onCallItemAdd: onCallItemAdd} 使<br>
* {@link JCCallCallback#onCallItemAdd: onCallItemAdd} nil
*
* @return
* - JCCallItem
* - nil
*/
-(JCCallItem* __nullable)getActiveCallItem;
/**
* DTMF信息
*
* @param item JCCallItem
* @param value @ref JCCallDtmf "DTMF值"
* @return
* - true
* - false
*/
-(bool)sendDtmf:(JCCallItem *_Nonnull)item value:(JCCallDtmf)value;
@end
/**
* @}
*/