mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
补充C API拉流代理缺少retry_count重试次数配置 (#3584)
Co-authored-by: 李道甫 <lidf@ahtelit.com>
This commit is contained in:
parent
3a50c6e06d
commit
49dfccd56f
@ -51,6 +51,9 @@ extern "C" {
|
|||||||
//输出日志到回调函数(mk_events::on_mk_log)
|
//输出日志到回调函数(mk_events::on_mk_log)
|
||||||
#define LOG_CALLBACK (1 << 2)
|
#define LOG_CALLBACK (1 << 2)
|
||||||
|
|
||||||
|
//向下兼容
|
||||||
|
#define mk_env_init1 mk_env_init2
|
||||||
|
|
||||||
//回调user_data回调函数
|
//回调user_data回调函数
|
||||||
typedef void(API_CALL *on_user_data_free)(void *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 ssl证书内容或路径,可以为NULL
|
||||||
* @param ssl_pwd 证书密码,可以为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_level,
|
||||||
int log_mask,
|
int log_mask,
|
||||||
const char *log_file_path,
|
const char *log_file_path,
|
||||||
|
@ -32,6 +32,7 @@ typedef struct mk_proxy_player_t *mk_proxy_player;
|
|||||||
*/
|
*/
|
||||||
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);
|
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);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个代理播放器
|
* 创建一个代理播放器
|
||||||
* @param vhost 虚拟主机名,一般为__defaultVhost__
|
* @param vhost 虚拟主机名,一般为__defaultVhost__
|
||||||
@ -43,6 +44,32 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create(const char *vhost, co
|
|||||||
API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create2(const char *vhost, const char *app, const char *stream, mk_ini option);
|
API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create2(const char *vhost, const char *app, const char *stream, mk_ini option);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建一个代理播放器
|
||||||
|
* @param vhost 虚拟主机名,一般为__defaultVhost__
|
||||||
|
* @param app 应用名
|
||||||
|
* @param stream 流名
|
||||||
|
* @param rtp_type rtsp播放方式:RTP_TCP = 0, RTP_UDP = 1, RTP_MULTICAST = 2
|
||||||
|
* @param hls_enabled 是否生成hls
|
||||||
|
* @param mp4_enabled 是否生成mp4
|
||||||
|
* @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, int hls_enabled, int mp4_enabled, int retry_count);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建一个代理播放器
|
||||||
|
* @param vhost 虚拟主机名,一般为__defaultVhost__
|
||||||
|
* @param app 应用名
|
||||||
|
* @param stream 流名
|
||||||
|
* @param option ProtocolOption相关配置
|
||||||
|
* @param retry_count 重试次数,当<0无限次重试
|
||||||
|
* @return 对象指针
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 销毁代理播放器
|
* 销毁代理播放器
|
||||||
* @param ctx 对象指针
|
* @param ctx 对象指针
|
||||||
|
@ -83,7 +83,7 @@ API_EXPORT void API_CALL mk_stop_all_server(){
|
|||||||
stopAllTcpServer();
|
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_level,
|
||||||
int log_mask,
|
int log_mask,
|
||||||
const char *log_file_path,
|
const char *log_file_path,
|
||||||
|
@ -16,22 +16,30 @@ using namespace toolkit;
|
|||||||
using namespace mediakit;
|
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) {
|
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_create3(vhost, app, stream, hls_enabled, mp4_enabled,-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
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_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, int hls_enabled, int mp4_enabled, int retry_count) {
|
||||||
assert(vhost && app && stream);
|
assert(vhost && app && stream);
|
||||||
ProtocolOption option;
|
ProtocolOption option;
|
||||||
option.enable_hls = hls_enabled;
|
option.enable_hls = hls_enabled;
|
||||||
option.enable_mp4 = mp4_enabled;
|
option.enable_mp4 = mp4_enabled;
|
||||||
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option)));
|
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option, retry_count)));
|
||||||
return (mk_proxy_player)obj;
|
return (mk_proxy_player)obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create2(const char *vhost, const char *app, const char *stream, mk_ini ini) {
|
|
||||||
|
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);
|
assert(vhost && app && stream);
|
||||||
ProtocolOption option(*((mINI *)ini));
|
ProtocolOption option(*((mINI *)ini));
|
||||||
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option)));
|
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option, retry_count)));
|
||||||
return (mk_proxy_player)obj;
|
return (mk_proxy_player)obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
API_EXPORT void API_CALL mk_proxy_player_release(mk_proxy_player ctx) {
|
API_EXPORT void API_CALL mk_proxy_player_release(mk_proxy_player ctx) {
|
||||||
assert(ctx);
|
assert(ctx);
|
||||||
PlayerProxy::Ptr *obj = (PlayerProxy::Ptr *) ctx;
|
PlayerProxy::Ptr *obj = (PlayerProxy::Ptr *) ctx;
|
||||||
|
Loading…
Reference in New Issue
Block a user