diff --git a/api/include/mk_events_objects.h b/api/include/mk_events_objects.h index 3dc9a2c3..624970f3 100644 --- a/api/include/mk_events_objects.h +++ b/api/include/mk_events_objects.h @@ -13,6 +13,7 @@ #include "mk_common.h" #include "mk_tcp.h" #include "mk_track.h" +#include "mk_util.h" #ifdef __cplusplus extern "C" { #endif @@ -317,6 +318,8 @@ API_EXPORT void API_CALL mk_publish_auth_invoker_do(const mk_publish_auth_invoke int enable_hls, int enable_mp4); +API_EXPORT void API_CALL mk_publish_auth_invoker_do2(const mk_publish_auth_invoker ctx, const char *err_msg, mk_ini option); + /** * 克隆mk_publish_auth_invoker对象,通过克隆对象为堆对象,可以实现跨线程异步执行mk_publish_auth_invoker_do * 如果是同步执行mk_publish_auth_invoker_do,那么没必要克隆对象 diff --git a/api/source/mk_events_objects.cpp b/api/source/mk_events_objects.cpp index 3833017f..5dacafb4 100644 --- a/api/source/mk_events_objects.cpp +++ b/api/source/mk_events_objects.cpp @@ -461,6 +461,13 @@ API_EXPORT void API_CALL mk_publish_auth_invoker_do(const mk_publish_auth_invoke (*invoker)(err_msg ? err_msg : "", option); } +API_EXPORT void API_CALL mk_publish_auth_invoker_do2(const mk_publish_auth_invoker ctx, const char *err_msg, mk_ini ini) { + assert(ctx); + Broadcast::PublishAuthInvoker *invoker = (Broadcast::PublishAuthInvoker *)ctx; + ProtocolOption option(ini ? *((mINI *)ini) : mINI{} ); + (*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){ assert(ctx); Broadcast::PublishAuthInvoker *invoker = (Broadcast::PublishAuthInvoker *)ctx;