From 36ed78ba1ff25a959ac313b6f898d45988b2ae2e Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 2 Aug 2019 13:51:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=87=BD=E6=95=B0=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extension/H264.cpp | 6 +++--- src/Extension/H264.h | 1 - src/Extension/H265.cpp | 13 ++++--------- src/Extension/H265.h | 5 ++--- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/Extension/H264.cpp b/src/Extension/H264.cpp index 83336248..2d93db34 100644 --- a/src/Extension/H264.cpp +++ b/src/Extension/H264.cpp @@ -32,9 +32,6 @@ using namespace toolkit; namespace mediakit{ -bool getAVCInfo(const string& strSps,int &iVideoWidth, int &iVideoHeight, float &iVideoFps) { - return getAVCInfo(strSps.data(),strSps.size(),iVideoWidth,iVideoHeight,iVideoFps); -} bool getAVCInfo(const char * sps,int sps_len,int &iVideoWidth, int &iVideoHeight, float &iVideoFps){ T_GetBitContext tGetBitBuf; T_SPS tH264SpsInfo; @@ -51,6 +48,9 @@ bool getAVCInfo(const char * sps,int sps_len,int &iVideoWidth, int &iVideoHeight return true; } +bool getAVCInfo(const string& strSps,int &iVideoWidth, int &iVideoHeight, float &iVideoFps) { + return getAVCInfo(strSps.data(),strSps.size(),iVideoWidth,iVideoHeight,iVideoFps); +} const char *memfind(const char *buf, int len, const char *subbuf, int sublen) { for (auto i = 0; i < len - sublen; ++i) { diff --git a/src/Extension/H264.h b/src/Extension/H264.h index 4cb91135..bfe77861 100644 --- a/src/Extension/H264.h +++ b/src/Extension/H264.h @@ -36,7 +36,6 @@ using namespace toolkit; namespace mediakit{ bool getAVCInfo(const string &strSps,int &iVideoWidth, int &iVideoHeight, float &iVideoFps); -bool getAVCInfo(const char * sps,int sps_len,int &iVideoWidth, int &iVideoHeight, float &iVideoFps); void splitH264(const char *ptr, int len, const std::function &cb); /** diff --git a/src/Extension/H265.cpp b/src/Extension/H265.cpp index 4287020a..fc7fd8f2 100644 --- a/src/Extension/H265.cpp +++ b/src/Extension/H265.cpp @@ -30,14 +30,7 @@ namespace mediakit{ - - -bool getAVCH265Info(const string& strVps, const string& strSps,int &iVideoWidth, int &iVideoHeight, float &iVideoFps) { - return getAVC265Info(strVps.data(),strVps.size(),strSps.data(),strSps.size(),iVideoWidth,iVideoHeight,iVideoFps); - -} - -bool getAVC265Info(const char * vps, int vps_len,const char * sps,int sps_len,int &iVideoWidth, int &iVideoHeight, float &iVideoFps){ +bool getHEVCInfo(const char * vps, int vps_len,const char * sps,int sps_len,int &iVideoWidth, int &iVideoHeight, float &iVideoFps){ T_GetBitContext tGetBitBuf; T_HEVCSPS tH265SpsInfo; T_HEVCVPS tH265VpsInfo; @@ -69,7 +62,9 @@ bool getAVC265Info(const char * vps, int vps_len,const char * sps,int sps_len,in return true; } - +bool getHEVCInfo(const string &strVps, const string &strSps, int &iVideoWidth, int &iVideoHeight, float &iVideoFps) { + return getHEVCInfo(strVps.data(),strVps.size(),strSps.data(),strSps.size(),iVideoWidth,iVideoHeight,iVideoFps); +} Sdp::Ptr H265Track::getSdp() { if(!ready()){ diff --git a/src/Extension/H265.h b/src/Extension/H265.h index 12022424..295a98ac 100644 --- a/src/Extension/H265.h +++ b/src/Extension/H265.h @@ -36,8 +36,7 @@ using namespace toolkit; namespace mediakit { -bool getAVCH265Info(const string& strVps,const string& strSps,int &iVideoWidth, int &iVideoHeight, float &iVideoFps); -bool getAVC265Info(const char * vps, int vps_len,const char * sps,int sps_len,int &iVideoWidth, int &iVideoHeight, float &iVideoFps); +bool getHEVCInfo(const string &strVps, const string &strSps, int &iVideoWidth, int &iVideoHeight, float &iVideoFps); /** * 265帧类 @@ -336,7 +335,7 @@ private: * 解析sps获取宽高fps */ void onReady(){ - getAVCH265Info(_vps,_sps,_width,_height,_fps); + getHEVCInfo(_vps, _sps, _width, _height, _fps); } Track::Ptr clone() override { return std::make_shared::type>(*this);