From 84209bec2635fbec31d8a951a8ef5df7d849224f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=81=93=E7=94=AB?= Date: Wed, 29 May 2024 10:45:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85C=20API=E6=8B=89?= =?UTF-8?q?=E6=B5=81=E4=BB=A3=E7=90=86=E7=BC=BA=E5=B0=91retry=5Fcount?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E6=AC=A1=E6=95=B0=E9=85=8D=E7=BD=AE=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_common.h | 5 ++++- api/include/mk_proxyplayer.h | 4 ++-- api/source/mk_common.cpp | 2 +- api/source/mk_proxyplayer.cpp | 8 ++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/api/include/mk_common.h b/api/include/mk_common.h index b6f480cd..c2bf43bf 100755 --- a/api/include/mk_common.h +++ b/api/include/mk_common.h @@ -51,6 +51,9 @@ extern "C" { //输出日志到回调函数(mk_events::on_mk_log) #define LOG_CALLBACK (1 << 2) +//向下兼容 +#define mk_env_init1 mk_env_init2 + //回调user_data回调函数 typedef void(API_CALL *on_user_data_free)(void *user_data); @@ -104,7 +107,7 @@ API_EXPORT void API_CALL mk_stop_all_server(); * @param ssl ssl证书内容或路径,可以为NULL * @param ssl_pwd 证书密码,可以为NULL */ -API_EXPORT void API_CALL mk_env_init1(int thread_num, +API_EXPORT void API_CALL mk_env_init2(int thread_num, int log_level, int log_mask, const char *log_file_path, diff --git a/api/include/mk_proxyplayer.h b/api/include/mk_proxyplayer.h index 4a00702d..ab424d42 100644 --- a/api/include/mk_proxyplayer.h +++ b/api/include/mk_proxyplayer.h @@ -44,7 +44,7 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create(const char *vhost, co * @param retry_count 重试次数,当<0无限次重试 * @return 对象指针 */ -API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create1(const char *vhost, const char *app, const char *stream, int hls_enabled, int mp4_enabled, int retry_count); +API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create3(const char *vhost, const char *app, const char *stream, int hls_enabled, int mp4_enabled, int retry_count); /** * 创建一个代理播放器 @@ -66,7 +66,7 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create2(const char *vhost, c * @param retry_count 重试次数,当<0无限次重试 * @return 对象指针 */ -API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create3(const char *vhost, const char *app, const char *stream, mk_ini option, int retry_count); +API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create4(const char *vhost, const char *app, const char *stream, mk_ini option, int retry_count); /** diff --git a/api/source/mk_common.cpp b/api/source/mk_common.cpp index 48efeb1d..335cd467 100644 --- a/api/source/mk_common.cpp +++ b/api/source/mk_common.cpp @@ -83,7 +83,7 @@ API_EXPORT void API_CALL mk_stop_all_server(){ stopAllTcpServer(); } -API_EXPORT void API_CALL mk_env_init1(int thread_num, +API_EXPORT void API_CALL mk_env_init2(int thread_num, int log_level, int log_mask, const char *log_file_path, diff --git a/api/source/mk_proxyplayer.cpp b/api/source/mk_proxyplayer.cpp index 47ab8249..2be5ca17 100644 --- a/api/source/mk_proxyplayer.cpp +++ b/api/source/mk_proxyplayer.cpp @@ -16,10 +16,10 @@ using namespace toolkit; using namespace mediakit; API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create(const char *vhost, const char *app, const char *stream, int hls_enabled, int mp4_enabled) { - return mk_proxy_player_create1(vhost, app, stream, hls_enabled, mp4_enabled,-1); + return mk_proxy_player_create3(vhost, app, stream, hls_enabled, mp4_enabled,-1); } -API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create1(const char *vhost, const char *app, const char *stream, int hls_enabled, int mp4_enabled, int retry_count) { +API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create3(const char *vhost, const char *app, const char *stream, int hls_enabled, int mp4_enabled, int retry_count) { assert(vhost && app && stream); ProtocolOption option; option.enable_hls = hls_enabled; @@ -29,11 +29,11 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create1(const char *vhost, c } API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create2(const char *vhost, const char *app, const char *stream, mk_ini ini) { - return mk_proxy_player_create3(vhost, app, stream, ini, -1); + return mk_proxy_player_create4(vhost, app, stream, ini, -1); } -API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create3(const char *vhost, const char *app, const char *stream, mk_ini ini, int retry_count) { +API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create4(const char *vhost, const char *app, const char *stream, mk_ini ini, int retry_count) { assert(vhost && app && stream); ProtocolOption option(*((mINI *)ini)); PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option, retry_count)));