NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim_vchat.h 文件参考

音视频 接口头文件 更多...

#include "nim_global_def.h"
#include "nim_vchat_def.h"
#include "public_defines.h"

浏览源代码.

函数

NIM_SDK_DLL_API bool nim_vchat_init (const char *json_extension)
 
NIM_SDK_DLL_API void nim_vchat_set_proxy (enum NIMProxyType type, const char *host, int port, const char *user, const char *password)
 
NIM_SDK_DLL_API void nim_vchat_rate (int rating, const char *description, const char *json_extension, const nim_vchat_rate_callback cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_cleanup (const char *json_extension)
 
NIM_SDK_DLL_API void nim_vchat_set_cb_func (nim_vchat_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API bool nim_vchat_start (enum NIMVideoChatMode mode, const char *apns_text, const char *custom_info, const char *json_extension, const void *user_data)
 
NIM_SDK_DLL_API bool nim_vchat_callee_ack (int64_t channel_id, bool accept, const char *json_extension, const void *user_data)
 
NIM_SDK_DLL_API bool nim_vchat_control (int64_t channel_id, enum NIMVChatControlType type, const char *json_extension, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_viewer_mode (bool viewer)
 
NIM_SDK_DLL_API bool nim_vchat_get_viewer_mode ()
 
NIM_SDK_DLL_API int nim_vchat_get_connect_status ()
 
NIM_SDK_DLL_API void nim_vchat_set_audio_mute (bool muted)
 
NIM_SDK_DLL_API bool nim_vchat_audio_mute_enabled ()
 
NIM_SDK_DLL_API void nim_vchat_set_member_in_blacklist (const char *uid, bool add, bool audio, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_end (const char *json_extension)
 
NIM_SDK_DLL_API void nim_vchat_create_room (const char *room_name, const char *custom_info, const char *json_extension, nim_vchat_opt2_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API bool nim_vchat_join_room (enum NIMVideoChatMode mode, const char *room_name, const char *json_extension, nim_vchat_opt2_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_custom_data (bool custom_audio, bool custom_video, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API bool nim_vchat_set_talking_mode (enum NIMVideoChatMode mode, const char *json_extension)
 
NIM_SDK_DLL_API void nim_vchat_set_rotate_remote_video (bool rotate)
 
NIM_SDK_DLL_API bool nim_vchat_rotate_remote_video_enabled ()
 
NIM_SDK_DLL_API void nim_vchat_set_video_quality (int video_quality, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_video_bitrate (int video_bitrate, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_frame_rate (enum NIMVChatVideoFrameRate frame_rate, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_video_frame_scale (enum NIMVChatVideoFrameScaleType type)
 
NIM_SDK_DLL_API int nim_vchat_get_video_frame_scale_type ()
 
NIM_SDK_DLL_API void nim_vchat_select_video_adaptive_strategy (enum NIMVChatVideoEncodeMode mode, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_start_record (const char *path, const char *json_extension, nim_vchat_mp4_record_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_stop_record (const char *json_extension, nim_vchat_mp4_record_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_start_audio_record (const char *path, const char *json_extension, nim_vchat_audio_record_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_stop_audio_record (const char *json_extension, nim_vchat_audio_record_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_relogin (const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API uint64_t nim_vchat_net_detect (const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_audio_play_mute (bool muted)
 
NIM_SDK_DLL_API bool nim_vchat_audio_play_mute_enabled ()
 
NIM_SDK_DLL_API void nim_vchat_update_rtmp_url (const char *rtmp_url, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_uid_picture_as_main (const char *uid, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API bool nim_vchat_set_auto_publish (bool auto_pub, bool auto_sub)
 
NIM_SDK_DLL_API bool nim_vchat_is_auto_publish_video ()
 
NIM_SDK_DLL_API bool nim_vchat_is_auto_subscribe_video ()
 
NIM_SDK_DLL_API bool nim_vchat_is_auto_subscribe_audio ()
 
NIM_SDK_DLL_API bool nim_chat_set_local_video_simulcast_mode (enum NIMVChatPublishVideoStreamMode video_stream_mode)
 
NIM_SDK_DLL_API void nim_vchat_publish_video (const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_unpublish_video (const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_subscribe_video (const char *uid, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_unsubscribe_video (const char *uid, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_subscribe_audio (bool sub, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_vchat_set_remote_audio_data_cb (const char *uid, nim_vchat_remote_audio_data_cb_func remote_data_cb, const void *remote_data_cb_user_data, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
 

详细描述

音视频 接口头文件

作者
gq
日期
2015/4/30

函数说明

◆ nim_chat_set_local_video_simulcast_mode()

bool nim_chat_set_local_video_simulcast_mode ( enum NIMVChatPublishVideoStreamMode  video_stream_mode)

NRTC 设置本地默认发布的视频流模式,默认为单流(自动发布模式下有效)

参数
[in]video_stream_mode目前仅支持单/双流模式。
返回
bool 是否调用成功

◆ nim_vchat_audio_mute_enabled()

bool nim_vchat_audio_mute_enabled ( )

NIM VCHAT 获取音频静音状态

返回
bool true 静音,false 不静音

◆ nim_vchat_audio_play_mute_enabled()

bool nim_vchat_audio_play_mute_enabled ( )

获取播放对端音频静音状态

返回
bool true 静音,false 不静音

◆ nim_vchat_callee_ack()

bool nim_vchat_callee_ack ( int64_t  channel_id,
bool  accept,
const char *  json_extension,
const void *  user_data 
)

NIM VCHAT 回应音视频通话邀请,异步回调nim_vchat_cb_func 见nim_vchat_def.h

参数
[in]channel_id音视频通话通道id
[in]accepttrue 接受,false 拒绝
[in]json_extension扩展的json string,接起时有效 参数可选 如{"custom_video":0, "custom_audio":0, "video_quality":0, "session_id":"1231sda"}
[in]user_data无效的扩展字段
返回
bool true 调用成功,false 调用失败(可能channel_id无匹配,如要接起另一路通话前先结束当前通话)

◆ nim_vchat_cleanup()

bool nim_vchat_cleanup ( const char *  json_extension)

NIM VCHAT清理,需要在SDK的nim_client_cleanup之前

参数
[in]json_extension无效的扩展字段
返回
void 无返回值

◆ nim_vchat_control()

bool nim_vchat_control ( int64_t  channel_id,
enum NIMVChatControlType  type,
const char *  json_extension,
const void *  user_data 
)

NIM VCHAT 音视频通话控制,点对点通话有效,异步回调nim_vchat_cb_func 见nim_vchat_def.h

参数
[in]channel_id音视频通话通道id
[in]typeNIMVChatControlType 见nim_vchat_def.h
[in]json_extension无效的扩展字段
[in]user_data无效的扩展字段
返回
bool true 调用成功,false 调用失败

◆ nim_vchat_create_room()

void nim_vchat_create_room ( const char *  room_name,
const char *  custom_info,
const char *  json_extension,
nim_vchat_opt2_cb_func  cb,
const void *  user_data 
)

创建一个多人房间(后续需要主动调用加入接口进入房间)

参数
[in]room_name房间名
[in]custom_info自定义的房间信息(加入房间的时候会返回)
[in]json_extension增加room_config的定义 详见定义,eg.{"room_config":{"rtmpTasks":[{"taskId":"stream_1","streamUrl":"rtmp://test.url","layoutMode":"0","layoutPara":"{\"k1\":\"v1\"}","record":true,"accid":"123"}]}}
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效,返回的channel id 无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 417:提示已经创建好频道

◆ nim_vchat_end()

void nim_vchat_end ( const char *  json_extension)

NIM VCHAT 结束通话(需要主动在通话结束后调用,用于底层挂断和清理数据)

参数
[in]json_extension可扩展添加kNIMVChatSessionId,用于关闭对应的通话,如果kNIMVChatSessionId缺省则关闭当前通话
返回
void 无返回值

◆ nim_vchat_get_connect_status()

int nim_vchat_get_connect_status ( )

NIM VCHAT 获取当前通话状态

返回
int 通话状态NIMVChatConnectStatus

◆ nim_vchat_get_video_frame_scale_type()

int nim_vchat_get_video_frame_scale_type ( )

NIM VCHAT 获取视频画面的裁剪模式

返回
int 当前的裁剪模式NIMVChatVideoFrameScaleType

◆ nim_vchat_get_viewer_mode()

bool nim_vchat_get_viewer_mode ( )

NIM VCHAT 获取当前是否是观众模式

返回
bool true 观众模式,false 非观众模式

◆ nim_vchat_init()

bool nim_vchat_init ( const char *  json_extension)

NIM VCHAT初始化,需要在SDK的nim_client_init成功之后

参数
[in]json_extension见nim_vchat_def.h,扩展允许传入服务器配置kNIMVChatServerSettingPath
返回
bool 初始化结果,如果是false则以下所有接口调用无效

◆ nim_vchat_is_auto_publish_video()

bool nim_vchat_is_auto_publish_video ( )

获取通话设置中是否自动发布视频数据

返回
bool 是否自动发布

◆ nim_vchat_is_auto_subscribe_audio()

bool nim_vchat_is_auto_subscribe_audio ( )

获取通话设置中是否自动订阅音频数据

返回
bool 是否自动订阅

◆ nim_vchat_is_auto_subscribe_video()

bool nim_vchat_is_auto_subscribe_video ( )

获取通话设置中是否自动订阅视频数据

返回
bool 是否自动订阅

◆ nim_vchat_join_room()

bool nim_vchat_join_room ( enum NIMVideoChatMode  mode,
const char *  room_name,
const char *  json_extension,
nim_vchat_opt2_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 加入一个多人房间(进入房间后成员变化等,等同点对点nim_vchat_cb_func)

参数
[in]modeNIMVideoChatMode 音视频通话类型 见nim_vchat_def.h
[in]room_name房间名
[in]json_extension可选 如{"custom_video":0, "custom_audio":0, "video_quality":0, "session_id":"1231sda", "rtmp_url":"", "bypass_rtmp":0}
[in]cb结果回调见nim_vchat_def.h,返回的json_extension扩展字段中包含 kNIMVChatCustomInfo,kNIMVChatSessionId
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
bool true 调用成功,false 调用失败可能有正在进行的通话
注解
错误码 200:成功

◆ nim_vchat_net_detect()

uint64_t nim_vchat_net_detect ( const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

音视频网络探测接口,需要在sdk初始化时带上app key

参数
[in]json_extensionjson扩展参数,允许用户设置探测时间限制kNIMNetDetectTimeLimit,及探测类型kNIMNetDetectType
[in]cb操作结果的回调函数
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
uint64_t 探测任务id
注解
错误码 200:成功 0:流程错误 400:非法请求格式 417:请求数据不对 606:ip为内网ip 607:频率超限 20001:探测类型错误 20002:ip错误 20003:sock错误

◆ nim_vchat_publish_video()

void nim_vchat_publish_video ( const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

通话中设置自己的视频数据发布接口。该接口仅限于多人通话模式,且通话未发起时设置失败。 回调结果只代表本地的操作结果,远端是否成功等对应的通知kNIMVChatNotifyPublishVideoRet及kNIMVChatNotifyUnpublishVideoRet

参数
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效。错误码见NIMVChatPubSubErrorCode。
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_rate()

void nim_vchat_rate ( int  rating,
const char *  description,
const char *  json_extension,
const nim_vchat_rate_callback  cb,
const void *  user_data 
)

打分反馈

参数
[in]rating评分,分值为1-5
[in]description问题描述
[in]json_extensionjson 扩展参数,暂时未使用
[in]commitlog是否提交sdk日志
[in]cb反馈结果回调
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_relogin()

void nim_vchat_relogin ( const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

音视频通话重新连接,用于底层链接在上层认为异常时尝试重连

参数
[in]json_extension可扩展添加kNIMVChatSessionId,用于指定对应的通话
[in]cb操作结果的回调函数
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_rotate_remote_video_enabled()

bool nim_vchat_rotate_remote_video_enabled ( )

NIM VCHAT 获取自动旋转对方画面设置状态

返回
bool true 自动旋转,false 不旋转

◆ nim_vchat_select_video_adaptive_strategy()

void nim_vchat_select_video_adaptive_strategy ( enum NIMVChatVideoEncodeMode  mode,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 通话中修改视频编码模式

参数
[in]mode选用的策略模式
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_set_audio_mute()

void nim_vchat_set_audio_mute ( bool  muted)

NIM VCHAT 设置音频静音,全局有效(重新发起时也生效);此开关打开音频只发静音包

参数
[in]mutedtrue 静音,false 不静音
返回
void 无返回值

◆ nim_vchat_set_audio_play_mute()

void nim_vchat_set_audio_play_mute ( bool  muted)

设置播放对端音频静音,全局有效(重新发起时也生效);此开关打开不播放,但不影响解码及录制

参数
[in]mutedtrue 静音,false 不静音
返回
void 无返回值

◆ nim_vchat_set_auto_publish()

bool nim_vchat_set_auto_publish ( bool  auto_pub,
bool  auto_sub 
)

设置通话中自动订阅对端新加入成员音视频数据,及通话开启后自动发布视频数据的逻辑;音频发布由sdk控制,如果要不发音频单独使用静音接口。该接口仅限于多人通话模式,且需要在通话前设置,通话中设置失败。

参数
[in]auto_pub是否自动发布视频数据,默认开启;其中音频不支持设置自动发布功能,强制发布。自动发布时,nim_vchat_publish_video接口会调用失败。
[in]auto_sub是否自动订阅音视频数据,默认开启;自动订阅时nim_vchat_subscribe_video、nim_vchat_subscribe_audio会调用失败。
返回
bool 是否调用成功

◆ nim_vchat_set_cb_func()

void nim_vchat_set_cb_func ( nim_vchat_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 设置通话回调或者服务器通知

参数
[in]cb结果回调见nim_vchat_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 9103:已经在其他端接听/拒绝过这通电话 11001:通话不可送达,对方离线状态

◆ nim_vchat_set_custom_data()

void nim_vchat_set_custom_data ( bool  custom_audio,
bool  custom_video,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 通话中修改自定义音视频数据模式

参数
[in]custom_audiotrue表示使用自定义的音频数据,false表示不使用
[in]custom_videotrue表示使用自定义的视频数据,false表示不使用
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:成功 11403:无效的操作

◆ nim_vchat_set_frame_rate()

void nim_vchat_set_frame_rate ( enum NIMVChatVideoFrameRate  frame_rate,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 实时设置视频发送帧率上限

参数
[in]frame_rate帧率类型 见NIMVChatVideoFrameRate定义
[in]json_extension无效备用
[in]cb结果回调见nim_vchat_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:成功 11403:无效的操作

◆ nim_vchat_set_member_in_blacklist()

void nim_vchat_set_member_in_blacklist ( const char *  uid,
bool  add,
bool  audio,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 设置单个成员的黑名单状态,当前通话有效(只能设置进入过房间的成员)

参数
[in]uid成员account
[in]addtrue表示添加到黑名单,false表示从黑名单移除
[in]audiotrue表示音频黑名单,false表示视频黑名单
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:成功 11403:无效的操作

◆ nim_vchat_set_proxy()

void nim_vchat_set_proxy ( enum NIMProxyType  type,
const char *  host,
int  port,
const char *  user,
const char *  password 
)

设置SDK音视频的网络代理,暂时只支持socks5代理,全局代理接口也能设置音视频的代理,两接口没有优先级区别。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串。

参数
[in]type代理类型,见NIMProxyType定义,其中音视频只支持kNIMProxySocks5及kNIMProxyNrtc代理
[in]host代理地址
[in]port代理端口
[in]user代理用户名
[in]password代理密码
返回
void 无返回值

◆ nim_vchat_set_remote_audio_data_cb()

void nim_vchat_set_remote_audio_data_cb ( const char *  uid,
nim_vchat_remote_audio_data_cb_func  remote_data_cb,
const void *  remote_data_cb_user_data,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

通话中设置监听远端音频数据扩展接口,成员进入后才能设置,成员退出后设置失效

参数
[in]uid远端用户id
[in]remote_data_cb数据回调见nim_vchat_def.h。该数据回调为同步回调,需要保证快速处理,防止影响音频播放。
[in]remote_data_cb_user_dataAPP的自定义用户数据,SDK只负责传回给回调函数remote_data_cb,不做任何处理!
[in]json_extension扩展
[in]cb结果回调见nim_vchat_def.h,返回的code及json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_set_rotate_remote_video()

void nim_vchat_set_rotate_remote_video ( bool  rotate)

NIM VCHAT 设置不自动旋转对方画面,默认打开,全局有效(重新发起时也生效)

参数
[in]rotatetrue 自动旋转,false 不旋转
返回
void 无返回值

◆ nim_vchat_set_talking_mode()

bool nim_vchat_set_talking_mode ( enum NIMVideoChatMode  mode,
const char *  json_extension 
)

NIM VCHAT 设置通话模式,在更改通话模式后,通知底层

参数
[in]modeNIMVideoChatMode 音视频通话类型 见nim_vchat_def.h
[in]json_extension无效的扩展字段
返回
bool true 调用成功,false 调用失败

◆ nim_vchat_set_uid_picture_as_main()

void nim_vchat_set_uid_picture_as_main ( const char *  uid,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 互动直播设置uid为房间主画面

参数
[in]uid成员account
[in]json_extension
[in]cb结果会叫见nim_vchat_def.h,返回的json_extension无效,返回的code参考NIMMainPictureOptCode
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 400:非法请求格式 401: 认证错误 404:房间不存在 405:房间下的uid不存在 417:请求数据不对 500: 内部错误 600:服务器内部错误 11403:无效的操作

◆ nim_vchat_set_video_bitrate()

void nim_vchat_set_video_bitrate ( int  video_bitrate,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 通话中修改视频码率,有效区间[100kb,5000kb],如果设置video_bitrate为0则取默认码率

参数
[in]video_bitrate视频码率值
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:成功 11403:无效的操作

◆ nim_vchat_set_video_frame_scale()

void nim_vchat_set_video_frame_scale ( enum NIMVChatVideoFrameScaleType  type)

NIM VCHAT 设置发送时视频画面的长宽比例裁剪模式,裁剪的时候不改变横竖屏(重新发起时也生效)

参数
[in]type裁剪模式NIMVChatVideoFrameScaleType

◆ nim_vchat_set_video_quality()

void nim_vchat_set_video_quality ( int  video_quality,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 通话中修改发送画面分辨率,发送的分辨率限制只对上限限制,如果数据源小于发送分辨率,不会进行放大

参数
[in]video_quality分辨率模式 见NIMVChatVideoQuality定义
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:成功 11403:无效的操作

◆ nim_vchat_set_viewer_mode()

void nim_vchat_set_viewer_mode ( bool  viewer)

NIM VCHAT 设置观众模式(多人模式下),全局有效(重新发起时也生效),观众模式能减少运行开销

参数
[in]viewer是否观众模式
返回
void 无返回值

◆ nim_vchat_start()

bool nim_vchat_start ( enum NIMVideoChatMode  mode,
const char *  apns_text,
const char *  custom_info,
const char *  json_extension,
const void *  user_data 
)

NIM VCHAT 启动点对点通话,异步回调nim_vchat_cb_func 见nim_vchat_def.h

参数
[in]modeNIMVideoChatMode 启动音视频通话类型 见nim_vchat_def.h
[in]apns_text自定义推送字段,填空用默认推送
[in]custom_info自定义数据,用于透传给接收方
[in]json_extensionJson string 扩展,kNIMVChatUids成员id列表(必填),其他可选 如{"uids":["uid_temp"],"custom_video":0, "custom_audio":0, "video_quality":0, "session_id":"1231sda"}
[in]user_data无效的扩展字段
返回
bool true 调用成功,false 调用失败可能有正在进行的通话

◆ nim_vchat_start_audio_record()

void nim_vchat_start_audio_record ( const char *  path,
const char *  json_extension,
nim_vchat_audio_record_opt_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 开始录制音频文件,一次只允许一个音频录制文件

参数
[in]path文件录制路径
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_start_record()

void nim_vchat_start_record ( const char *  path,
const char *  json_extension,
nim_vchat_mp4_record_opt_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 开始录制MP4文件,同一个成员一次只允许一个MP4录制文件,在通话开始的时候才有实际数据

参数
[in]path文件录制路径
[in]json_extensionkNIMVChatUid录制的成员,如果是自己填空(录制时允许同时混音对端声音,需要填kNIMVChatMp4AudioType);kNIMVChatMp4Recode标识是否重编码(默认打开,打开后kNIMVChatMp4Width和kNIMVChatMp4Height有效[16-1280有效])
[in]cb结果回调见nim_vchat_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:MP4文件创建 400:MP4文件已经存在 403:MP4文件创建失败 404:通话不存在

◆ nim_vchat_stop_audio_record()

void nim_vchat_stop_audio_record ( const char *  json_extension,
nim_vchat_audio_record_opt_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 停止录制音频文件

参数
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_stop_record()

void nim_vchat_stop_record ( const char *  json_extension,
nim_vchat_mp4_record_opt_cb_func  cb,
const void *  user_data 
)

NIM VCHAT 停止录制MP4文件

参数
[in]json_extensionkNIMVChatUid录制的成员,如果是自己填空
[in]cb结果回调见nim_vchat_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:MP4结束 404:通话不存在

◆ nim_vchat_subscribe_audio()

void nim_vchat_subscribe_audio ( bool  sub,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

通话中设置订阅音频数据,默认自动订阅。音频数据没有单独订阅某一成员的接口。该接口仅限于多人通话模式,且通话未发起时设置失败。 回调结果只代表本地的操作结果,远端是否成功等对应的通知kNIMVChatNotifySubscribeAudioRet及kNIMVChatNotifyUnsubscribeAudioRet

参数
[in]sub是否订阅音频数据
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效。错误码见NIMVChatPubSubErrorCode。
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_subscribe_video()

void nim_vchat_subscribe_video ( const char *  uid,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

通话中设置订阅某一方的视频数据,该接口仅限于多人通话模式,且通话未发起时设置失败。 回调结果只代表本地的操作结果,远端是否成功等对应的通知kNIMVChatNotifySubscribeVideoRet及kNIMVChatNotifyUnsubscribeVideoRet

参数
[in]uid用户账号
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension带有kNIMVChatId,即调用时传入的uid;错误码见NIMVChatPubSubErrorCode。
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_unpublish_video()

void nim_vchat_unpublish_video ( const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

通话中设置自己的视频数据取消发布接口。该接口仅限于多人通话模式,且通话未发起时设置失败。 回调结果只代表本地的操作结果,远端是否成功等对应的通知kNIMVChatNotifyPublishVideoRet及kNIMVChatNotifyUnpublishVideoRet

参数
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效。错误码见NIMVChatPubSubErrorCode。
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_unsubscribe_video()

void nim_vchat_unsubscribe_video ( const char *  uid,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

通话中设置取消订阅某一方的视频数据,该接口仅限于多人通话模式,且通话未发起时设置失败。 回调结果只代表本地的操作结果,远端是否成功等对应的通知kNIMVChatNotifySubscribeVideoRet及kNIMVChatNotifyUnsubscribeVideoRet

参数
[in]uid用户账号
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension带有kNIMVChatId,即调用时传入的uid;错误码见NIMVChatPubSubErrorCode。
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_vchat_update_rtmp_url()

void nim_vchat_update_rtmp_url ( const char *  rtmp_url,
const char *  json_extension,
nim_vchat_opt_cb_func  cb,
const void *  user_data 
)

NIM 通话中修改直播推流地址(主播有效)

参数
[in]rtmp_url新的rtmp推流地址
[in]json_extension无效扩展字段
[in]cb结果回调见nim_vchat_def.h,返回的json_extension无效
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 0:成功 11403:无效的操作