hls/mp4录制不再能随时开启或关闭

This commit is contained in:
xiongziliang
2020-04-04 14:33:12 +08:00
parent a581f78d12
commit cefb2a7cc4
11 changed files with 35 additions and 488 deletions

View File

@@ -60,47 +60,6 @@ API_EXPORT void API_CALL mk_flv_recorder_release(mk_flv_recorder ctx);
*/
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录制/////////////////////////////////////////////
/**
* 获取录制状态
* @param type 0:hls,1:MP4
* @param vhost 虚拟主机
* @param app 应用名
* @param stream 流id
* @return 录制状态,0:未录制,1:等待MediaSource注册注册成功后立即开始录制,2:MediaSource已注册并且正在录制
*/
API_EXPORT int API_CALL mk_recorder_status(int type, const char *vhost, const char *app, const char *stream);
/**
* 开始录制
* @param type 0:hls,1:MP4
* @param vhost 虚拟主机
* @param app 应用名
* @param stream 流id
* @param customized_path 录像文件保存自定义目录默认为空或null则自动生成
* @param wait_for_record 是否等待流注册后再录制未注册时置false将返回失败
* @param continue_record 流注销时是否继续等待录制还是立即停止录制
* @return 0代表成功负数代表失败
*/
API_EXPORT int API_CALL mk_recorder_start(int type, const char *vhost, const char *app, const char *stream, const char *customized_path, int wait_for_record, int continue_record);
/**
* 停止录制
* @param type 0:hls,1:MP4
* @param vhost 虚拟主机
* @param app 应用名
* @param stream 流id
* @return 1:成功0失败
*/
API_EXPORT int API_CALL mk_recorder_stop(int type, const char *vhost, const char *app, const char *stream);
/**
* 停止所有录制,一般程序退出时调用
*/
API_EXPORT void API_CALL mk_recorder_stop_all();
#ifdef __cplusplus
}
#endif

View File

@@ -49,24 +49,4 @@ API_EXPORT int API_CALL mk_flv_recorder_start(mk_flv_recorder ctx, const char *v
WarnL << ex.what();
return -1;
}
}
///////////////////////////////////////////hls/mp4录制/////////////////////////////////////////////
API_EXPORT int API_CALL mk_recorder_status(int type, const char *vhost, const char *app, const char *stream){
assert(vhost && app && stream);
return Recorder::getRecordStatus((Recorder::type)type,vhost,app,stream);
}
API_EXPORT int API_CALL mk_recorder_start(int type, const char *vhost, const char *app, const char *stream,const char *customized_path,int wait_for_record, int continue_record){
assert(vhost && app && stream);
return Recorder::startRecord((Recorder::type)type,vhost,app,stream,customized_path ? customized_path : "",wait_for_record,continue_record);
}
API_EXPORT int API_CALL mk_recorder_stop(int type, const char *vhost, const char *app, const char *stream){
assert(vhost && app && stream);
return Recorder::stopRecord((Recorder::type)type,vhost,app,stream);
}
API_EXPORT void API_CALL mk_recorder_stop_all(){
Recorder::stopAll();
}