Merge branch 'ZLMediaKit:master' into master
This commit is contained in:
commit
0de114c3b9
|
|
@ -20,14 +20,14 @@ assignees: ''
|
||||||
* https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
|
* https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### 现象描述
|
## 现象描述
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
在使用什么功能产生的问题? 其异常表现是什么?
|
在使用什么功能产生的问题? 其异常表现是什么?
|
||||||
如: 在测试 WebRTC 功能时, 使用 Chrome 浏览器访问 ZLMediait 自带网页播放 FFmpeg 以 RTSP 协议推送的图像有卡顿/花屏.
|
如: 在测试 WebRTC 功能时, 使用 Chrome 浏览器访问 ZLMediait 自带网页播放 FFmpeg 以 RTSP 协议推送的图像有卡顿/花屏.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### 如何复现?
|
## 如何复现?
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
明确的复现步骤对快速解决问题极有帮助.
|
明确的复现步骤对快速解决问题极有帮助.
|
||||||
|
|
@ -37,7 +37,7 @@ assignees: ''
|
||||||
1. 期望 ..., 结果 ...
|
1. 期望 ..., 结果 ...
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### 相关日志或截图
|
## 相关日志或截图
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
由于日志通长较长, 建议将日志信息填写到下面的 "日志内容..."
|
由于日志通长较长, 建议将日志信息填写到下面的 "日志内容..."
|
||||||
|
|
@ -50,11 +50,14 @@ assignees: ''
|
||||||
<details>
|
<details>
|
||||||
<summary>展开查看详细日志</summary>
|
<summary>展开查看详细日志</summary>
|
||||||
<pre>
|
<pre>
|
||||||
日志内容...
|
|
||||||
|
```
|
||||||
|
#详细日志粘在这里!
|
||||||
|
```
|
||||||
</pre>
|
</pre>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 配置
|
## 配置
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
部分常见问题是由于配置错误导致的, 建议仔细阅读配置文件中的注释信息
|
部分常见问题是由于配置错误导致的, 建议仔细阅读配置文件中的注释信息
|
||||||
|
|
@ -65,11 +68,14 @@ assignees: ''
|
||||||
<details>
|
<details>
|
||||||
<summary>展开查看详细配置</summary>
|
<summary>展开查看详细配置</summary>
|
||||||
<pre>
|
<pre>
|
||||||
配置内容...
|
|
||||||
|
```ini
|
||||||
|
#config.ini内容粘在这里!
|
||||||
|
```
|
||||||
</pre>
|
</pre>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 各种环境信息
|
## 各种环境信息
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
请填写相关环境信息, 详细的环境信息有助于快速复现定位问题.
|
请填写相关环境信息, 详细的环境信息有助于快速复现定位问题.
|
||||||
|
|
@ -82,4 +88,8 @@ assignees: ''
|
||||||
* **代码提交记录/git commit hash**:
|
* **代码提交记录/git commit hash**:
|
||||||
* **操作系统及版本**:
|
* **操作系统及版本**:
|
||||||
* **硬件信息**:
|
* **硬件信息**:
|
||||||
|
* **crash backtrace**:
|
||||||
|
```
|
||||||
|
#崩溃信息backtrace粘贴至此
|
||||||
|
```
|
||||||
* **其他需要补充的信息**:
|
* **其他需要补充的信息**:
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ assignees: ''
|
||||||
* https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
|
* https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### 相关日志及环境信息
|
## 相关日志及环境信息
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
由于编译日志通长较长, 建议将日志信息填写到下面 `````` block 内,或者上传日志文件
|
由于编译日志通长较长, 建议将日志信息填写到下面 `````` block 内,或者上传日志文件
|
||||||
|
|
@ -41,7 +41,7 @@ assignees: ''
|
||||||
|
|
||||||
编译目录下的 `CMakeCache.txt` 文件内容,请直接上传为附件。
|
编译目录下的 `CMakeCache.txt` 文件内容,请直接上传为附件。
|
||||||
|
|
||||||
### 各种环境信息
|
## 各种环境信息
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
请填写相关环境信息, 详细的环境信息有助于快速复现定位问题.
|
请填写相关环境信息, 详细的环境信息有助于快速复现定位问题.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
blank_issues_enabled: false
|
||||||
|
|
||||||
|
contact_links:
|
||||||
|
- name: 技术咨询
|
||||||
|
url: https://t.zsxq.com/FcVK5
|
||||||
|
about: 请在知识星球发起技术咨询
|
||||||
|
|
@ -7,8 +7,8 @@ assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**描述该功能的用处,可以提供相关资料描述该功能**
|
## 描述该功能的用处,可以提供相关资料描述该功能
|
||||||
|
|
||||||
**该功能是否用于改进项目缺陷,如果是,请描述现有缺陷**
|
## 该功能是否用于改进项目缺陷,如果是,请描述现有缺陷
|
||||||
|
|
||||||
**描述你期望实现该功能的方式和最终效果**
|
## 描述你期望实现该功能的方式和最终效果
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
---
|
|
||||||
name: 技术咨询
|
|
||||||
about: 使用咨询、技术咨询等
|
|
||||||
title: "[技术咨询] 咨询描述(必填)"
|
|
||||||
labels: 技术咨询
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**咨询的功能模块**
|
|
||||||
- 请描述您想咨询zlmediakit的哪部分功能
|
|
||||||
|
|
||||||
**咨询的具体内容和问题**
|
|
||||||
- 此处展开您咨询内容的描述
|
|
||||||
|
|
||||||
**注意事项**
|
|
||||||
- 技术咨询前请先认真阅读readme, [wiki](https://github.com/ZLMediaKit/ZLMediaKit/wiki),如有必要,您也可以同时搜索已经答复的issue,如果没找到答案才在此提issue
|
|
||||||
|
|
||||||
- 技术咨询不属于bug缺陷,要求用户先star(收藏)本项目,否则会直接关闭issue
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
name: issue创建要求
|
|
||||||
about: 不符合模板要求不便定位问题,可能会被管理员直接关闭
|
|
||||||
title: ""
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
name: issue_lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
issue_lint:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
const fs = require('fs').promises;
|
||||||
|
|
||||||
|
const getTitles = (str) => (
|
||||||
|
[...str.matchAll(/^## (.*)/gm)].map((m) => m[0])
|
||||||
|
);
|
||||||
|
|
||||||
|
const titles = getTitles(context.payload.issue.body);
|
||||||
|
|
||||||
|
for (let file of await fs.readdir('.github/ISSUE_TEMPLATE')) {
|
||||||
|
if (!file.endsWith('.md')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const template = await fs.readFile(`.github/ISSUE_TEMPLATE/${file}`, 'utf-8');
|
||||||
|
const templateTitles = getTitles(template);
|
||||||
|
|
||||||
|
if (templateTitles.every((title) => titles.includes(title))) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.issue.owner,
|
||||||
|
repo: context.issue.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
body: '此issue由于不符合模板规范已经自动关闭,请重新按照模板规范确保包含模板中所有章节标题再提交\n',
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.update({
|
||||||
|
owner: context.issue.owner,
|
||||||
|
repo: context.issue.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
state: 'closed',
|
||||||
|
});
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 26d54bbc7b1860a450434dce49bbc8fcbcbae88b
|
Subproject commit 1e1a990783c6c09452419c0aaa6d72ce02d0202b
|
||||||
|
|
@ -126,6 +126,8 @@ wait_track_ready_ms=10000
|
||||||
wait_add_track_ms=3000
|
wait_add_track_ms=3000
|
||||||
#如果track未就绪,我们先缓存帧数据,但是有最大个数限制,防止内存溢出
|
#如果track未就绪,我们先缓存帧数据,但是有最大个数限制,防止内存溢出
|
||||||
unready_frame_cache=100
|
unready_frame_cache=100
|
||||||
|
#是否启用观看人数变化事件广播,置1则启用,置0则关闭
|
||||||
|
broadcast_player_count_changed=0
|
||||||
|
|
||||||
[hls]
|
[hls]
|
||||||
#hls写文件的buf大小,调整参数可以提高文件io性能
|
#hls写文件的buf大小,调整参数可以提高文件io性能
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,12 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "Common/JemallocUtil.h"
|
|
||||||
#include "Common/macros.h"
|
|
||||||
#include "System.h"
|
#include "System.h"
|
||||||
|
#include "Util/util.h"
|
||||||
#include "Util/logger.h"
|
#include "Util/logger.h"
|
||||||
#include "Util/uv_errno.h"
|
#include "Util/uv_errno.h"
|
||||||
|
#include "Common/macros.h"
|
||||||
|
#include "Common/JemallocUtil.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
|
|
@ -66,6 +67,16 @@ static void save_jemalloc_stats() {
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string get_func_symbol(const std::string &symbol) {
|
||||||
|
size_t pos1 = symbol.find("(");
|
||||||
|
if (pos1 == string::npos) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
size_t pos2 = symbol.find("+", pos1);
|
||||||
|
auto ret = symbol.substr(pos1 + 1, pos2 - pos1 - 1);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void sig_crash(int sig) {
|
static void sig_crash(int sig) {
|
||||||
signal(sig, SIG_DFL);
|
signal(sig, SIG_DFL);
|
||||||
void *array[MAX_STACK_FRAMES];
|
void *array[MAX_STACK_FRAMES];
|
||||||
|
|
@ -78,6 +89,10 @@ static void sig_crash(int sig) {
|
||||||
std::string symbol(strings[i]);
|
std::string symbol(strings[i]);
|
||||||
ref.emplace_back(symbol);
|
ref.emplace_back(symbol);
|
||||||
#if defined(__linux) || defined(__linux__)
|
#if defined(__linux) || defined(__linux__)
|
||||||
|
auto func_symbol = get_func_symbol(symbol);
|
||||||
|
if (!func_symbol.empty()) {
|
||||||
|
ref.emplace_back(toolkit::demangle(func_symbol.data()));
|
||||||
|
}
|
||||||
static auto addr2line = [](const string &address) {
|
static auto addr2line = [](const string &address) {
|
||||||
string cmd = StrPrinter << "addr2line -C -f -e " << exePath() << " " << address;
|
string cmd = StrPrinter << "addr2line -C -f -e " << exePath() << " " << address;
|
||||||
return System::execute(cmd);
|
return System::execute(cmd);
|
||||||
|
|
|
||||||
|
|
@ -1766,7 +1766,7 @@ void installWebApi() {
|
||||||
, _session_id(std::move(session_id)) {}
|
, _session_id(std::move(session_id)) {}
|
||||||
~WebRtcArgsImp() override = default;
|
~WebRtcArgsImp() override = default;
|
||||||
|
|
||||||
variant operator[](const string &key) const override {
|
toolkit::variant operator[](const string &key) const override {
|
||||||
if (key == "url") {
|
if (key == "url") {
|
||||||
return getUrl();
|
return getUrl();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -652,6 +652,10 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string &
|
||||||
/////////////////////////////////////MediaSourceEvent//////////////////////////////////////
|
/////////////////////////////////////MediaSourceEvent//////////////////////////////////////
|
||||||
|
|
||||||
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
||||||
|
GET_CONFIG(bool, enable, General::kBroadcastPlayerCountChanged);
|
||||||
|
if (enable) {
|
||||||
|
NOTICE_EMIT(BroadcastPlayerCountChangedArgs, Broadcast::kBroadcastPlayerCountChanged, sender.getMediaTuple(), sender.totalReaderCount());
|
||||||
|
}
|
||||||
if (size || sender.totalReaderCount()) {
|
if (size || sender.totalReaderCount()) {
|
||||||
//还有人观看该视频,不触发关闭事件
|
//还有人观看该视频,不触发关闭事件
|
||||||
_async_close_timer = nullptr;
|
_async_close_timer = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ const string kBroadcastRtcSctpFailed = "kBroadcastRtcSctpFailed";
|
||||||
const string kBroadcastRtcSctpClosed = "kBroadcastRtcSctpClosed";
|
const string kBroadcastRtcSctpClosed = "kBroadcastRtcSctpClosed";
|
||||||
const string kBroadcastRtcSctpSend = "kBroadcastRtcSctpSend";
|
const string kBroadcastRtcSctpSend = "kBroadcastRtcSctpSend";
|
||||||
const string kBroadcastRtcSctpReceived = "kBroadcastRtcSctpReceived";
|
const string kBroadcastRtcSctpReceived = "kBroadcastRtcSctpReceived";
|
||||||
|
const string kBroadcastPlayerCountChanged = "kBroadcastPlayerCountChanged";
|
||||||
|
|
||||||
} // namespace Broadcast
|
} // namespace Broadcast
|
||||||
|
|
||||||
|
|
@ -82,6 +83,7 @@ const string kEnableFFmpegLog = GENERAL_FIELD "enable_ffmpeg_log";
|
||||||
const string kWaitTrackReadyMS = GENERAL_FIELD "wait_track_ready_ms";
|
const string kWaitTrackReadyMS = GENERAL_FIELD "wait_track_ready_ms";
|
||||||
const string kWaitAddTrackMS = GENERAL_FIELD "wait_add_track_ms";
|
const string kWaitAddTrackMS = GENERAL_FIELD "wait_add_track_ms";
|
||||||
const string kUnreadyFrameCache = GENERAL_FIELD "unready_frame_cache";
|
const string kUnreadyFrameCache = GENERAL_FIELD "unready_frame_cache";
|
||||||
|
const string kBroadcastPlayerCountChanged = GENERAL_FIELD "broadcast_player_count_changed";
|
||||||
|
|
||||||
static onceToken token([]() {
|
static onceToken token([]() {
|
||||||
mINI::Instance()[kFlowThreshold] = 1024;
|
mINI::Instance()[kFlowThreshold] = 1024;
|
||||||
|
|
@ -96,6 +98,7 @@ static onceToken token([]() {
|
||||||
mINI::Instance()[kWaitTrackReadyMS] = 10000;
|
mINI::Instance()[kWaitTrackReadyMS] = 10000;
|
||||||
mINI::Instance()[kWaitAddTrackMS] = 3000;
|
mINI::Instance()[kWaitAddTrackMS] = 3000;
|
||||||
mINI::Instance()[kUnreadyFrameCache] = 100;
|
mINI::Instance()[kUnreadyFrameCache] = 100;
|
||||||
|
mINI::Instance()[kBroadcastPlayerCountChanged] = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
} // namespace General
|
} // namespace General
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,10 @@ extern const std::string kBroadcastRtcSctpSend;
|
||||||
extern const std::string kBroadcastRtcSctpReceived;
|
extern const std::string kBroadcastRtcSctpReceived;
|
||||||
#define BroadcastRtcSctpReceivedArgs WebRtcTransport& sender, uint16_t &streamId, uint32_t &ppid, const uint8_t *&msg, size_t &len
|
#define BroadcastRtcSctpReceivedArgs WebRtcTransport& sender, uint16_t &streamId, uint32_t &ppid, const uint8_t *&msg, size_t &len
|
||||||
|
|
||||||
|
// 观看人数变化广播
|
||||||
|
extern const std::string kBroadcastPlayerCountChanged;
|
||||||
|
#define BroadcastPlayerCountChangedArgs const MediaTuple& args, const int& count
|
||||||
|
|
||||||
#define ReloadConfigTag ((void *)(0xFF))
|
#define ReloadConfigTag ((void *)(0xFF))
|
||||||
#define RELOAD_KEY(arg, key) \
|
#define RELOAD_KEY(arg, key) \
|
||||||
do { \
|
do { \
|
||||||
|
|
@ -196,6 +200,8 @@ extern const std::string kWaitTrackReadyMS;
|
||||||
extern const std::string kWaitAddTrackMS;
|
extern const std::string kWaitAddTrackMS;
|
||||||
// 如果track未就绪,我们先缓存帧数据,但是有最大个数限制(100帧时大约4秒),防止内存溢出
|
// 如果track未就绪,我们先缓存帧数据,但是有最大个数限制(100帧时大约4秒),防止内存溢出
|
||||||
extern const std::string kUnreadyFrameCache;
|
extern const std::string kUnreadyFrameCache;
|
||||||
|
// 是否启用观看人数变化事件广播,置1则启用,置0则关闭
|
||||||
|
extern const std::string kBroadcastPlayerCountChanged;
|
||||||
} // namespace General
|
} // namespace General
|
||||||
|
|
||||||
namespace Protocol {
|
namespace Protocol {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue