mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
转协议选项抽象为ProtocolOption对象
This commit is contained in:
@@ -104,9 +104,7 @@ API_EXPORT void API_CALL mk_events_listen(const mk_events *events){
|
||||
(mk_publish_auth_invoker) &invoker,
|
||||
(mk_sock_info) &sender);
|
||||
} else {
|
||||
GET_CONFIG(bool, toHls, General::kPublishToHls);
|
||||
GET_CONFIG(bool, toMP4, General::kPublishToMP4);
|
||||
invoker("", toHls, toMP4);
|
||||
invoker("", ProtocolOption());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -400,7 +400,10 @@ API_EXPORT void API_CALL mk_publish_auth_invoker_do(const mk_publish_auth_invoke
|
||||
int enable_mp4){
|
||||
assert(ctx);
|
||||
Broadcast::PublishAuthInvoker *invoker = (Broadcast::PublishAuthInvoker *)ctx;
|
||||
(*invoker)(err_msg ? err_msg : "", enable_hls, enable_mp4);
|
||||
ProtocolOption option;
|
||||
option.enable_hls = enable_hls;
|
||||
option.enable_mp4 = enable_mp4;
|
||||
(*invoker)(err_msg ? err_msg : "", option);
|
||||
}
|
||||
|
||||
API_EXPORT mk_publish_auth_invoker API_CALL mk_publish_auth_invoker_clone(const mk_publish_auth_invoker ctx){
|
||||
|
||||
@@ -163,7 +163,11 @@ API_EXPORT int API_CALL mk_media_total_reader_count(mk_media ctx){
|
||||
API_EXPORT mk_media API_CALL mk_media_create(const char *vhost, const char *app, const char *stream,
|
||||
float duration, int hls_enabled, int mp4_enabled) {
|
||||
assert(vhost && app && stream);
|
||||
MediaHelper::Ptr *obj(new MediaHelper::Ptr(new MediaHelper(vhost, app, stream, duration, hls_enabled, mp4_enabled)));
|
||||
ProtocolOption option;
|
||||
option.enable_hls = hls_enabled;
|
||||
option.enable_mp4 = mp4_enabled;
|
||||
|
||||
MediaHelper::Ptr *obj(new MediaHelper::Ptr(new MediaHelper(vhost, app, stream, duration, option)));
|
||||
(*obj)->attachEvent();
|
||||
return (mk_media) obj;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,10 @@ 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) {
|
||||
assert(vhost && app && stream);
|
||||
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, hls_enabled, mp4_enabled)));
|
||||
ProtocolOption option;
|
||||
option.enable_hls = hls_enabled;
|
||||
option.enable_mp4 = mp4_enabled;
|
||||
PlayerProxy::Ptr *obj(new PlayerProxy::Ptr(new PlayerProxy(vhost, app, stream, option)));
|
||||
return (mk_proxy_player) obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user