summaryrefslogtreecommitdiff
path: root/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-04-19 07:10:49 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-04-19 07:10:49 +0000
commitcc53a68a4149caa42e41dd3b5964bedb8962eac6 (patch)
tree7261ff70a95011cbe51a8126e52e0f7856b75e56 /service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp
parenta1462dc514a5d8b4fd379a7533bb75ca9ceb8dcf (diff)
parentdcd2800d791ef0431a82b320c08be474bc45578e (diff)
downloadImsMedia-cc53a68a4149caa42e41dd3b5964bedb8962eac6.tar.gz
Merge "Don't stop decoding RTCP compound packet when RTCP-XR report block is encountered." into udc-dev am: dcd2800d79
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/ImsMedia/+/22735161 Change-Id: Ide8477ac832a4e62840ae3cc7e1e8297cb09cabc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp')
-rw-r--r--service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp38
1 files changed, 33 insertions, 5 deletions
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp
index b67fde10..2f11d8f1 100644
--- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp
+++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacket.cpp
@@ -213,8 +213,8 @@ eRTP_STATUS_CODE RtcpPacket::decodeRtcpPacket(IN RtpBuffer* pobjRtcpPktBuf,
usPktLen -= RTP_WORD_SIZE;
if (usPktLen > iTrackCompLen)
{
- RTP_TRACE_ERROR(
- "[DecodeRtcpPacket] RTCP packet length is Invalid.", usPktLen, iTrackCompLen);
+ RTP_TRACE_ERROR("[DecodeRtcpPacket] Report length is Invalid. ReportLen:%d, RtcpLen:%d",
+ usPktLen, iTrackCompLen);
return RTP_INVALID_MSG;
}
@@ -265,6 +265,9 @@ eRTP_STATUS_CODE RtcpPacket::decodeRtcpPacket(IN RtpBuffer* pobjRtcpPktBuf,
case RTCP_SDES:
{
RTP_TRACE_MESSAGE("[DecodeRtcpPacket] Decoding RTCP_SDES", 0, 0);
+ if (m_pobjSdesPkt != nullptr)
+ delete m_pobjSdesPkt;
+
m_pobjSdesPkt = new RtcpSdesPacket();
if (m_pobjSdesPkt == nullptr)
{
@@ -279,6 +282,9 @@ eRTP_STATUS_CODE RtcpPacket::decodeRtcpPacket(IN RtpBuffer* pobjRtcpPktBuf,
case RTCP_BYE:
{
RTP_TRACE_MESSAGE("[DecodeRtcpPacket] Decoding RTCP_BYE", 0, 0);
+ if (m_pobjByePkt != nullptr)
+ delete m_pobjByePkt;
+
m_pobjByePkt = new RtcpByePacket();
if (m_pobjByePkt == nullptr)
{
@@ -293,6 +299,9 @@ eRTP_STATUS_CODE RtcpPacket::decodeRtcpPacket(IN RtpBuffer* pobjRtcpPktBuf,
case RTCP_APP:
{
RTP_TRACE_MESSAGE("[DecodeRtcpPacket] Decoding RTCP_APP", 0, 0);
+ if (m_pobjAppPkt != nullptr)
+ delete m_pobjAppPkt;
+
m_pobjAppPkt = new RtcpAppPacket();
if (m_pobjAppPkt == nullptr)
{
@@ -321,11 +330,30 @@ eRTP_STATUS_CODE RtcpPacket::decodeRtcpPacket(IN RtpBuffer* pobjRtcpPktBuf,
bFbPkt = eRTP_TRUE;
break;
} // RTCP_RTPFB || RTCP_PSFB
+ case RTCP_XR:
+ {
+ RTP_TRACE_MESSAGE("[DecodeRtcpPacket] Decoding RTCP_XR", 0, 0);
+ if (m_pobjRtcpXrPkt != nullptr)
+ delete m_pobjRtcpXrPkt;
+
+ m_pobjRtcpXrPkt = new RtcpXrPacket();
+ if (m_pobjRtcpXrPkt == nullptr)
+ {
+ RTP_TRACE_ERROR("[Memory Error] new returned NULL.", RTP_ZERO, RTP_ZERO);
+ return RTP_MEMORY_FAIL;
+ }
+ m_pobjRtcpXrPkt->setRtcpHdrInfo(m_objHeader);
+ eDecodeRes = m_pobjRtcpXrPkt->decodeRtcpXrPacket(pucBuffer, usPktLen, uiPktType);
+ bOtherPkt = eRTP_TRUE;
+ break;
+ } // RTCP_XR
default:
{
- RTP_TRACE_WARNING(
- "[DecodeRtcpPacket], Invalid RTCP MSG type received", RTP_ZERO, RTP_ZERO);
- return RTP_INVALID_MSG;
+ RTP_TRACE_WARNING("[DecodeRtcpPacket], Invalid RTCP MSG type[%d] received",
+ uiPktType, RTP_ZERO);
+ // Instead of returning failure, ignore unknown report block and continue to decode
+ // next report block.
+ eDecodeRes = RTP_SUCCESS;
} // default
}; // switch