mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-01 23:57:37 +08:00
完善c sdk对象描述元信息,防止隐式指针转换错误
void* 类型指针很容易存在隐式转换错误,用户无法察觉
This commit is contained in:
@@ -18,7 +18,7 @@ extern "C" {
|
||||
|
||||
///////////////////////////////////////////MP4Info/////////////////////////////////////////////
|
||||
//MP4Info对象的C映射
|
||||
typedef void* mk_mp4_info;
|
||||
typedef struct mk_mp4_info_t *mk_mp4_info;
|
||||
// GMT 标准时间,单位秒
|
||||
API_EXPORT uint64_t API_CALL mk_mp4_info_get_start_time(const mk_mp4_info ctx);
|
||||
// 录像长度,单位秒
|
||||
@@ -42,7 +42,7 @@ API_EXPORT const char* API_CALL mk_mp4_info_get_stream(const mk_mp4_info ctx);
|
||||
|
||||
///////////////////////////////////////////Parser/////////////////////////////////////////////
|
||||
//Parser对象的C映射
|
||||
typedef void* mk_parser;
|
||||
typedef struct mk_parser_t *mk_parser;
|
||||
//Parser::Method(),获取命令字,譬如GET/POST
|
||||
API_EXPORT const char* API_CALL mk_parser_get_method(const mk_parser ctx);
|
||||
//Parser::Url(),获取HTTP的访问url(不包括?后面的参数)
|
||||
@@ -60,7 +60,7 @@ API_EXPORT const char* API_CALL mk_parser_get_content(const mk_parser ctx, size_
|
||||
|
||||
///////////////////////////////////////////MediaInfo/////////////////////////////////////////////
|
||||
//MediaInfo对象的C映射
|
||||
typedef void* mk_media_info;
|
||||
typedef struct mk_media_info_t *mk_media_info;
|
||||
//MediaInfo::_param_strs
|
||||
API_EXPORT const char* API_CALL mk_media_info_get_params(const mk_media_info ctx);
|
||||
//MediaInfo::_schema
|
||||
@@ -79,7 +79,7 @@ API_EXPORT uint16_t API_CALL mk_media_info_get_port(const mk_media_info ctx);
|
||||
|
||||
///////////////////////////////////////////MediaSource/////////////////////////////////////////////
|
||||
//MediaSource对象的C映射
|
||||
typedef void* mk_media_source;
|
||||
typedef struct mk_media_source_t *mk_media_source;
|
||||
//查找MediaSource的回调函数
|
||||
typedef void(API_CALL *on_mk_media_source_find_cb)(void *user_data, const mk_media_source ctx);
|
||||
|
||||
@@ -138,7 +138,7 @@ API_EXPORT void API_CALL mk_media_source_for_each(void *user_data, on_mk_media_s
|
||||
|
||||
///////////////////////////////////////////HttpBody/////////////////////////////////////////////
|
||||
//HttpBody对象的C映射
|
||||
typedef void* mk_http_body;
|
||||
typedef struct mk_http_body_t *mk_http_body;
|
||||
/**
|
||||
* 生成HttpStringBody
|
||||
* @param str 字符串指针
|
||||
@@ -173,7 +173,7 @@ API_EXPORT void API_CALL mk_http_body_release(mk_http_body ctx);
|
||||
|
||||
///////////////////////////////////////////HttpResponseInvoker/////////////////////////////////////////////
|
||||
//HttpSession::HttpResponseInvoker对象的C映射
|
||||
typedef void* mk_http_response_invoker;
|
||||
typedef struct mk_http_response_invoker_t *mk_http_response_invoker;
|
||||
|
||||
/**
|
||||
* HttpSession::HttpResponseInvoker(const string &codeOut, const StrCaseMap &headerOut, const HttpBody::Ptr &body);
|
||||
@@ -219,7 +219,8 @@ API_EXPORT void API_CALL mk_http_response_invoker_clone_release(const mk_http_re
|
||||
|
||||
///////////////////////////////////////////HttpAccessPathInvoker/////////////////////////////////////////////
|
||||
//HttpSession::HttpAccessPathInvoker对象的C映射
|
||||
typedef void* mk_http_access_path_invoker;
|
||||
typedef struct mk_http_access_path_invoker_t *mk_http_access_path_invoker;
|
||||
|
||||
/**
|
||||
* HttpSession::HttpAccessPathInvoker(const string &errMsg,const string &accessPath, int cookieLifeSecond);
|
||||
* @param err_msg 如果为空,则代表鉴权通过,否则为错误提示,可以为null
|
||||
@@ -244,7 +245,7 @@ API_EXPORT void API_CALL mk_http_access_path_invoker_clone_release(const mk_http
|
||||
|
||||
///////////////////////////////////////////RtspSession::onGetRealm/////////////////////////////////////////////
|
||||
//RtspSession::onGetRealm对象的C映射
|
||||
typedef void* mk_rtsp_get_realm_invoker;
|
||||
typedef struct mk_rtsp_get_realm_invoker_t *mk_rtsp_get_realm_invoker;
|
||||
/**
|
||||
* 执行RtspSession::onGetRealm
|
||||
* @param realm 该rtsp流是否需要开启rtsp专属鉴权,至null或空字符串则不鉴权
|
||||
@@ -265,7 +266,7 @@ API_EXPORT void API_CALL mk_rtsp_get_realm_invoker_clone_release(const mk_rtsp_g
|
||||
|
||||
///////////////////////////////////////////RtspSession::onAuth/////////////////////////////////////////////
|
||||
//RtspSession::onAuth对象的C映射
|
||||
typedef void* mk_rtsp_auth_invoker;
|
||||
typedef struct mk_rtsp_auth_invoker_t *mk_rtsp_auth_invoker;
|
||||
|
||||
/**
|
||||
* 执行RtspSession::onAuth
|
||||
@@ -289,7 +290,7 @@ API_EXPORT void API_CALL mk_rtsp_auth_invoker_clone_release(const mk_rtsp_auth_i
|
||||
|
||||
///////////////////////////////////////////Broadcast::PublishAuthInvoker/////////////////////////////////////////////
|
||||
//Broadcast::PublishAuthInvoker对象的C映射
|
||||
typedef void* mk_publish_auth_invoker;
|
||||
typedef struct mk_publish_auth_invoker_t *mk_publish_auth_invoker;
|
||||
|
||||
/**
|
||||
* 执行Broadcast::PublishAuthInvoker
|
||||
@@ -315,7 +316,7 @@ API_EXPORT void API_CALL mk_publish_auth_invoker_clone_release(const mk_publish_
|
||||
|
||||
///////////////////////////////////////////Broadcast::AuthInvoker/////////////////////////////////////////////
|
||||
//Broadcast::AuthInvoker对象的C映射
|
||||
typedef void* mk_auth_invoker;
|
||||
typedef struct mk_auth_invoker_t *mk_auth_invoker;
|
||||
|
||||
/**
|
||||
* 执行Broadcast::AuthInvoker
|
||||
|
||||
@@ -39,7 +39,7 @@ API_EXPORT extern const int MKCodecVP9;
|
||||
API_EXPORT extern const int MKCodecAV1;
|
||||
API_EXPORT extern const int MKCodecJPEG;
|
||||
|
||||
typedef void *mk_frame;
|
||||
typedef struct mk_frame_t *mk_frame;
|
||||
|
||||
// 用户自定义free回调函数
|
||||
typedef void(API_CALL *on_mk_frame_data_release)(void *user_data, char *ptr);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *mk_h264_splitter;
|
||||
typedef struct mk_h264_splitter_t *mk_h264_splitter;
|
||||
|
||||
/**
|
||||
* h264 分帧器输出回调函数
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
|
||||
///////////////////////////////////////////HttpDownloader/////////////////////////////////////////////
|
||||
|
||||
typedef void *mk_http_downloader;
|
||||
typedef struct mk_http_downloader_t *mk_http_downloader;
|
||||
|
||||
/**
|
||||
* @param user_data 用户数据指针
|
||||
@@ -54,7 +54,7 @@ API_EXPORT void API_CALL mk_http_downloader_start(mk_http_downloader ctx, const
|
||||
API_EXPORT void API_CALL mk_http_downloader_start2(mk_http_downloader ctx, const char *url, const char *file, on_mk_download_complete cb, void *user_data, on_user_data_free user_data_free);
|
||||
|
||||
///////////////////////////////////////////HttpRequester/////////////////////////////////////////////
|
||||
typedef void *mk_http_requester;
|
||||
typedef struct mk_http_requester_t *mk_http_requester;
|
||||
|
||||
/**
|
||||
* http请求结果回调
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *mk_media;
|
||||
typedef struct mk_media_t *mk_media;
|
||||
|
||||
/**
|
||||
* 创建一个媒体源
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void* mk_player;
|
||||
typedef struct mk_player_t *mk_player;
|
||||
|
||||
/**
|
||||
* 播放结果或播放中断事件的回调
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *mk_proxy_player;
|
||||
typedef struct mk_proxy_player_t *mk_proxy_player;
|
||||
|
||||
/**
|
||||
* 创建一个代理播放器
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void* mk_pusher;
|
||||
typedef struct mk_pusher_t *mk_pusher;
|
||||
|
||||
/**
|
||||
* 推流结果或推流中断事件的回调
|
||||
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
|
||||
///////////////////////////////////////////flv录制/////////////////////////////////////////////
|
||||
|
||||
typedef void* mk_flv_recorder;
|
||||
typedef struct mk_flv_recorder_t *mk_flv_recorder;
|
||||
|
||||
/**
|
||||
* 创建flv录制器
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void* mk_rtp_server;
|
||||
typedef struct mk_rtp_server_t *mk_rtp_server;
|
||||
|
||||
/**
|
||||
* 创建GB28181 RTP 服务器
|
||||
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
|
||||
///////////////////////////////////////////Buffer::Ptr/////////////////////////////////////////////
|
||||
|
||||
typedef void *mk_buffer;
|
||||
typedef struct mk_buffer_t *mk_buffer;
|
||||
typedef void(API_CALL *on_mk_buffer_free)(void *user_data, void *data);
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ API_EXPORT size_t API_CALL mk_buffer_get_size(mk_buffer buffer);
|
||||
|
||||
///////////////////////////////////////////SockInfo/////////////////////////////////////////////
|
||||
//SockInfo对象的C映射
|
||||
typedef void* mk_sock_info;
|
||||
typedef struct mk_sock_info_t *mk_sock_info;
|
||||
|
||||
//SockInfo::get_peer_ip()
|
||||
API_EXPORT const char* API_CALL mk_sock_info_peer_ip(const mk_sock_info ctx, char *buf);
|
||||
@@ -66,8 +66,8 @@ API_EXPORT uint16_t API_CALL mk_sock_info_local_port(const mk_sock_info ctx);
|
||||
#endif
|
||||
///////////////////////////////////////////TcpSession/////////////////////////////////////////////
|
||||
//TcpSession对象的C映射
|
||||
typedef void* mk_tcp_session;
|
||||
typedef void* mk_tcp_session_ref;
|
||||
typedef struct mk_tcp_session_t *mk_tcp_session;
|
||||
typedef struct mk_tcp_session_ref_t *mk_tcp_session_ref;
|
||||
|
||||
//获取基类指针以便获取其网络相关信息
|
||||
API_EXPORT mk_sock_info API_CALL mk_tcp_session_get_sock_info(const mk_tcp_session ctx);
|
||||
@@ -168,7 +168,7 @@ API_EXPORT void API_CALL mk_tcp_server_events_listen(const mk_tcp_session_events
|
||||
|
||||
///////////////////////////////////////////自定义tcp客户端/////////////////////////////////////////////
|
||||
|
||||
typedef void* mk_tcp_client;
|
||||
typedef struct mk_tcp_client_t *mk_tcp_client;
|
||||
//获取基类指针以便获取其网络相关信息
|
||||
API_EXPORT mk_sock_info API_CALL mk_tcp_client_get_sock_info(const mk_tcp_client ctx);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////事件线程/////////////////////////////////////////////
|
||||
typedef void* mk_thread;
|
||||
typedef struct mk_thread_t *mk_thread;
|
||||
|
||||
/**
|
||||
* 获取tcp会话对象所在事件线程
|
||||
@@ -52,7 +52,7 @@ API_EXPORT mk_thread API_CALL mk_thread_from_pool();
|
||||
*/
|
||||
API_EXPORT mk_thread API_CALL mk_thread_from_pool_work();
|
||||
|
||||
typedef void* mk_thread_pool;
|
||||
typedef struct mk_thread_pool_t *mk_thread_pool;
|
||||
|
||||
/**
|
||||
* 创建线程池
|
||||
@@ -108,7 +108,7 @@ API_EXPORT void API_CALL mk_async_do_delay2(mk_thread ctx, size_t ms, on_mk_asyn
|
||||
API_EXPORT void API_CALL mk_sync_do(mk_thread ctx, on_mk_async cb, void *user_data);
|
||||
|
||||
///////////////////////////////////////////定时器/////////////////////////////////////////////
|
||||
typedef void* mk_timer;
|
||||
typedef struct mk_timer_t *mk_timer;
|
||||
|
||||
/**
|
||||
* 定时器触发事件
|
||||
@@ -135,7 +135,7 @@ API_EXPORT void API_CALL mk_timer_release(mk_timer ctx);
|
||||
|
||||
///////////////////////////////////////////信号量/////////////////////////////////////////////
|
||||
|
||||
typedef void* mk_sem;
|
||||
typedef struct mk_sem_t *mk_sem;
|
||||
|
||||
/**
|
||||
* 创建信号量
|
||||
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
//音视频轨道
|
||||
typedef void* mk_track;
|
||||
typedef struct mk_track_t *mk_track;
|
||||
//输出frame回调
|
||||
typedef void(API_CALL *on_mk_frame_out)(void *user_data, mk_frame frame);
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
//解码器对象
|
||||
typedef void *mk_decoder;
|
||||
typedef struct mk_decoder_t *mk_decoder;
|
||||
//解码后的frame
|
||||
typedef void *mk_frame_pix;
|
||||
typedef struct mk_frame_pix_t *mk_frame_pix;
|
||||
//SwsContext的包装
|
||||
typedef void *mk_swscale;
|
||||
typedef struct mk_swscale_t *mk_swscale;
|
||||
//FFmpeg原始解码帧对象
|
||||
typedef struct AVFrame AVFrame;
|
||||
//FFmpeg编解码器对象
|
||||
|
||||
@@ -58,7 +58,7 @@ API_EXPORT char* API_CALL mk_util_get_current_time_string(const char *fmt);
|
||||
API_EXPORT char* API_CALL mk_util_hex_dump(const void *buf, int len);
|
||||
|
||||
///////////////////////////////////////////mk ini/////////////////////////////////////////////
|
||||
typedef void* mk_ini;
|
||||
typedef struct mk_ini_t *mk_ini;
|
||||
|
||||
/**
|
||||
* 创建ini配置对象
|
||||
|
||||
Reference in New Issue
Block a user