mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 19:51:49 +08:00
增加了服务器id,修改了record.cpp中mp4录制的自定义录制路径,ffmpegsource中的超时时间,webhook中的唯一id等
This commit is contained in:
@@ -18,6 +18,25 @@
|
||||
using namespace toolkit;
|
||||
|
||||
namespace mediakit {
|
||||
string generalGuid() {
|
||||
srand(time(0));
|
||||
std::string random_str("");
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int j = 0; j < 8; j++)
|
||||
switch (rand() % 2) {
|
||||
case 1:
|
||||
random_str += ('A' + rand() % 26);
|
||||
break;
|
||||
default:
|
||||
random_str += ('0' + rand() % 10);
|
||||
break;
|
||||
}
|
||||
if (i < 5)
|
||||
random_str += "-";
|
||||
}
|
||||
|
||||
return random_str;
|
||||
}
|
||||
|
||||
bool loadIniConfig(const char *ini_path){
|
||||
string ini;
|
||||
@@ -58,6 +77,7 @@ const string kBroadcastHttpBeforeAccess = "kBroadcastHttpBeforeAccess";
|
||||
//通用配置项目
|
||||
namespace General{
|
||||
#define GENERAL_FIELD "general."
|
||||
const string kMediaServerId = GENERAL_FIELD"mediaServerId";
|
||||
const string kFlowThreshold = GENERAL_FIELD"flowThreshold";
|
||||
const string kStreamNoneReaderDelayMS = GENERAL_FIELD"streamNoneReaderDelayMS";
|
||||
const string kMaxStreamWaitTimeMS = GENERAL_FIELD"maxStreamWaitMS";
|
||||
@@ -80,6 +100,7 @@ onceToken token([](){
|
||||
mINI::Instance()[kPublishToMP4] = 0;
|
||||
mINI::Instance()[kMergeWriteMS] = 0;
|
||||
mINI::Instance()[kModifyStamp] = 0;
|
||||
mINI::Instance()[kMediaServerId] = generalGuid();
|
||||
},nullptr);
|
||||
|
||||
}//namespace General
|
||||
|
||||
Reference in New Issue
Block a user