From 005db3cbc562d20f0343ef221afaf21dc34d310e Mon Sep 17 00:00:00 2001 From: zqsong Date: Mon, 9 Sep 2019 10:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A8=E9=80=81H265?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99,=E6=AF=8F=E4=B8=80=E5=B8=A7?= =?UTF-8?q?=E9=83=BDsplit=E5=AF=BC=E8=87=B4=E8=80=97=E6=97=B6=E8=BF=87?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extension/H265.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Extension/H265.h b/src/Extension/H265.h index 295a98ac..021ef3d1 100644 --- a/src/Extension/H265.h +++ b/src/Extension/H265.h @@ -267,8 +267,10 @@ public: * @param frame 数据帧 */ void inputFrame(const Frame::Ptr &frame) override{ - bool first_frame = true; - splitH264(frame->data() + frame->prefixSize(), + int type = H265_TYPE(*((uint8_t *)frame->data() + frame->prefixSize())); + if(type == H265Frame::NAL_VPS){ + bool first_frame = true; + splitH264(frame->data() + frame->prefixSize(), frame->size() - frame->prefixSize(), [&](const char *ptr, int len){ if(first_frame){ @@ -286,6 +288,9 @@ public: inputFrame_l(sub_frame); } }); + }else{ + inputFrame_l(frame); + } } private: