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);