Register video rtp header extensions in rtp_rtcp by uri
Remove function for converting uri into ExtensionType This removes one of the lists of all supported extensions Bug: webrtc:7472 Change-Id: I0c27239d91ef14ca4a3aa0c00588fa2b9cf10e0c Reviewed-on: https://webrtc-review.googlesource.com/100523 Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24752}
This commit is contained in:
parent
4e193e4f76
commit
585d1aac17
@ -223,8 +223,7 @@ RtpVideoSender::RtpVideoSender(
|
||||
RTC_DCHECK_LE(id, 14);
|
||||
RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension));
|
||||
for (auto& rtp_rtcp : rtp_modules_) {
|
||||
RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension(
|
||||
StringToRtpExtensionType(extension), id));
|
||||
RTC_CHECK(rtp_rtcp->RegisterRtpHeaderExtension(extension, id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@ class RtcEventLog;
|
||||
class Transport;
|
||||
class VideoBitrateAllocationObserver;
|
||||
|
||||
RTPExtensionType StringToRtpExtensionType(const std::string& extension);
|
||||
|
||||
namespace rtcp {
|
||||
class TransportFeedback;
|
||||
}
|
||||
@ -142,6 +140,8 @@ class RtpRtcp : public Module, public RtcpFeedbackSenderInterface {
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RegisterSendRtpHeaderExtension(RTPExtensionType type,
|
||||
uint8_t id) = 0;
|
||||
// Register extension by uri, returns false on failure.
|
||||
virtual bool RegisterRtpHeaderExtension(const std::string& uri, int id) = 0;
|
||||
|
||||
virtual int32_t DeregisterSendRtpHeaderExtension(RTPExtensionType type) = 0;
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@ class MockRtpRtcp : public RtpRtcp {
|
||||
MOCK_METHOD1(DeRegisterSendPayload, int32_t(int8_t payload_type));
|
||||
MOCK_METHOD2(RegisterSendRtpHeaderExtension,
|
||||
int32_t(RTPExtensionType type, uint8_t id));
|
||||
MOCK_METHOD2(RegisterRtpHeaderExtension,
|
||||
bool(const std::string& uri, int id));
|
||||
MOCK_METHOD1(DeregisterSendRtpHeaderExtension,
|
||||
int32_t(RTPExtensionType type));
|
||||
MOCK_CONST_METHOD0(HasBweExtensions, bool());
|
||||
|
||||
@ -33,31 +33,6 @@ const int64_t kRtpRtcpBitrateProcessTimeMs = 10;
|
||||
const int64_t kDefaultExpectedRetransmissionTimeMs = 125;
|
||||
} // namespace
|
||||
|
||||
RTPExtensionType StringToRtpExtensionType(const std::string& extension) {
|
||||
if (extension == RtpExtension::kTimestampOffsetUri)
|
||||
return kRtpExtensionTransmissionTimeOffset;
|
||||
if (extension == RtpExtension::kAudioLevelUri)
|
||||
return kRtpExtensionAudioLevel;
|
||||
if (extension == RtpExtension::kAbsSendTimeUri)
|
||||
return kRtpExtensionAbsoluteSendTime;
|
||||
if (extension == RtpExtension::kVideoRotationUri)
|
||||
return kRtpExtensionVideoRotation;
|
||||
if (extension == RtpExtension::kTransportSequenceNumberUri)
|
||||
return kRtpExtensionTransportSequenceNumber;
|
||||
if (extension == RtpExtension::kPlayoutDelayUri)
|
||||
return kRtpExtensionPlayoutDelay;
|
||||
if (extension == RtpExtension::kVideoContentTypeUri)
|
||||
return kRtpExtensionVideoContentType;
|
||||
if (extension == RtpExtension::kVideoTimingUri)
|
||||
return kRtpExtensionVideoTiming;
|
||||
if (extension == RtpExtension::kFrameMarkingUri)
|
||||
return kRtpExtensionFrameMarking;
|
||||
if (extension == RtpExtension::kMidUri)
|
||||
return kRtpExtensionMid;
|
||||
RTC_NOTREACHED() << "Looking up unsupported RTP extension.";
|
||||
return kRtpExtensionNone;
|
||||
}
|
||||
|
||||
RtpRtcp::Configuration::Configuration() = default;
|
||||
|
||||
RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) {
|
||||
@ -642,6 +617,11 @@ int32_t ModuleRtpRtcpImpl::RegisterSendRtpHeaderExtension(
|
||||
return rtp_sender_->RegisterRtpHeaderExtension(type, id);
|
||||
}
|
||||
|
||||
bool ModuleRtpRtcpImpl::RegisterRtpHeaderExtension(const std::string& uri,
|
||||
int id) {
|
||||
return rtp_sender_->RegisterRtpHeaderExtension(uri, id);
|
||||
}
|
||||
|
||||
int32_t ModuleRtpRtcpImpl::DeregisterSendRtpHeaderExtension(
|
||||
const RTPExtensionType type) {
|
||||
return rtp_sender_->DeregisterRtpHeaderExtension(type);
|
||||
|
||||
@ -62,6 +62,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
|
||||
// Register RTP header extension.
|
||||
int32_t RegisterSendRtpHeaderExtension(RTPExtensionType type,
|
||||
uint8_t id) override;
|
||||
bool RegisterRtpHeaderExtension(const std::string& uri, int id) override;
|
||||
|
||||
int32_t DeregisterSendRtpHeaderExtension(RTPExtensionType type) override;
|
||||
|
||||
|
||||
@ -238,6 +238,11 @@ int32_t RTPSender::RegisterRtpHeaderExtension(RTPExtensionType type,
|
||||
return rtp_header_extension_map_.RegisterByType(id, type) ? 0 : -1;
|
||||
}
|
||||
|
||||
bool RTPSender::RegisterRtpHeaderExtension(const std::string& uri, int id) {
|
||||
rtc::CritScope lock(&send_critsect_);
|
||||
return rtp_header_extension_map_.RegisterByUri(id, uri);
|
||||
}
|
||||
|
||||
bool RTPSender::IsRtpHeaderExtensionRegistered(RTPExtensionType type) const {
|
||||
rtc::CritScope lock(&send_critsect_);
|
||||
return rtp_header_extension_map_.IsRegistered(type);
|
||||
|
||||
@ -116,6 +116,7 @@ class RTPSender {
|
||||
|
||||
// RTP header extension
|
||||
int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
|
||||
bool RegisterRtpHeaderExtension(const std::string& uri, int id);
|
||||
bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) const;
|
||||
int32_t DeregisterRtpHeaderExtension(RTPExtensionType type);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user