зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337468: pass RID values via RTP configuration r=ng
MozReview-Commit-ID: Gl5TdZkJIZ8 --HG-- extra : rebase_source : 296d74fcfee7535b052e8f97ba65f0c67afbb129
This commit is contained in:
Родитель
d03b7e603e
Коммит
30a3f082fd
|
@ -578,6 +578,7 @@ WebrtcVideoConduit::ConfigureSendMediaCodec(const VideoCodecConfig* codecConfig)
|
||||||
video_stream.max_qp = kQpMax;
|
video_stream.max_qp = kQpMax;
|
||||||
simulcast_config.jsScaleDownBy = simulcastEncoding.constraints.scaleDownBy;
|
simulcast_config.jsScaleDownBy = simulcastEncoding.constraints.scaleDownBy;
|
||||||
simulcast_config.jsMaxBitrate = simulcastEncoding.constraints.maxBr; // bps
|
simulcast_config.jsMaxBitrate = simulcastEncoding.constraints.maxBr; // bps
|
||||||
|
mSendStreamConfig.rtp.rids.push_back(simulcastEncoding.rid);
|
||||||
|
|
||||||
if (codecConfig->mName == "H264") {
|
if (codecConfig->mName == "H264") {
|
||||||
if (codecConfig->mEncodingConstraints.maxMbps > 0) {
|
if (codecConfig->mEncodingConstraints.maxMbps > 0) {
|
||||||
|
|
|
@ -204,6 +204,10 @@ RTPSender::~RTPSender() {
|
||||||
delete it->second;
|
delete it->second;
|
||||||
payload_type_map_.erase(it);
|
payload_type_map_.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rid_) {
|
||||||
|
delete[] rid_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTPSender::SetTargetBitrate(uint32_t bitrate) {
|
void RTPSender::SetTargetBitrate(uint32_t bitrate) {
|
||||||
|
|
|
@ -185,7 +185,8 @@ VideoSendStream::VideoSendStream(
|
||||||
} else if (extension == RtpExtension::kTransportSequenceNumber) {
|
} else if (extension == RtpExtension::kTransportSequenceNumber) {
|
||||||
RTC_CHECK_EQ(0, vie_channel_->SetSendTransportSequenceNumber(true, id));
|
RTC_CHECK_EQ(0, vie_channel_->SetSendTransportSequenceNumber(true, id));
|
||||||
} else if (extension == RtpExtension::kRtpStreamId) {
|
} else if (extension == RtpExtension::kRtpStreamId) {
|
||||||
RTC_CHECK_EQ(0, vie_channel_->SetSendRtpStreamId(true,id));
|
RTC_CHECK_EQ(ssrcs.size(), config_.rtp.rids.size());
|
||||||
|
RTC_CHECK_EQ(0, vie_channel_->SetSendRtpStreamId(true,id,config_.rtp.rids));
|
||||||
} else {
|
} else {
|
||||||
RTC_NOTREACHED() << "Registering unsupported RTP extension.";
|
RTC_NOTREACHED() << "Registering unsupported RTP extension.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -655,23 +655,24 @@ int ViEChannel::SetReceiveTransportSequenceNumber(bool enable, int id) {
|
||||||
return vie_receiver_.SetReceiveTransportSequenceNumber(enable, id) ? 0 : -1;
|
return vie_receiver_.SetReceiveTransportSequenceNumber(enable, id) ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ViEChannel::SetSendRtpStreamId(bool enable, int id) { //}, const char *rid)
|
int ViEChannel::SetSendRtpStreamId(bool enable, int id,
|
||||||
CriticalSectionScoped cs(crit_.get());
|
std::vector<std::string> rids) {
|
||||||
|
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
|
||||||
|
rtp_rtcp->DeregisterSendRtpHeaderExtension(
|
||||||
|
kRtpExtensionRtpStreamId);
|
||||||
|
}
|
||||||
|
if (!enable) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int error = 0;
|
int error = 0;
|
||||||
if (enable) {
|
unsigned long i = 0;
|
||||||
// Enable the extension, but disable possible old id to avoid errors.
|
// Enable the extension
|
||||||
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
|
// NOTE: simulcast streams must be set via the SetSendCodec() API
|
||||||
rtp_rtcp->DeregisterSendRtpHeaderExtension(
|
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
|
||||||
kRtpExtensionRtpStreamId);
|
error |= rtp_rtcp->RegisterSendRtpHeaderExtension(
|
||||||
error = rtp_rtcp->RegisterSendRtpHeaderExtension(
|
kRtpExtensionRtpStreamId, id);
|
||||||
kRtpExtensionRtpStreamId, id);
|
if (rids.size() > i) {
|
||||||
}
|
rtp_rtcp->SetRID(rids[i++].c_str());
|
||||||
// NOTE: simulcast streams must be set via the SetSendCodec() API
|
|
||||||
} else {
|
|
||||||
// Disable the extension.
|
|
||||||
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
|
|
||||||
rtp_rtcp->DeregisterSendRtpHeaderExtension(
|
|
||||||
kRtpExtensionRtpStreamId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -113,8 +113,8 @@ class ViEChannel : public VCMFrameTypeCallback,
|
||||||
int SetReceiveVideoRotationStatus(bool enable, int id);
|
int SetReceiveVideoRotationStatus(bool enable, int id);
|
||||||
int SetSendTransportSequenceNumber(bool enable, int id);
|
int SetSendTransportSequenceNumber(bool enable, int id);
|
||||||
int SetReceiveTransportSequenceNumber(bool enable, int id);
|
int SetReceiveTransportSequenceNumber(bool enable, int id);
|
||||||
int SetSendRtpStreamId(bool enable, int id); // RtpStreamId (RID)
|
int SetSendRtpStreamId(bool enable, int id, std::vector<std::string> rids);
|
||||||
int SetReceiveRtpStreamId(bool enable, int id); // RtpStreamId (RID)
|
int SetReceiveRtpStreamId(bool enable, int id);
|
||||||
void SetRtcpXrRrtrStatus(bool enable);
|
void SetRtcpXrRrtrStatus(bool enable);
|
||||||
void EnableTMMBR(bool enable);
|
void EnableTMMBR(bool enable);
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,8 @@ class VideoSendStream : public SendStream {
|
||||||
|
|
||||||
// RTCP CNAME, see RFC 3550.
|
// RTCP CNAME, see RFC 3550.
|
||||||
std::string c_name;
|
std::string c_name;
|
||||||
|
|
||||||
|
std::vector<std::string> rids;
|
||||||
} rtp;
|
} rtp;
|
||||||
|
|
||||||
// Transport for outgoing packets.
|
// Transport for outgoing packets.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче