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

Apply maxVideoBW also to subscribers #1030

Merged
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
2 changes: 1 addition & 1 deletion doc/client_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ It gets the URL of an image frame from the video.

## Update the spec of a stream

It updates the audio and video maximum bandwidth for a publisher.
It updates the audio and video maximum bandwidth for a publisher or a subscriber (it will affect other subscribers when Simulcast is not used).

It can also be used in remote streams to toggle `slideShowMode`

Expand Down
1 change: 0 additions & 1 deletion erizo/src/erizo/rtp/RtcpAggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ int RtcpAggregator::analyzeFeedback(char *buf, int len) {
return 0;
}


void RtcpAggregator::checkRtcpFb() {
boost::mutex::scoped_lock mlock(mapLock_);
std::map<uint32_t, boost::shared_ptr<RtcpData>>::iterator it;
Expand Down
1 change: 0 additions & 1 deletion erizo/src/erizo/rtp/RtcpForwarder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ int RtcpForwarder::analyzeFeedback(char *buf, int len) {
return 0;
}


void RtcpForwarder::checkRtcpFb() {
}

Expand Down
10 changes: 5 additions & 5 deletions erizo/src/erizo/rtp/RtcpForwarder.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class RtcpForwarder: public RtcpProcessor{
public:
RtcpForwarder(MediaSink* msink, MediaSource* msource, uint32_t max_video_bw = 300000);
virtual ~RtcpForwarder() {}
void addSourceSsrc(uint32_t ssrc);
void setPublisherBW(uint32_t bandwidth);
void analyzeSr(RtcpHeader* chead);
int analyzeFeedback(char* buf, int len);
void checkRtcpFb();
void addSourceSsrc(uint32_t ssrc) override;
void setPublisherBW(uint32_t bandwidth) override;
void analyzeSr(RtcpHeader* chead) override;
int analyzeFeedback(char* buf, int len) override;
void checkRtcpFb() override;

private:
static const int RR_AUDIO_PERIOD = 2000;
Expand Down
8 changes: 6 additions & 2 deletions erizo/src/erizo/rtp/SenderBandwidthEstimantionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void SenderBandwidthEstimationHandler::notifyUpdate() {
auto pipeline = getContext()->getPipelineShared();
if (pipeline && !connection_) {
connection_ = pipeline->getService<WebRtcConnection>().get();
processor_ = pipeline->getService<RtcpProcessor>();
}
if (!connection_) {
return;
Expand Down Expand Up @@ -117,9 +118,12 @@ void SenderBandwidthEstimationHandler::read(Context *ctx, std::shared_ptr<DataPa
received_remb_ = true;
int64_t now_ms = ClockUtils::timePointToMs(clock_->now());
uint64_t bitrate = chead->getBrMantis() << chead->getBrExp();
uint64_t cappedBitrate = bitrate < processor_->getMaxVideoBW() ? bitrate : processor_->getMaxVideoBW();
chead->setREMBBitRate(cappedBitrate);

ELOG_DEBUG("%s message: Updating Estimate with REMB, bitrate %lu", connection_->toLog(),
bitrate);
sender_bwe_->UpdateReceiverEstimate(now_ms, bitrate);
cappedBitrate);
sender_bwe_->UpdateReceiverEstimate(now_ms, cappedBitrate);
updateEstimate();
} else {
ELOG_DEBUG("%s message: Unsupported AFB Packet not REMB", connection_->toLog());
Expand Down
1 change: 1 addition & 0 deletions erizo/src/erizo/rtp/SenderBandwidthEstimationHandler.h