Browse Source

Rename getExt* to getExtensionHeader*

Asgeir Bjarni Ingvarsson 3 years ago
parent
commit
e64a0ef090
3 changed files with 10 additions and 10 deletions
  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]] uint32_t ssrc() const;
 
 
 	[[nodiscard]] size_t getSize() 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]] const char *getBody() const;
 	[[nodiscard]] char *getBody();
 	[[nodiscard]] char *getBody();
 
 

+ 6 - 6
src/rtp.cpp

@@ -56,15 +56,15 @@ size_t RTP::getSize() const {
 	       sizeof(SSRC) * csrcCount();
 	       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) {
 	if (header) {
 		return header->getSize() + sizeof(RTP_ExtensionHeader);
 		return header->getSize() + sizeof(RTP_ExtensionHeader);
 	}
 	}
 	return 0;
 	return 0;
 }
 }
 
 
-const RTP_ExtensionHeader *RTP::getExt() const {
+const RTP_ExtensionHeader *RTP::getExtensionHeader() const {
 	if (extension()) {
 	if (extension()) {
 		auto header = reinterpret_cast<const char *>(&_csrc) + sizeof(SSRC) * csrcCount();
 		auto header = reinterpret_cast<const char *>(&_csrc) + sizeof(SSRC) * csrcCount();
 		return reinterpret_cast<const RTP_ExtensionHeader *>(header);
 		return reinterpret_cast<const RTP_ExtensionHeader *>(header);
@@ -72,7 +72,7 @@ const RTP_ExtensionHeader *RTP::getExt() const {
 	return nullptr;
 	return nullptr;
 }
 }
 
 
-RTP_ExtensionHeader *RTP::getExt() {
+RTP_ExtensionHeader *RTP::getExtensionHeader() {
 	if (extension()) {
 	if (extension()) {
 		auto header = reinterpret_cast<char *>(&_csrc) + sizeof(SSRC) * csrcCount();
 		auto header = reinterpret_cast<char *>(&_csrc) + sizeof(SSRC) * csrcCount();
 		return reinterpret_cast<RTP_ExtensionHeader *>(header);
 		return reinterpret_cast<RTP_ExtensionHeader *>(header);
@@ -81,10 +81,10 @@ RTP_ExtensionHeader *RTP::getExt() {
 }
 }
 
 
 const char *RTP::getBody() const {
 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); }
 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) {
 	if (rtpExtHeaderSize) {
 		rtp->setExtension(true);
 		rtp->setExtension(true);
 
 
-		auto extHeader = rtp->getExt();
+		auto extHeader = rtp->getExtensionHeader();
 		extHeader->setProfileSpecificId(0xbede);
 		extHeader->setProfileSpecificId(0xbede);
 		extHeader->setHeaderLength(1);
 		extHeader->setHeaderLength(1);
 		extHeader->clearBody();
 		extHeader->clearBody();