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