mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-29 22:32:23 +08:00
Merge remote-tracking branch 'upstream/master' into master
This commit is contained in:
@@ -105,6 +105,9 @@ void HlsMakerImp::onWriteSegment(const char *data, int len) {
|
||||
if (_file) {
|
||||
fwrite(data, len, 1, _file.get());
|
||||
}
|
||||
if (_media_src) {
|
||||
_media_src->onSegmentSize(len);
|
||||
}
|
||||
}
|
||||
|
||||
void HlsMakerImp::onWriteHls(const char *data, int len) {
|
||||
|
||||
@@ -79,6 +79,10 @@ public:
|
||||
_list_cb.emplace_back(std::move(cb));
|
||||
}
|
||||
|
||||
void onSegmentSize(uint64_t bytes) {
|
||||
_speed += bytes;
|
||||
}
|
||||
|
||||
private:
|
||||
bool _is_regist = false;
|
||||
RingType::Ptr _ring;
|
||||
|
||||
@@ -32,7 +32,7 @@ string Recorder::getRecordPath(Recorder::type type, const string &vhost, const s
|
||||
}
|
||||
//Here we use the customized file path.
|
||||
if (!customized_path.empty()) {
|
||||
m3u8FilePath = customized_path + "/hls.m3u8";
|
||||
return File::absolutePath(m3u8FilePath, customized_path);
|
||||
}
|
||||
return File::absolutePath(m3u8FilePath, hlsPath);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ string Recorder::getRecordPath(Recorder::type type, const string &vhost, const s
|
||||
}
|
||||
//Here we use the customized file path.
|
||||
if (!customized_path.empty()) {
|
||||
mp4FilePath = customized_path + "/";
|
||||
return File::absolutePath(mp4FilePath, customized_path);
|
||||
}
|
||||
return File::absolutePath(mp4FilePath, recordPath);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
* @param vhost 虚拟主机
|
||||
* @param app 应用名
|
||||
* @param stream_id 流id
|
||||
* @param customized_path 录像文件保存自定义目录,默认为空则自动生成
|
||||
* @param customized_path 录像文件保存自定义根目录,为空则采用配置文件设置
|
||||
* @return 录制文件绝对路径
|
||||
*/
|
||||
static string getRecordPath(type type, const string &vhost, const string &app, const string &stream_id,const string &customized_path = "");
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
* @param vhost 虚拟主机
|
||||
* @param app 应用名
|
||||
* @param stream_id 流id
|
||||
* @param customized_path 录像文件保存自定义目录,默认为空则自动生成
|
||||
* @param customized_path 录像文件保存自定义根目录,为空则采用配置文件设置
|
||||
* @return 对象指针,可能为nullptr
|
||||
*/
|
||||
static std::shared_ptr<MediaSinkInterface> createRecorder(type type, const string &vhost, const string &app, const string &stream_id, const string &customized_path = "");
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
* @param vhost 虚拟主机
|
||||
* @param app 应用名
|
||||
* @param stream_id 流id
|
||||
* @param customized_path 录像文件保存自定义目录,默认为空则自动生成
|
||||
* @param customized_path 录像文件保存自定义根目录,为空则采用配置文件设置
|
||||
* @return 成功与否
|
||||
*/
|
||||
static bool startRecord(type type, const string &vhost, const string &app, const string &stream_id,const string &customized_path);
|
||||
|
||||
Reference in New Issue
Block a user