合并pr(添加录制ts完成通知): #479

This commit is contained in:
xiongziliang
2020-09-20 11:40:42 +08:00
parent 0fce108de5
commit f84981dc75
11 changed files with 94 additions and 145 deletions

View File

@@ -22,20 +22,6 @@ using namespace toolkit;
namespace mediakit {
class TsInfo {
public:
time_t ui64StartedTime; // GMT 标准时间,单位秒
time_t ui64TimeLen; // 录像长度,单位毫秒
off_t ui64FileSize; // 文件大小,单位 BYTE
string strFilePath; // 文件路径
string strFileName; // 文件名称
string strFolder; // 文件夹路径
string strUrl; // 播放路径
string strAppName; // 应用名称
string strStreamId; // 流 ID
string strVhost; // vhost
};
class HlsMaker {
public:
/**
@@ -92,18 +78,18 @@ protected:
*/
virtual void onWriteHls(const char *data, int len) = 0;
/**
* 上一个 ts 切片写入完成, 可在这里进行通知处理
* @param duration_ms 上一个 ts 切片的时长, 单位为毫秒
*/
virtual void onFlushLastSegment(uint32_t duration_ms) {};
/**
* 关闭上个ts切片并且写入m3u8索引
* @param eof HLS直播是否已结束
*/
void flushLastSegment(bool eof);
/**
* 上一个 ts 切片写入完成, 可在这里进行通知处理
* @param duration 上一个 ts 切片的时长, 单位为毫秒
*/
virtual void onFlushLastSegment(uint32_t duration);
private:
/**
* 生成m3u8文件