Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc

Issue 1743543003: RtpRtcp allows to register header extension by name (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index 7f33bc2ee57c1dc2b44aeade3feaaaf87f8072a2..9cebda9287b9c98e4027f1c1c7755c2145f4c739 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -17,6 +17,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/common_types.h"
+#include "webrtc/config.h"
#include "webrtc/system_wrappers/include/trace.h"
#ifdef _WIN32
@@ -25,6 +26,22 @@
#endif
namespace webrtc {
+namespace {
+RTPExtensionType StringToRtpExtensionType(const std::string& extension) {
+ if (extension == RtpExtension::kTOffset)
+ return kRtpExtensionTransmissionTimeOffset;
+ if (extension == RtpExtension::kAudioLevel)
+ return kRtpExtensionAudioLevel;
+ if (extension == RtpExtension::kAbsSendTime)
+ return kRtpExtensionAbsoluteSendTime;
+ if (extension == RtpExtension::kVideoRotation)
+ return kRtpExtensionVideoRotation;
+ if (extension == RtpExtension::kTransportSequenceNumber)
+ return kRtpExtensionTransportSequenceNumber;
+ RTC_NOTREACHED() << "Looking up unsupported RTP extension.";
+ return kRtpExtensionNone;
+}
+} // namespace
RtpRtcp::Configuration::Configuration()
: audio(false),
@@ -659,6 +676,12 @@ int32_t ModuleRtpRtcpImpl::RegisterSendRtpHeaderExtension(
return rtp_sender_.RegisterRtpHeaderExtension(type, id);
}
+bool ModuleRtpRtcpImpl::RegisterRtpHeaderExtension(const std::string& type,
+ const uint8_t id) {
+ return rtp_sender_.RegisterRtpHeaderExtension(StringToRtpExtensionType(type),
+ id) == 0;
+}
+
int32_t ModuleRtpRtcpImpl::DeregisterSendRtpHeaderExtension(
const RTPExtensionType type) {
return rtp_sender_.DeregisterRtpHeaderExtension(type);
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698