From 003cd583711891467c4f192758f913301600736c Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 19 Apr 2020 00:05:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_media.h | 5 ++++- api/source/mk_media.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/api/include/mk_media.h b/api/include/mk_media.h index 4936daf1..c221053b 100755 --- a/api/include/mk_media.h +++ b/api/include/mk_media.h @@ -25,11 +25,14 @@ typedef void *mk_media; * @param app 应用名,推荐为live * @param stream 流id,例如camera * @param duration 时长(单位秒),直播则为0 + * @param rtsp_enabled 是否启用rtsp协议 + * @param rtmp_enabled 是否启用rtmp协议 * @param hls_enabled 是否生成hls * @param mp4_enabled 是否生成mp4 * @return 对象指针 */ -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); +API_EXPORT mk_media API_CALL mk_media_create(const char *vhost, const char *app, const char *stream, float duration, + int rtsp_enabled, int rtmp_enabled, int hls_enabled, int mp4_enabled); /** * 销毁媒体源 diff --git a/api/source/mk_media.cpp b/api/source/mk_media.cpp index 4e92e594..c3309c5d 100755 --- a/api/source/mk_media.cpp +++ b/api/source/mk_media.cpp @@ -96,9 +96,11 @@ API_EXPORT int API_CALL mk_media_total_reader_count(mk_media ctx){ return (*obj)->getChannel()->totalReaderCount(); } -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) { +API_EXPORT mk_media API_CALL mk_media_create(const char *vhost, const char *app, const char *stream, float duration, + int rtsp_enabled, int rtmp_enabled, int hls_enabled, int mp4_enabled) { assert(vhost && app && stream); - MediaHelper::Ptr *obj(new MediaHelper::Ptr(new MediaHelper(vhost, app, stream, duration, true, true, hls_enabled, mp4_enabled))); + MediaHelper::Ptr *obj(new MediaHelper::Ptr(new MediaHelper(vhost, app, stream, duration, + rtsp_enabled, rtmp_enabled, hls_enabled, mp4_enabled))); (*obj)->attachEvent(); return (mk_media) obj; }