Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RTCP SR timestamps in Simulcast #1489

Merged
merged 2 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions erizo/src/erizo/OneToManyProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace erizo {
RtcpHeader* chead = reinterpret_cast<RtcpHeader*>(audio_packet->data);
for (it = subscribers.begin(); it != subscribers.end(); ++it) {
if ((*it).second != nullptr) {
// Hack to avoid audio drifting in Chrome.
if (chead->isRtcp() && chead->isSDES()) {
if (chead->isRtcp()) {
chead->setSSRC((*it).second->getAudioSinkSSRC());
} else {
head->setSSRC((*it).second->getAudioSinkSSRC());
Expand Down
8 changes: 6 additions & 2 deletions erizo/src/erizo/rtp/QualityFilterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,14 @@ void QualityFilterHandler::write(Context *ctx, std::shared_ptr<DataPacket> packe
tl0_pic_idx_sent : last_tl0_pic_idx_sent_;
updateTL0PicIdx(packet, tl0_pic_idx_sent);
// removeVP8OptionalPayload(packet); // TODO(javier): uncomment this line in case of issues with pictureId
} else if (is_scalable_ && enabled_ && chead->isRtcp() && chead->isSenderReport()) {
uint32_t ssrc = chead->getSSRC();
if (video_sink_ssrc_ == ssrc) {
uint32_t sr_timestamp = chead->getTimestamp();
chead->setTimestamp(sr_timestamp + timestamp_offset_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍

}
}

// TODO(javier): Handle SRs?

ctx->fireWrite(packet);
}

Expand Down
6 changes: 6 additions & 0 deletions erizo/src/erizo/rtp/RtpHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ class RtcpHeader {
uint64_t middle = (report.senderReport.ntptimestamp << 16) >> 32;
return ntohl(middle);
}
inline void setTimestamp(uint32_t timestamp) {
report.senderReport.rtprts = htonl(timestamp);
}
inline uint32_t getTimestamp() {
return ntohl(report.senderReport.rtprts);
}
inline uint16_t getNackPid() {
return report.nackPacket.nack_block.getNackPid();
}
Expand Down