7#ifndef _NIM_SDK_CPP_VCHAT_H_
8#define _NIM_SDK_CPP_VCHAT_H_
29 std::string expand_info_;
40class NIM_SDK_CPPWRAPPER_DLL_API
VChat {
45 typedef std::function<void(
bool ret,
int code,
const std::string& file, int64_t time)>
Mp4OptCallback;
49 typedef std::function<void(
bool ret,
int code,
const std::string& json_extension)>
OptCallback;
51 typedef std::function<void(
int code, int64_t channel_id,
const std::string& json_extension)>
Opt2Callback;
53 typedef std::function<void(
int id,
bool ret,
int code,
const std::string& json_extension)>
EffectOptCallback;
54 typedef std::function<void(
const std::string& accid, uint64_t time,
const char* data, uint32_t size, int32_t channels, int32_t rate)>
63 static bool Init(
const std::string& server_setting_path);
74 static void SetProxy(
NIMProxyType type,
const std::string& host,
int port,
const std::string& user,
const std::string& password);
80 static void Cleanup();
124 static void VChatRate(
int rating,
const std::string& description,
OptCallback cb);
145 const std::string& device_path,
204 static void SetAudioVolumn(
unsigned char volumn,
bool capture);
211 static unsigned char GetAudioVolumn(
bool capture);
218 static void SetAudioInputAutoVolumn(
bool auto_volumn);
224 static bool GetAudioInputAutoVolumn();
233 static void SetAudioProcess(
bool aec,
bool ns,
bool vad);
242 static void PreloadEffect(
int id,
const std::string& path,
EffectOptCallback cb);
280 static bool Start(
NIMVideoChatMode mode,
const std::string& apns_text,
const std::string& custom_info,
const std::string& json_info);
288 static bool SetTalkingMode(
NIMVideoChatMode mode,
const std::string& json_extension);
298 static bool CalleeAck(uint64_t channel_id,
bool accept,
const std::string& json_extension);
319 static void StartRecord(
const std::string& path,
const std::string& uid,
Mp4OptCallback cb);
329 static void StopRecord(
const std::string& uid,
Mp4OptCallback cb);
357 static void End(
const std::string& json_extension);
365 static void Relogin(
const std::string& session_id,
OptCallback cb);
374 static void SetVideoQuality(
int video_quality);
383 static void SetVideoBitrate(
int video_bitrate);
402 static void SetCustomData(
bool custom_audio,
bool custom_video);
412 static bool CustomAudioData(uint64_t time,
const char* data,
unsigned int size,
const char* json_extension);
429 static bool CustomVideoData(uint64_t time,
434 const char* json_extension);
453 static bool AccompanyingSound(
unsigned char id,
458 unsigned int channels,
459 const char* json_extension);
466 static void SetViewerMode(
bool viewer);
472 static bool GetViewerMode();
485 static void SetAudioMuted(
bool muted);
491 static bool GetAudioMuteEnabled();
498 static void SetAudioPlayMuted(
bool muted);
504 static bool GetAudioMutePlayEnabled();
511 static void SetRotateRemoteVideo(
bool rotate);
517 static bool IsRotateRemoteVideo();
530 static int GetVideoFrameScaleType();
543 static void SetMemberBlacklist(
const std::string& uid,
bool add,
bool audio,
const std::string& json_extension,
OptCallback cb);
556 static void CreateRoom(
const std::string& room_name,
const std::string& custom_info,
const std::string& json_extension,
Opt2Callback cb);
577 static void UpdateRtmpUrl(
const std::string& rtmp_url,
OptCallback cb);
605 static void SetUidAsMainPicture(
const std::string& uid,
const std::string& json_extension,
OptCallback cb);
614 static bool SetAutoPublish(
bool auto_pub,
bool auto_sub);
620 static bool IsAutoPublishVideo();
626 static bool IsAutoSubscribeVideo();
632 static bool IsAutoSubscribeAudio();
664 static void SubscribeVideo(
const std::string& uid,
OptCallback cb);
673 static void UnsubscribeVideo(
const std::string& uid,
OptCallback cb);
682 static void SubscribeAudio(
bool sub,
OptCallback cb);
699 static void AddRemoteAudioDataCb(
const std::string& uid,
OptCallback cb);
708 static void RemoveRemoteAudioDataCb(
const std::string& uid,
OptCallback cb);
Definition: nim_cpp_vchat.h:40
Mp4OptCallback AudioRecordCallback
音频录制事件通知回调模板
Definition: nim_cpp_vchat.h:47
std::function< void(int code, int64_t channel_id, const std::string &json_extension)> Opt2Callback
操作回调模板
Definition: nim_cpp_vchat.h:51
std::function< void(int, NetDetectCbInfo)> NetDetectCallback
网络探测回调模板
Definition: nim_cpp_vchat.h:43
std::function< void(bool ret, int code, const std::string &json_extension)> OptCallback
操作回调模板
Definition: nim_cpp_vchat.h:49
std::function< void(bool ret, int code, const std::string &file, int64_t time)> Mp4OptCallback
MP4录制事件通知回调模板
Definition: nim_cpp_vchat.h:45
std::function< void(int id, bool ret, int code, const std::string &json_extension)> EffectOptCallback
操作回调模板
Definition: nim_cpp_vchat.h:53
static NIMVChatConnectStatus GetConnectStatus()
std::function< void(const std::string &accid, uint64_t time, const char *data, uint32_t size, int32_t channels, int32_t rate)> RemoteAudioDataCallback
远端音频数据回调
Definition: nim_cpp_vchat.h:56
void(* nim_vchat_audio_data_cb_func_ex)(uint64_t time, const char *data, uint32_t size, int channels, int rate, int volume, const char *json_extension, const void *user_data)
Definition: nim_device_def.h:146
void(* nim_vchat_device_status_cb_func)(enum NIMDeviceType type, uint32_t status, const char *device_path, const char *json_extension, const void *user_data)
Definition: nim_device_def.h:121
void(* nim_vchat_enum_device_devpath_sync_cb_func)(bool ret, enum NIMDeviceType type, const char *json_extension, const void *user_data)
Definition: nim_device_def.h:105
NIMDeviceType
Definition: nim_device_def.h:17
void(* nim_vchat_start_device_cb_func)(enum NIMDeviceType type, bool ret, const char *json_extension, const void *user_data)
Definition: nim_device_def.h:163
void(* nim_vchat_audio_data_cb_func)(uint64_t time, const char *data, uint32_t size, const char *json_extension, const void *user_data)
Definition: nim_device_def.h:175
void(* nim_vchat_video_data_cb_func)(uint64_t time, const char *data, uint32_t size, uint32_t width, uint32_t height, const char *json_extension, const void *user_data)
Definition: nim_device_def.h:190
NIMProxyType
Definition: nim_global_def.h:186
NIMVChatVideoFrameRate
Definition: nim_vchat_def.h:129
NIMVChatVideoEncodeMode
Definition: nim_vchat_def.h:145
NIMVChatVideoFrameScaleType
Definition: nim_vchat_def.h:157
void(* nim_vchat_cb_func)(enum NIMVideoChatSessionType type, int64_t channel_id, int code, const char *json_extension, const void *user_data)
Definition: nim_vchat_def.h:694
NIMVChatControlType
Definition: nim_vchat_def.h:57
NIMVChatPublishVideoStreamMode
Definition: nim_vchat_def.h:408
NIMVideoChatMode
Definition: nim_vchat_def.h:89
NIMNetDetectVideoQuality
Definition: nim_vchat_def.h:340
NIMVChatConnectStatus
Definition: nim_vchat_def.h:97
NIMNetDetectType
Definition: nim_vchat_def.h:332
NIM SDK 及 NIM ChatRoom SDK 公用头文件
网络探测回调信息
Definition: nim_cpp_vchat.h:21
int32_t res_code_
返回的错误码
Definition: nim_cpp_vchat.h:23