flv录制添加参数vhost

This commit is contained in:
xiongziliang 2019-12-27 13:56:02 +08:00
parent 118be421d6
commit 37bca15dc9
2 changed files with 5 additions and 4 deletions

View File

@ -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录制/////////////////////////////////////////////

View File

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