chore: Rename variables related to “broadcast_player_count_changed”

This commit is contained in:
KkemChen 2024-05-22 19:30:42 +08:00
parent 4ff12cb108
commit cdc53327e5
4 changed files with 5 additions and 5 deletions

View File

@ -127,7 +127,7 @@ wait_add_track_ms=3000
#如果track未就绪我们先缓存帧数据但是有最大个数限制防止内存溢出
unready_frame_cache=100
#是否启用观看人数变化事件广播置1则启用置0则关闭
enablePlayerCountChangeEvent=0
broadcast_player_count_changed=0
[hls]
#hls写文件的buf大小调整参数可以提高文件io性能

View File

@ -652,7 +652,7 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string &
/////////////////////////////////////MediaSourceEvent//////////////////////////////////////
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
GET_CONFIG(int, enable, General::kEnablePlayerCountChangeEvent);
GET_CONFIG(bool, enable, General::kBroadcastPlayerCountChanged);
if (enable) {
NOTICE_EMIT(BroadcastPlayerCountChangedArgs, Broadcast::kBroadcastPlayerCountChanged, sender.getMediaTuple(), sender.totalReaderCount());
}

View File

@ -83,7 +83,7 @@ const string kEnableFFmpegLog = GENERAL_FIELD "enable_ffmpeg_log";
const string kWaitTrackReadyMS = GENERAL_FIELD "wait_track_ready_ms";
const string kWaitAddTrackMS = GENERAL_FIELD "wait_add_track_ms";
const string kUnreadyFrameCache = GENERAL_FIELD "unready_frame_cache";
const string kEnablePlayerCountChangeEvent = GENERAL_FIELD "enablePlayerCountChangeEvent";
const string kBroadcastPlayerCountChanged = GENERAL_FIELD "broadcast_player_count_changed";
static onceToken token([]() {
mINI::Instance()[kFlowThreshold] = 1024;
@ -98,7 +98,7 @@ static onceToken token([]() {
mINI::Instance()[kWaitTrackReadyMS] = 10000;
mINI::Instance()[kWaitAddTrackMS] = 3000;
mINI::Instance()[kUnreadyFrameCache] = 100;
mINI::Instance()[kEnablePlayerCountChangeEvent] = 0;
mINI::Instance()[kBroadcastPlayerCountChanged] = 0;
});
} // namespace General

View File

@ -201,7 +201,7 @@ extern const std::string kWaitAddTrackMS;
// 如果track未就绪我们先缓存帧数据但是有最大个数限制(100帧时大约4秒),防止内存溢出
extern const std::string kUnreadyFrameCache;
// 是否启用观看人数变化事件广播置1则启用置0则关闭
extern const std::string kEnablePlayerCountChangeEvent;
extern const std::string kBroadcastPlayerCountChanged;
} // namespace General
namespace Protocol {