Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ging/licode
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague committed Sep 15, 2017
2 parents 88b14c9 + a6c6104 commit 3997dd0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class SenderBandwidthEstimationHandler : public Handler,

private:
WebRtcConnection* connection_;
std::shared_ptr<RtcpProcessor> processor_;
SenderBandwidthEstimationListener* bwe_listener_;
std::shared_ptr<Clock> clock_;
bool initialized_;
Expand Down
14 changes: 7 additions & 7 deletions erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,18 @@ const BaseStack = (specInput) => {
localDesc.sdp = SdpHelpers.setMaxBW(localDesc.sdp, specBase);
if (config.Sdp || config.maxAudioBW) {
Logger.debug('Updating with SDP renegotiation', specBase.maxVideoBW, specBase.maxAudioBW);
that.peerConnection.setLocalDescription(localDesc).then(() => {
remoteDesc.sdp = SdpHelpers.setMaxBW(remoteDesc.sdp, specBase);
that.peerConnection.setRemoteDescription(new RTCSessionDescription(remoteDesc))
that.peerConnection.setLocalDescription(localDesc)
.then(() => {
remoteDesc.sdp = SdpHelpers.setMaxBW(remoteDesc.sdp, specBase);
return that.peerConnection.setRemoteDescription(new RTCSessionDescription(remoteDesc));
}).then(() => {
specBase.remoteDescriptionSet = true;
specBase.callback({ type: 'updatestream', sdp: localDesc.sdp });
}).catch(errorCallback.bind(null, 'updateSpec', undefined));
}).catch(errorCallback.bind(null, 'updateSpec', callback));
}).catch(errorCallback.bind(null, 'updateSpec', callback));
} else {
Logger.debug('Updating without SDP renegotiation, ' +
'newVideoBW:', specBase.maxVideoBW,
'newAudioBW:', specBase.maxAudioBW);
'newVideoBW:', specBase.maxVideoBW,
'newAudioBW:', specBase.maxAudioBW);
specBase.callback({ type: 'updatestream', sdp: localDesc.sdp });
}
}
Expand Down

0 comments on commit 3997dd0

Please sign in to comment.