瀏覽代碼

Rename getExt* to getExtensionHeader*

Asgeir Bjarni Ingvarsson 3 年之前
父節點
當前提交
e64a0ef090
共有 3 個文件被更改,包括 10 次插入10 次删除
  1. 3 3
      include/rtc/rtp.hpp
  2. 6 6
      src/rtp.cpp
  3. 1 1
      src/rtppacketizer.cpp

+ 3 - 3
include/rtc/rtp.hpp

@@ -68,9 +68,9 @@ struct RTC_CPP_EXPORT RTP {
 	[[nodiscard]] uint32_t ssrc() const;
 
 	[[nodiscard]] size_t getSize() const;
-	[[nodiscard]] size_t getExtSize() const;
-	[[nodiscard]] const RTP_ExtensionHeader *getExt() const;
-	[[nodiscard]] RTP_ExtensionHeader *getExt();
+	[[nodiscard]] size_t getExtensionHeaderSize() const;
+	[[nodiscard]] const RTP_ExtensionHeader *getExtensionHeader() const;
+	[[nodiscard]] RTP_ExtensionHeader *getExtensionHeader();
 	[[nodiscard]] const char *getBody() const;
 	[[nodiscard]] char *getBody();
 

+ 6 - 6
src/rtp.cpp

@@ -56,15 +56,15 @@ size_t RTP::getSize() const {
 	       sizeof(SSRC) * csrcCount();
 }
 
-size_t RTP::getExtSize() const {
-	auto header = reinterpret_cast<const RTP_ExtensionHeader *>(getExt());
+size_t RTP::getExtensionHeaderSize() const {
+	auto header = reinterpret_cast<const RTP_ExtensionHeader *>(getExtensionHeader());
 	if (header) {
 		return header->getSize() + sizeof(RTP_ExtensionHeader);
 	}
 	return 0;
 }
 
-const RTP_ExtensionHeader *RTP::getExt() const {
+const RTP_ExtensionHeader *RTP::getExtensionHeader() const {
 	if (extension()) {
 		auto header = reinterpret_cast<const char *>(&_csrc) + sizeof(SSRC) * csrcCount();
 		return reinterpret_cast<const RTP_ExtensionHeader *>(header);
@@ -72,7 +72,7 @@ const RTP_ExtensionHeader *RTP::getExt() const {
 	return nullptr;
 }
 
-RTP_ExtensionHeader *RTP::getExt() {
+RTP_ExtensionHeader *RTP::getExtensionHeader() {
 	if (extension()) {
 		auto header = reinterpret_cast<char *>(&_csrc) + sizeof(SSRC) * csrcCount();
 		return reinterpret_cast<RTP_ExtensionHeader *>(header);
@@ -81,10 +81,10 @@ RTP_ExtensionHeader *RTP::getExt() {
 }
 
 const char *RTP::getBody() const {
-	return reinterpret_cast<const char *>(&_csrc) + sizeof(SSRC) * csrcCount() + getExtSize();
+	return reinterpret_cast<const char *>(&_csrc) + sizeof(SSRC) * csrcCount() + getExtensionHeaderSize();
 }
 
-char *RTP::getBody() { return reinterpret_cast<char *>(&_csrc) + sizeof(SSRC) * csrcCount() + getExtSize(); }
+char *RTP::getBody() { return reinterpret_cast<char *>(&_csrc) + sizeof(SSRC) * csrcCount() + getExtensionHeaderSize(); }
 
 void RTP::preparePacket() { _first |= (1 << 7); }
 

+ 1 - 1
src/rtppacketizer.cpp

@@ -49,7 +49,7 @@ binary_ptr RtpPacketizer::packetize(shared_ptr<binary> payload, bool setMark) {
 	if (rtpExtHeaderSize) {
 		rtp->setExtension(true);
 
-		auto extHeader = rtp->getExt();
+		auto extHeader = rtp->getExtensionHeader();
 		extHeader->setProfileSpecificId(0xbede);
 		extHeader->setHeaderLength(1);
 		extHeader->clearBody();