From 936babf4599e619b4dc721a0dc75562ddd67481c Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Thu, 25 May 2023 16:57:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Emk=5Fmedia=5Fsource=5Ffind2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_events_objects.h | 6 ++++++ api/source/mk_events_objects.cpp | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/api/include/mk_events_objects.h b/api/include/mk_events_objects.h index f8d3c571..8f362980 100644 --- a/api/include/mk_events_objects.h +++ b/api/include/mk_events_objects.h @@ -132,6 +132,12 @@ API_EXPORT void API_CALL mk_media_source_find(const char *schema, int from_mp4, void *user_data, on_mk_media_source_find_cb cb); + +API_EXPORT const mk_media_source API_CALL mk_media_source_find2(const char *schema, + const char *vhost, + const char *app, + const char *stream, + int from_mp4); //MediaSource::for_each_media() API_EXPORT void API_CALL mk_media_source_for_each(void *user_data, on_mk_media_source_find_cb cb, const char *schema, const char *vhost, const char *app, const char *stream); diff --git a/api/source/mk_events_objects.cpp b/api/source/mk_events_objects.cpp index 4b641a2b..fa820062 100644 --- a/api/source/mk_events_objects.cpp +++ b/api/source/mk_events_objects.cpp @@ -248,6 +248,16 @@ API_EXPORT void API_CALL mk_media_source_find(const char *schema, cb(user_data, (mk_media_source)src.get()); } +API_EXPORT const mk_media_source API_CALL mk_media_source_find2(const char *schema, + const char *vhost, + const char *app, + const char *stream, + int from_mp4) { + assert(schema && vhost && app && stream); + auto src = MediaSource::find(schema, vhost, app, stream, from_mp4); + return (mk_media_source)src.get(); +} + API_EXPORT void API_CALL mk_media_source_for_each(void *user_data, on_mk_media_source_find_cb cb, const char *schema, const char *vhost, const char *app, const char *stream) { assert(cb);