feat: 补充C API拉流代理缺少retry_count重试次数配置

This commit is contained in:
李道甫 2024-05-29 09:48:57 +08:00
parent 0de114c3b9
commit 0859ff6909
2 changed files with 44 additions and 0 deletions

View File

@ -32,6 +32,21 @@ 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);
/**
*
* @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_create1(
const char *vhost, const char *app, const char *stream, int hls_enabled, int mp4_enabled, int retry_count);
/**
*
* @param vhost __defaultVhost__
@ -43,6 +58,19 @@ 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);
/**
*
* @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_create3(const char *vhost, const char *app, const char *stream, mk_ini option, int retry_count);
/**
*
* @param ctx

View File

@ -24,6 +24,15 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create(const char *vhost, co
return (mk_proxy_player) obj;
}
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) {
assert(vhost && app && stream);
ProtocolOption option;
option.enable_hls = hls_enabled;
option.enable_mp4 = mp4_enabled;
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option, retry_count)));
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) {
assert(vhost && app && stream);
ProtocolOption option(*((mINI *)ini));
@ -32,6 +41,13 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create2(const char *vhost, c
}
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) {
assert(vhost && app && stream);
ProtocolOption option(*((mINI *)ini));
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option, retry_count)));
return (mk_proxy_player)obj;
}
API_EXPORT void API_CALL mk_proxy_player_release(mk_proxy_player ctx) {
assert(ctx);
PlayerProxy::Ptr *obj = (PlayerProxy::Ptr *) ctx;