165 lines
10 KiB
C
165 lines
10 KiB
C
#ifndef NIM_SDK_API_H_
|
||
#define NIM_SDK_API_H_
|
||
|
||
#include "export_headers/nim_client_def.h"
|
||
#include "export_headers/nim_vchat_def.h"
|
||
#include "export_headers/nim_device_def.h"
|
||
|
||
|
||
typedef bool(*nim_client_init)(const char *app_data_dir, const char *app_install_dir, const char *json_extension);
|
||
typedef void(*nim_client_cleanup)(const char *json_extension);
|
||
typedef void(*nim_client_login)(const char *app_token, const char *account, const char *password, const char *json_extension, nim_json_transport_cb_func cb, const void* user_data);
|
||
typedef void(*nim_client_relogin)(const char *json_extension);
|
||
typedef void(*nim_client_logout)(enum NIMLogoutType logout_type, const char *json_extension, nim_json_transport_cb_func cb, const void* user_data);
|
||
typedef void(*nim_client_kick_other_client)(const char *json_extension);
|
||
typedef void(*nim_client_reg_auto_relogin_cb)(const char *json_extension, nim_json_transport_cb_func cb, const void* user_data);
|
||
typedef void(*nim_client_reg_kickout_cb)(const char *json_extension, nim_json_transport_cb_func cb, const void* user_data);
|
||
typedef void(*nim_client_reg_disconnect_cb)(const char *json_extension, nim_json_transport_cb_func cb, const void* user_data);
|
||
typedef void(*nim_client_reg_multispot_login_notify_cb)(const char *json_extension, nim_json_transport_cb_func cb, const void *user_data);
|
||
typedef void(*nim_client_reg_kickout_other_client_cb)(const char *json_extension, nim_json_transport_cb_func cb, const void *user_data);
|
||
typedef void(*nim_client_reg_sync_multiport_push_config_cb)(const char *json_extension, nim_client_multiport_push_config_cb_func cb, const void *user_data);
|
||
typedef void(*nim_client_set_multiport_push_config)(const char *switch_content, const char *json_extension, nim_client_multiport_push_config_cb_func cb, const void *user_data);
|
||
typedef void(*nim_client_get_multiport_push_config)(const char *json_extension, nim_client_multiport_push_config_cb_func cb, const void *user_data);
|
||
typedef const char*(*nim_tool_get_uuid)();
|
||
|
||
//ÔÆÐÅÒôÊÓƵ
|
||
typedef bool(*nim_vchat_init)(const char *json_extension);
|
||
typedef void(*nim_vchat_cleanup)(const char *json_extension);
|
||
|
||
typedef void(*nim_vchat_enum_device_devpath)(enum NIMDeviceType type, const char *json_extension, nim_vchat_enum_device_devpath_sync_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_start_device)(enum NIMDeviceType type, const char* device_path, unsigned fps, const char* json_extension, nim_vchat_start_device_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_end_device)(enum NIMDeviceType type, const char *json_extension);
|
||
typedef void(*nim_vchat_add_device_status_cb)(enum NIMDeviceType type, nim_vchat_device_status_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_remove_device_status_cb)(enum NIMDeviceType type);
|
||
typedef void(*nim_vchat_start_extend_camera)(const char *id, const char *device_path, unsigned fps, const char *json_extension, nim_vchat_start_device_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_stop_extend_camera)(const char *id, const char *json_extension);
|
||
|
||
typedef void(*nim_vchat_set_audio_data_cb)(bool capture, const char* json_extension, nim_vchat_audio_data_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_set_video_data_cb)(bool capture, const char* json_extension, nim_vchat_video_data_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_set_audio_volumn)(unsigned char volumn, bool capture);
|
||
typedef unsigned char(*nim_vchat_get_audio_volumn)(bool capture);
|
||
typedef void(*nim_vchat_set_audio_input_auto_volumn)(bool auto_volumn);
|
||
typedef bool(*nim_vchat_get_audio_input_auto_volumn)();
|
||
|
||
//ÉèÖûصô
|
||
typedef void(*nim_vchat_set_cb_func)(nim_vchat_cb_func cb, const void *user_data);
|
||
//Æô¶¯Í¨»°
|
||
//json_info ¼ûnim_vchat_def.h
|
||
typedef bool(*nim_vchat_start)(enum NIMVideoChatMode mode, const char* apns_text, const char* custom_info, const char* json_extension, const void *user_data);
|
||
//ÉèÖÃͨ»°Ä£Ê½
|
||
typedef bool(*nim_vchat_set_talking_mode)(enum NIMVideoChatMode mode, const char* json_extension);
|
||
//»ØÓ¦ÑûÇë
|
||
typedef bool(*nim_vchat_callee_ack)(int64_t channel_id, bool accept, const char* json_extension, const void *user_data);
|
||
//ͨ»°¿ØÖÆ
|
||
typedef bool(*nim_vchat_control)(int64_t channel_id, enum NIMVChatControlType type, const char* json_extension, const void *user_data);
|
||
//¿ªÊ¼Â¼ÖÆMP4Îļþ£¬Ò»´ÎÖ»ÔÊÐíÒ»¸ö¼ÖÆÎļþ£¬ÔÚͨ»°¿ªÊ¼µÄʱºò²ÅÓÐʵ¼ÊÊý¾Ý
|
||
typedef void(*nim_vchat_start_record)(const char *path, const char *json_extension, nim_vchat_mp4_record_opt_cb_func cb, const void *user_data);
|
||
//ֹͣ¼ÖÆMP4Îļþ
|
||
typedef void(*nim_vchat_stop_record)(const char *json_extension, nim_vchat_mp4_record_opt_cb_func cb, const void *user_data);
|
||
//½áÊøͨ»°
|
||
typedef void(*nim_vchat_end)(const char* json_extension);
|
||
//×Ô¶¨ÒåÊÓƵÊý¾Ý
|
||
typedef bool(*nim_vchat_custom_video_data)(uint64_t time, const char *data, unsigned int size, unsigned int width, unsigned int height, const char *json_extension);
|
||
|
||
//×Ô¶¨ÒåÒôƵÊý¾Ý
|
||
typedef bool(*nim_vchat_custom_audio_data)(uint64_t time, const char* data, unsigned int size, const char* json_extension);
|
||
|
||
|
||
//NIM ͨ»°ÖÐÐ޸ķֱæÂÊ
|
||
typedef void(*nim_vchat_set_video_quality)(int video_quality, const char *json_extension, nim_vchat_opt_cb_func cb, const void* user_data);
|
||
typedef void(*nim_vchat_set_video_bitrate)(int video_bitrate, const char *json_extension, nim_vchat_opt_cb_func cb, const void* user_data);
|
||
typedef 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 ͨ»°ÖÐÐÞ¸Ä×Ô¶¨ÒåÒôÊÓƵÊý¾Ýģʽ
|
||
typedef 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);
|
||
|
||
/** @fn void nim_vchat_set_viewer_mode(bool viewer)
|
||
* NIM VCHAT ÉèÖùÛÖÚģʽ£¨¶àÈËģʽÏ£©£¬È«¾ÖÓÐЧ£¨ÖØз¢ÆðʱҲÉúЧ£©£¬¹ÛÖÚģʽÄܼõÉÙÔËÐпªÏú
|
||
* @param[in] viewer ÊÇ·ñ¹ÛÖÚģʽ
|
||
* @return void ÎÞ·µ»ØÖµ
|
||
*/
|
||
typedef void(*nim_vchat_set_viewer_mode)(bool viewer);
|
||
|
||
/** @fn bool nim_vchat_get_viewer_mode()
|
||
* NIM VCHAT »ñÈ¡µ±Ç°ÊÇ·ñÊǹÛÖÚģʽ
|
||
* @return bool true ¹ÛÖÚģʽ£¬false ·Ç¹ÛÖÚģʽ
|
||
*/
|
||
typedef bool(*nim_vchat_get_viewer_mode)();
|
||
|
||
/** @fn void nim_vchat_set_audio_mute(bool muted)
|
||
* NIM VCHAT ÉèÖÃÒôƵ¾²Òô£¬È«¾ÖÓÐЧ£¨ÖØз¢ÆðʱҲÉúЧ£©
|
||
* @param[in] muted true ¾²Òô£¬false ²»¾²Òô
|
||
* @return void ÎÞ·µ»ØÖµ
|
||
*/
|
||
typedef void(*nim_vchat_set_audio_mute)(bool muted);
|
||
|
||
/** @fn bool nim_vchat_audio_mute_enabled()
|
||
* NIM VCHAT »ñÈ¡ÒôƵ¾²Òô״̬
|
||
* @return bool true ¾²Òô£¬false ²»¾²Òô
|
||
*/
|
||
typedef bool(*nim_vchat_audio_mute_enabled)();
|
||
|
||
/** @fn void nim_vchat_set_rotate_remote_video(bool rotate)
|
||
* NIM VCHAT ÉèÖò»×Ô¶¯Ðýת¶Ô·½»Ã棬ĬÈÏ´ò¿ª£¬È«¾ÖÓÐЧ£¨ÖØз¢ÆðʱҲÉúЧ£©
|
||
* @param[in] rotate true ×Ô¶¯Ðýת£¬false ²»Ðýת
|
||
* @return void ÎÞ·µ»ØÖµ
|
||
*/
|
||
typedef void(*nim_vchat_set_rotate_remote_video)(bool rotate);
|
||
|
||
/** @fn bool nim_vchat_rotate_remote_video_enabled()
|
||
* NIM VCHAT »ñÈ¡×Ô¶¯Ðýת¶Ô·½»ÃæÉèÖÃ״̬
|
||
* @return bool true ×Ô¶¯Ðýת£¬false ²»Ðýת
|
||
*/
|
||
typedef bool(*nim_vchat_rotate_remote_video_enabled)();
|
||
|
||
/** @fn 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 ÉèÖõ¥¸ö³ÉÔ±µÄºÚÃûµ¥×´Ì¬£¬µ±Ç°Í¨»°ÓÐЧ(Ö»ÄÜÉèÖýøÈë¹ý·¿¼äµÄ³ÉÔ±)
|
||
* @param[in] uid ³ÉÔ±account
|
||
* @param[in] add true±íʾÌí¼Óµ½ºÚÃûµ¥£¬false±íʾ´ÓºÚÃûµ¥ÒƳý
|
||
* @param[in] audio true±íʾÒôƵºÚÃûµ¥£¬false±íʾÊÓƵºÚÃûµ¥
|
||
* @param[in] json_extension ÎÞЧÀ©Õ¹×Ö¶Î
|
||
* @param[in] cb ½á¹û»Øµ÷¼ûnim_vchat_def.h£¬·µ»ØµÄjson_extensionÎÞЧ
|
||
* @param[in] user_data APPµÄ×Ô¶¨ÒåÓû§Êý¾Ý£¬SDKÖ»¸ºÔ𴫻ظø»Øµ÷º¯Êýcb£¬²»×öÈκδ¦Àí£¡
|
||
* @return void ÎÞ·µ»ØÖµ
|
||
*/
|
||
typedef 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);
|
||
|
||
/** @fn void nim_vchat_create_room(const char *room_name, const char *custom_info, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
|
||
* NIM VCHAT ´´½¨Ò»¸ö¶àÈË·¿¼ä£¨ºóÐøÐèÒªÖ÷¶¯µ÷ÓüÓÈë½Ó¿Ú½øÈë·¿¼ä£©
|
||
* @param[in] room_name ·¿¼äÃû
|
||
* @param[in] custom_info ×Ô¶¨ÒåµÄ·¿¼äÐÅÏ¢£¨¼ÓÈë·¿¼äµÄʱºò»á·µ»Ø£©
|
||
* @param[in] json_extension ÎÞЧÀ©Õ¹×Ö¶Î
|
||
* @param[in] cb ½á¹û»Øµ÷¼ûnim_vchat_def.h£¬·µ»ØµÄjson_extensionÎÞЧ
|
||
* @param[in] user_data APPµÄ×Ô¶¨ÒåÓû§Êý¾Ý£¬SDKÖ»¸ºÔ𴫻ظø»Øµ÷º¯Êýcb£¬²»×öÈκδ¦Àí£¡
|
||
* @return void ÎÞ·µ»ØÖµ
|
||
*/
|
||
typedef 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);
|
||
|
||
/** @fn bool nim_vchat_join_room(const char *room_name, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data)
|
||
* NIM VCHAT ¼ÓÈëÒ»¸ö¶àÈË·¿¼ä£¨½øÈë·¿¼äºó³ÉÔ±±ä»¯µÈ£¬µÈͬµã¶Ôµãnim_vchat_cb_func£©
|
||
* @param[in] mode NIMVideoChatMode ÒôÊÓƵͨ»°ÀàÐÍ ¼ûnim_vchat_def.h
|
||
* @param[in] room_name ·¿¼äÃû
|
||
* @param[in] json_extension ¿ÉÑ¡ Èç{"custom_video":0, "custom_audio":0, "video_quality":0, "session_id":"1231sda"}
|
||
* @param[in] cb ½á¹û»Øµ÷¼ûnim_vchat_def.h£¬·µ»ØµÄjson_extensionÀ©Õ¹×Ö¶ÎÖаüº¬ kNIMVChatCustomInfo,kNIMVChatSessionId
|
||
* @param[in] user_data APPµÄ×Ô¶¨ÒåÓû§Êý¾Ý£¬SDKÖ»¸ºÔ𴫻ظø»Øµ÷º¯Êýcb£¬²»×öÈκδ¦Àí£¡
|
||
* @return bool true µ÷Óóɹ¦£¬false µ÷ÓÃʧ°Ü¿ÉÄÜÓÐÕýÔÚ½øÐеÄͨ»°
|
||
*/
|
||
typedef 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);
|
||
|
||
/** @fn 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 ͨ»°ÖÐÐÞ¸ÄÖ±²¥ÍÆÁ÷µØÖ·£¨Ö÷²¥ÓÐЧ£©
|
||
* @param[in] rtmp_url еÄrtmpÍÆÁ÷µØÖ·
|
||
* @param[in] json_extension ÎÞЧÀ©Õ¹×Ö¶Î
|
||
* @param[in] cb ½á¹û»Øµ÷¼ûnim_vchat_def.h£¬·µ»ØµÄjson_extensionÎÞЧ
|
||
* @param[in] user_data APPµÄ×Ô¶¨ÒåÓû§Êý¾Ý£¬SDKÖ»¸ºÔ𴫻ظø»Øµ÷º¯Êýcb£¬²»×öÈκδ¦Àí£¡
|
||
* @return void ÎÞ·µ»ØÖµ
|
||
*/
|
||
typedef void(*nim_vchat_update_rtmp_url)(const char *rtmp_url, const char *json_extension, nim_vchat_opt_cb_func cb, const void *user_data);
|
||
typedef void(*nim_vchat_set_streaming_mode)(bool streaming, const char* json_info, nim_vchat_opt_cb_func cb, const void *user_data);
|
||
|
||
typedef void(*nim_vchat_set_audio_volumn)(unsigned char volumn, bool capture);
|
||
typedef unsigned char(*nim_vchat_get_audio_volumn)(bool capture);
|
||
|
||
typedef 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);
|
||
#endif
|