From f6b6fe04cde229aa55e84c02ac272c8fbd93ad60 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 12 Nov 2023 21:14:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Emk=5Fpublish=5Fauth=5Finvoker?= =?UTF-8?q?=5Fdo2=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=94=AF=E6=8C=81=E7=B2=BE?= =?UTF-8?q?=E7=BB=86=E5=8C=96=E6=8E=A7=E5=88=B6=E6=8E=A8=E6=B5=81=E8=BD=AC?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_events_objects.h | 3 +++ api/source/mk_events_objects.cpp | 7 +++++++ 2 files changed, 10 insertions(+) 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;