Skip to content

Commit

Permalink
Add support to Screensharing and h264 simulcast (#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Jul 6, 2018
1 parent 18c5562 commit 24c955a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
2 changes: 2 additions & 0 deletions erizo/src/erizo/SdpInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace erizo {
videoSdpMLine = -1;
audioSdpMLine = -1;
videoBandwidth = 0;
google_conference_flag_set = "";
}

SdpInfo::~SdpInfo() {
Expand Down Expand Up @@ -513,6 +514,7 @@ namespace erizo {
this->bundleTags = offerSdp->bundleTags;
this->extMapVector = offerSdp->extMapVector;
this->rids_ = offerSdp->rids();
this->google_conference_flag_set = offerSdp->google_conference_flag_set;
for (auto& rid : rids_) {
rid.direction = reverse(rid.direction);
}
Expand Down
1 change: 1 addition & 0 deletions erizo/src/erizo/SdpInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class SdpInfo {
std::map<unsigned int, RtpMap> payload_parsed_map_;
std::vector<ExtMap> supported_ext_map_;
std::vector<Rid> rids_;
std::string google_conference_flag_set;

private:
bool processSdp(const std::string& sdp, const std::string& media);
Expand Down
4 changes: 4 additions & 0 deletions erizo/src/erizo/rtp/LayerDetectorHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ void LayerDetectorHandler::parseLayerInfoFromH264(std::shared_ptr<DataPacket> pa
packet->is_keyframe = false;
}

addTemporalLayerAndCalculateRate(packet, 0, payload->start_bit);

notifyLayerInfoChangedEventMaybe();

delete payload;
}

Expand Down
13 changes: 13 additions & 0 deletions erizoAPI/ConnectionDescription.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ NAN_MODULE_INIT(ConnectionDescription::Init) {
Nan::SetPrototypeMethod(tpl, "setVideoBandwidth", setVideoBandwidth);
Nan::SetPrototypeMethod(tpl, "getVideoBandwidth", getVideoBandwidth);

Nan::SetPrototypeMethod(tpl, "setXGoogleFlag", setXGoogleFlag);
Nan::SetPrototypeMethod(tpl, "getXGoogleFlag", getXGoogleFlag);

Nan::SetPrototypeMethod(tpl, "addCandidate", addCandidate);
Nan::SetPrototypeMethod(tpl, "addCryptoInfo", addCryptoInfo);
Nan::SetPrototypeMethod(tpl, "setICECredentials", setICECredentials);
Expand Down Expand Up @@ -426,6 +429,16 @@ NAN_METHOD(ConnectionDescription::getVideoBandwidth) {
info.GetReturnValue().Set(Nan::New(sdp->videoBandwidth));
}

NAN_METHOD(ConnectionDescription::setXGoogleFlag) {
GET_SDP();
sdp->google_conference_flag_set = getString(info[0]);
}

NAN_METHOD(ConnectionDescription::getXGoogleFlag) {
GET_SDP();
info.GetReturnValue().Set(Nan::New(sdp->google_conference_flag_set.c_str()).ToLocalChecked());
}

NAN_METHOD(ConnectionDescription::addCandidate) {
GET_SDP();
erizo::CandidateInfo cand;
Expand Down
3 changes: 3 additions & 0 deletions erizoAPI/ConnectionDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class ConnectionDescription : public Nan::ObjectWrap {
static NAN_METHOD(setVideoBandwidth);
static NAN_METHOD(getVideoBandwidth);

static NAN_METHOD(setXGoogleFlag);
static NAN_METHOD(getXGoogleFlag);

static NAN_METHOD(addCandidate);
static NAN_METHOD(addCryptoInfo);
static NAN_METHOD(setICECredentials);
Expand Down
8 changes: 7 additions & 1 deletion erizo_controller/erizoJS/models/SessionDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ function getMediaInfoFromDescription(info, sdp, mediaType) {
simulcast.setSimulcastPlainString(direction + ' rid=' + ridsData.join(';'));
media.simulcast_03 = simulcast;
}

if (info.getXGoogleFlag() && info.getXGoogleFlag() !== '') {
media.setXGoogleFlag(info.getXGoogleFlag());
}
}
return media;
}
Expand Down Expand Up @@ -329,6 +331,10 @@ class SessionDescription {
media.getExtensions().forEach((uri, value) => {
info.addExtension(value, uri, media.getType());
});

if (media.getXGoogleFlag() && media.getXGoogleFlag() !== '') {
info.setXGoogleFlag(media.getXGoogleFlag());
}
});
info.setAudioAndVideo(audio !== undefined, video !== undefined);

Expand Down

1 comment on commit 24c955a

@kekkokk
Copy link
Contributor

@kekkokk kekkokk commented on 24c955a Jul 6, 2018

Choose a reason for hiding this comment

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

How did you tested h264 simulcast???

Please sign in to comment.