From 502e3bff5fe0f6a1f32fe03420b95d0e4054981a Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 8 Mar 2020 22:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3ps=20rtp=E8=A7=A3=E5=8C=85?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rdpart/media-server | 2 +- src/Rtp/RtpDecoder.cpp | 2 +- src/Rtp/RtpProcess.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/3rdpart/media-server b/3rdpart/media-server index 1603194d..737b8d85 160000 --- a/3rdpart/media-server +++ b/3rdpart/media-server @@ -1 +1 @@ -Subproject commit 1603194dafdcecda9036e5741ec8d3e8c9ab1e01 +Subproject commit 737b8d852eeb1a36bc77854f327fbbef7cfb81be diff --git a/src/Rtp/RtpDecoder.cpp b/src/Rtp/RtpDecoder.cpp index c0bebb8a..7bcd23e1 100644 --- a/src/Rtp/RtpDecoder.cpp +++ b/src/Rtp/RtpDecoder.cpp @@ -62,7 +62,7 @@ void RtpDecoder::decodeRtp(const void *data, int bytes) { uint8_t rtp_type = 0x7F & ((uint8_t *) data)[1]; InfoL << "rtp type:" << (int) rtp_type; - _rtp_decoder = rtp_payload_decode_create(rtp_type, "MP4V-ES", &s_func, this); + _rtp_decoder = rtp_payload_decode_create(rtp_type, "MP2P", &s_func, this); if (!_rtp_decoder) { WarnL << "unsupported rtp type:" << (int) rtp_type << ",size:" << bytes << ",hexdump" << hexdump(data, bytes > 16 ? 16 : bytes); } diff --git a/src/Rtp/RtpProcess.cpp b/src/Rtp/RtpProcess.cpp index eeba54b7..654ac363 100644 --- a/src/Rtp/RtpProcess.cpp +++ b/src/Rtp/RtpProcess.cpp @@ -180,9 +180,11 @@ void RtpProcess::onRtpDecode(const uint8_t *packet, int bytes, uint32_t timestam //创建解码器 if(checkTS(packet, bytes)){ //猜测是ts负载 + InfoL << "judged to be TS: " << printSSRC(_ssrc); _decoder = Decoder::createDecoder(Decoder::decoder_ts); }else{ //猜测是ps负载 + InfoL << "judged to be PS: " << printSSRC(_ssrc); _decoder = Decoder::createDecoder(Decoder::decoder_ps); } _decoder->setOnDecode([this](int stream,int codecid,int flags,int64_t pts,int64_t dts,const void *data,int bytes){