From f6eb84b4130f159f8d30ecda4e877612d466d093 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 16 May 2021 12:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ssrc=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 14 ++++++++++++++ webrtc/Sdp.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 03cb5e9a..299655e4 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1284,6 +1284,20 @@ const RtcCodecPlan *RtcMedia::getRelatedRtxPlan(uint8_t pt) const{ return nullptr; } +uint32_t RtcMedia::getRtpSSRC() const { + if (rtp_rtx_ssrc.size()) { + return rtp_rtx_ssrc[0].ssrc; + } + return 0; +} + +uint32_t RtcMedia::getRtxSSRC() const { + if (rtp_rtx_ssrc.size() > 1) { + return rtp_rtx_ssrc[1].ssrc; + } + return 0; +} + void RtcMedia::checkValid() const{ CHECK(type != TrackInvalid); CHECK(!mid.empty()); diff --git a/webrtc/Sdp.h b/webrtc/Sdp.h index 1ddfce94..6ed2710a 100644 --- a/webrtc/Sdp.h +++ b/webrtc/Sdp.h @@ -645,6 +645,8 @@ public: const RtcCodecPlan *getPlan(uint8_t pt) const; const RtcCodecPlan *getPlan(const char *codec) const; const RtcCodecPlan *getRelatedRtxPlan(uint8_t pt) const; + uint32_t getRtpSSRC() const; + uint32_t getRtxSSRC() const; }; class RtcSession{