From d8b9c5b1024bc2ec95a5172cee94e83fa9a8bf4e Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang <1237906+wasphin@users.noreply.github.com> Date: Thu, 17 Feb 2022 21:03:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20FFmpeg=20API=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20FFmpeg=205=20(#1434)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- player/FFMpegDecoder.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/player/FFMpegDecoder.cpp b/player/FFMpegDecoder.cpp index ae288bac..9d1f6560 100644 --- a/player/FFMpegDecoder.cpp +++ b/player/FFMpegDecoder.cpp @@ -33,10 +33,10 @@ std::shared_ptr alloc_av_packet(){ ////////////////////////////////////////////////////////////////////////////////////////// template -AVCodec *getCodec(ARGS ...names); +const AVCodec *getCodec(ARGS ...names); template -AVCodec *getCodec(const char *name) { +const AVCodec *getCodec(const char *name) { auto codec = decoder ? avcodec_find_decoder_by_name(name) : avcodec_find_encoder_by_name(name); if (codec) { InfoL << (decoder ? "got decoder:" : "got encoder:") << name; @@ -45,7 +45,7 @@ AVCodec *getCodec(const char *name) { } template -AVCodec *getCodec(enum AVCodecID id) { +const AVCodec *getCodec(enum AVCodecID id) { auto codec = decoder ? avcodec_find_decoder(id) : avcodec_find_encoder(id); if (codec) { InfoL << (decoder ? "got decoder:" : "got encoder:") << avcodec_get_name(id); @@ -54,7 +54,7 @@ AVCodec *getCodec(enum AVCodecID id) { } template -AVCodec *getCodec(First first, ARGS ...names) { +const AVCodec *getCodec(First first, ARGS ...names) { auto codec = getCodec(names...); if (codec) { return codec; @@ -139,9 +139,11 @@ FFmpegFrame::Ptr FFmpegSwr::inputFrame(const FFmpegFrame::Ptr &frame) { /////////////////////////////////////////////////////////////////////////// FFmpegDecoder::FFmpegDecoder(const Track::Ptr &track) { +#if (LIBAVCODEC_VERSION_MAJOR < 58) avcodec_register_all(); - AVCodec *codec = nullptr; - AVCodec *codec_default = nullptr; +#endif + const AVCodec *codec = nullptr; + const AVCodec *codec_default = nullptr; switch (track->getCodecId()) { case CodecH264: codec_default = getCodec(AV_CODEC_ID_H264); @@ -181,7 +183,9 @@ FFmpegDecoder::FFmpegDecoder(const Track::Ptr &track) { } //保存AVFrame的引用 +#ifdef FF_API_OLD_ENCDEC _context->refcounted_frames = 1; +#endif _context->flags |= AV_CODEC_FLAG_LOW_DELAY; _context->flags2 |= AV_CODEC_FLAG2_FAST; From 9370a27c5534363f09d146af4887a30f0b9c3a20 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang <1237906+wasphin@users.noreply.github.com> Date: Mon, 21 Feb 2022 14:35:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20issue=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=20(#1439)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug--.md | 26 ------ .github/ISSUE_TEMPLATE/bug.md | 80 +++++++++++++++++++ .../ISSUE_TEMPLATE/{------.md => feature.md} | 0 .../ISSUE_TEMPLATE/{----.md => question.md} | 0 4 files changed, 80 insertions(+), 26 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug--.md create mode 100644 .github/ISSUE_TEMPLATE/bug.md rename .github/ISSUE_TEMPLATE/{------.md => feature.md} (100%) rename .github/ISSUE_TEMPLATE/{----.md => question.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug--.md b/.github/ISSUE_TEMPLATE/bug--.md deleted file mode 100644 index 324426d2..00000000 --- a/.github/ISSUE_TEMPLATE/bug--.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: bug反馈 -about: 反馈zlmediakit代码本身的bug -title: "[BUG]" -labels: bug -assignees: '' - ---- - -**bug现象** -- bug产生时服务器的异常行为(例如: 崩溃/无法访问/丢包花屏) -- bug产生时,打印的上下文日志(可以截图或粘贴文本) -- 调试core文件时,崩溃触发点的函数调用栈(可以截图或粘贴文本) - -**bug产生时的使用场景** -- 产生bug时,您正在使用zlm的什么功能模块? - -**bug是否可以复现,怎么复现** -- 请描述bug复现时的操作步骤 - -**zlm代码git commit hash值** -- git log查看 - -**操作系统环境** -- 什么类型的操作系统,32位,64位? -- 什么cpu类型? diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 00000000..749eeb2d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,80 @@ +--- +name: bug 反馈 +about: 反馈 ZLMediaKit 代码本身的 bug +title: "[BUG]: " +labels: bug +assignees: '' + +--- + + + + + +### 现象描述 + + + +### 如何复现? + + + +### 相关日志或截图 + + + +
+展开查看详细日志 +
+日志内容...
+
+
+ +### 配置 + + + +
+展开查看详细配置 +
+配置内容...
+
+
+ +### 各种环境信息 + + + +* **代码提交记录/git commit hash**: +* **操作系统及版本**: +* **硬件信息**: +* **其他需要补充的信息**: diff --git a/.github/ISSUE_TEMPLATE/------.md b/.github/ISSUE_TEMPLATE/feature.md similarity index 100% rename from .github/ISSUE_TEMPLATE/------.md rename to .github/ISSUE_TEMPLATE/feature.md diff --git a/.github/ISSUE_TEMPLATE/----.md b/.github/ISSUE_TEMPLATE/question.md similarity index 100% rename from .github/ISSUE_TEMPLATE/----.md rename to .github/ISSUE_TEMPLATE/question.md