From 37bca15dc9a83a3895a207902a54f5a13bf9d23f Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 27 Dec 2019 13:56:02 +0800 Subject: [PATCH] =?UTF-8?q?flv=E5=BD=95=E5=88=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0vhost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_recorder.h | 3 ++- api/source/mk_recorder.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/include/mk_recorder.h b/api/include/mk_recorder.h index effd77e7..7419fce3 100644 --- a/api/include/mk_recorder.h +++ b/api/include/mk_recorder.h @@ -52,12 +52,13 @@ API_EXPORT void API_CALL mk_flv_recorder_release(mk_flv_recorder ctx); /** * 开始录制flv * @param ctx flv录制器 + * @param vhost 虚拟主机 * @param app 绑定的RtmpMediaSource的 app名 * @param stream 绑定的RtmpMediaSource的 stream名 * @param file_path 文件存放地址 * @return 0:开始超过,-1:失败,打开文件失败或该RtmpMediaSource不存在 */ -API_EXPORT int API_CALL mk_flv_recorder_start(mk_flv_recorder ctx, const char *app, const char *stream, const char *file_path); +API_EXPORT int API_CALL mk_flv_recorder_start(mk_flv_recorder ctx, const char *vhost, const char *app, const char *stream, const char *file_path); ///////////////////////////////////////////hls/mp4录制///////////////////////////////////////////// diff --git a/api/source/mk_recorder.cpp b/api/source/mk_recorder.cpp index ee5baa4a..7ac4968c 100644 --- a/api/source/mk_recorder.cpp +++ b/api/source/mk_recorder.cpp @@ -39,11 +39,11 @@ API_EXPORT void API_CALL mk_flv_recorder_release(mk_flv_recorder ctx){ FlvRecorder::Ptr *record = (FlvRecorder::Ptr *)(ctx); delete record; } -API_EXPORT int API_CALL mk_flv_recorder_start(mk_flv_recorder ctx, const char *app, const char *stream, const char *file_path){ - assert(ctx && app && stream && file_path); +API_EXPORT int API_CALL mk_flv_recorder_start(mk_flv_recorder ctx, const char *vhost, const char *app, const char *stream, const char *file_path){ + assert(ctx && vhost && app && stream && file_path); try { FlvRecorder::Ptr *record = (FlvRecorder::Ptr *)(ctx); - (*record)->startRecord(EventPollerPool::Instance().getPoller(), DEFAULT_VHOST,app,stream,file_path); + (*record)->startRecord(EventPollerPool::Instance().getPoller(),vhost,app,stream,file_path); return 0; }catch (std::exception &ex){ WarnL << ex.what();