From b8019739d1ba3e0a399ead02678d12bc6f87b72e Mon Sep 17 00:00:00 2001 From: Leon <8544842+leon14631@user.noreply.gitee.com> Date: Mon, 8 Aug 2022 10:05:31 +0000 Subject: [PATCH] update src/Extension/H264.cpp. --- src/Extension/H264.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Extension/H264.cpp b/src/Extension/H264.cpp index 3426f5cc..4587f0be 100644 --- a/src/Extension/H264.cpp +++ b/src/Extension/H264.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. * * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). @@ -142,6 +142,17 @@ float H264Track::getVideoFps() const { return _fps; } +void H264Track::flush() const { + int w = 0; + int h = 0; + float fps = 0.0; + if(getAVCInfo(_sps, w, h, fps)){ + _width = w; + _height = h; + _fps = fps; + } +} + bool H264Track::ready() { return !_sps.empty() && !_pps.empty(); }