Bug 1300665: Add abs-send-time and toffset header extension usage and negotiation r=bwc

MozReview-Commit-ID: 3h9C8XziNky
This commit is contained in:
Randell Jesup 2017-02-09 20:56:29 -05:00
Родитель 6286ec73d4
Коммит aee89e79af
6 изменённых файлов: 37 добавлений и 22 удалений

Просмотреть файл

@ -2292,6 +2292,11 @@ JsepSessionImpl::SetupDefaultRtpExtensions()
{
AddAudioRtpExtension("urn:ietf:params:rtp-hdrext:ssrc-audio-level",
SdpDirectionAttribute::Direction::kSendonly);
AddVideoRtpExtension(
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
SdpDirectionAttribute::Direction::kSendrecv);
AddVideoRtpExtension("urn:ietf:params:rtp-hdrext:toffset",
SdpDirectionAttribute::Direction::kSendrecv);
}
void

Просмотреть файл

@ -339,13 +339,15 @@ public:
/**
* Adds negotiated RTP extensions
* XXX Move to MediaSessionConduit
*/
virtual void AddLocalRTPExtensions(const std::vector<webrtc::RtpExtension>& extensions) = 0;
virtual void AddLocalRTPExtensions(bool aIsSend,
const std::vector<webrtc::RtpExtension>& extensions) = 0;
/**
* Returns the negotiated RTP extensions
*/
virtual std::vector<webrtc::RtpExtension> GetLocalRTPExtensions() const = 0;
virtual std::vector<webrtc::RtpExtension> GetLocalRTPExtensions(bool aIsSend) const = 0;
/**

Просмотреть файл

@ -241,10 +241,11 @@ WebrtcVideoConduit::~WebrtcVideoConduit()
}
void
WebrtcVideoConduit::AddLocalRTPExtensions(
WebrtcVideoConduit::AddLocalRTPExtensions(bool aIsSend,
const std::vector<webrtc::RtpExtension> & aExtensions)
{
auto& extList = mSendStreamConfig.rtp.extensions;
auto& extList = aIsSend ? mSendStreamConfig.rtp.extensions :
mRecvStreamConfig.rtp.extensions;
std::remove_if(extList.begin(), extList.end(), [&](const webrtc::RtpExtension & i) {
return std::find(aExtensions.begin(), aExtensions.end(),i) != aExtensions.end();
});
@ -252,9 +253,9 @@ WebrtcVideoConduit::AddLocalRTPExtensions(
}
std::vector<webrtc::RtpExtension>
WebrtcVideoConduit::GetLocalRTPExtensions() const
WebrtcVideoConduit::GetLocalRTPExtensions(bool aIsSend) const
{
return mSendStreamConfig.rtp.extensions;
return aIsSend ? mSendStreamConfig.rtp.extensions : mRecvStreamConfig.rtp.extensions;
}
bool WebrtcVideoConduit::SetLocalSSRCs(const std::vector<unsigned int> & aSSRCs)

Просмотреть файл

@ -81,8 +81,9 @@ public:
* TODO(@@NG) promote this the MediaConduitInterface when the VoE rework
* hits Webrtc.org.
*/
void AddLocalRTPExtensions(const std::vector<webrtc::RtpExtension>& extensions) override;
std::vector<webrtc::RtpExtension> GetLocalRTPExtensions() const override;
void AddLocalRTPExtensions(bool aIsSend,
const std::vector<webrtc::RtpExtension>& extensions) override;
std::vector<webrtc::RtpExtension> GetLocalRTPExtensions(bool aIsSend) const override;
/**
* Set up A/V sync between this (incoming) VideoConduit and an audio conduit.

Просмотреть файл

@ -817,6 +817,17 @@ MediaPipelineFactory::GetOrCreateVideoConduit(
const std::vector<uint32_t>* ssrcs;
const JsepTrackNegotiatedDetails* details = aTrack.GetNegotiatedDetails();
std::vector<webrtc::RtpExtension> extmaps;
if (details) {
// @@NG read extmap from track
details->ForEachRTPHeaderExtension(
[&extmaps](const SdpExtmapAttributeList::Extmap& extmap)
{
extmaps.emplace_back(extmap.extensionname,extmap.entry);
});
}
if (receiving) {
// NOTE(pkerr) - the Call API requires the both local_ssrc and remote_ssrc be
// set to a non-zero value or the CreateVideo...Stream call will fail.
@ -844,6 +855,9 @@ MediaPipelineFactory::GetOrCreateVideoConduit(
}
conduit->SetRemoteSSRC(ssrcs->front());
if (!extmaps.empty()) {
conduit->AddLocalRTPExtensions(false, extmaps);
}
auto error = conduit->ConfigureRecvMediaCodecs(configs.values);
if (error) {
MOZ_MTLOG(ML_ERROR, "ConfigureRecvMediaCodecs failed: " << error);
@ -869,26 +883,16 @@ MediaPipelineFactory::GetOrCreateVideoConduit(
return rv;
}
if (!extmaps.empty()) {
conduit->AddLocalRTPExtensions(true, extmaps);
}
auto error = conduit->ConfigureSendMediaCodec(configs.values[0]);
if (error) {
MOZ_MTLOG(ML_ERROR, "ConfigureSendMediaCodec failed: " << error);
return NS_ERROR_FAILURE;
}
}
const JsepTrackNegotiatedDetails* details = aTrack.GetNegotiatedDetails();
if (details) {
// @@NG read extmap from track
std::vector<webrtc::RtpExtension> extmaps;
details->ForEachRTPHeaderExtension(
[&conduit,&extmaps](const SdpExtmapAttributeList::Extmap& extmap)
{
extmaps.emplace_back(extmap.extensionname,extmap.entry);
});
conduit->AddLocalRTPExtensions(extmaps);
}
*aConduitp = conduit;
return NS_OK;

Просмотреть файл

@ -336,7 +336,9 @@ void RtpHeaderParser::ParseOneByteExtensionHeader(
RTPExtensionType type;
if (ptrExtensionMap->GetType(id, &type) != 0) {
// If we encounter an unknown extension, just skip over it.
LOG(LS_INFO) << "Failed to find extension id: " << id;
// Mozilla - we reuse the parse for demux, without registering extensions.
// Reduce log-spam by switching to VERBOSE
LOG(LS_VERBOSE) << "Failed to find extension id: " << id;
} else {
switch (type) {
case kRtpExtensionTransmissionTimeOffset: {