Skip to content

Commit

Permalink
RTSP and files play fix (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arri98 authored Jun 16, 2022
1 parent ad1ac9f commit 5410432
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions erizo/src/erizo/media/ExternalInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ int ExternalInput::init() {
decodedBuffer_.reset((unsigned char*) malloc(100000));
MediaInfo om;
om.processorType = PACKAGE_ONLY;
om.rtpVideoInfo.PT = VP8_90000_PT;
if (audio_st) {
if (audio_st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) {
ELOG_DEBUG("PCM U8");
Expand All @@ -134,6 +135,7 @@ int ExternalInput::init() {

om.processorType = RTP_ONLY;
om.videoCodec.codec = VIDEO_CODEC_VP8;
om.rtpVideoInfo.PT = VP8_90000_PT;
om.videoCodec.bitRate = 1000000;
om.videoCodec.width = st->codec->width;
om.videoCodec.height = st->codec->height;
Expand Down
4 changes: 2 additions & 2 deletions erizo/src/erizo/media/MediaProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ int OutputProcessor::packageAudio(unsigned char* inBuff, int inBuffLen, unsigned
int OutputProcessor::packageVideo(unsigned char* inBuff, int buffSize, unsigned char* outBuff,
long int pts) { // NOLINT
if (videoPackager == 0) {
ELOG_DEBUG("No se ha inicailizado el codec de output vídeo RTP");
ELOG_DEBUG("No se ha inicializado el codec de output vídeo RTP");
return -1;
}

Expand All @@ -509,7 +509,7 @@ int OutputProcessor::packageVideo(unsigned char* inBuff, int buffSize, unsigned
rtpHeader.setTimestamp(av_rescale(pts, 90000, 1000));
}
rtpHeader.setSSRC(55543);
rtpHeader.setPayloadType(96);
rtpHeader.setPayloadType(mediaInfo.rtpVideoInfo.PT);
memcpy(rtpBuffer_, &rtpHeader, rtpHeader.getHeaderLength());
memcpy(&rtpBuffer_[rtpHeader.getHeaderLength()], outBuff, outlen);

Expand Down
2 changes: 1 addition & 1 deletion erizo_controller/erizoJS/models/Publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class Source extends NodeClass {
if (this.ei && this.mediaStream.periodicPlis) {
clearInterval(this.mediaStream.periodicPlis);
this.mediaStream.periodicPlis = undefined;
} else {
} else if (this.mediaStream.setPeriodicKeyframeRequests) {
this.mediaStream.setPeriodicKeyframeRequests(false);
}
}
Expand Down
9 changes: 7 additions & 2 deletions erizo_controller/erizoJS/models/Subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ class Subscriber extends NodeClass {
Math.min(this.publisher.getMaxVideoBW(), this.maxVideoBW) : this.maxVideoBW;
this.maxVideoBW = updatedMaxVideoBW;
} else {
updatedMaxVideoBW = this.publisher.getMaxVideoBW();
// eslint-disable-next-line no-lonely-if
if (this.publisher.getMaxVideoBW) {
updatedMaxVideoBW = this.publisher.getMaxVideoBW();
} else {
updatedMaxVideoBW = 4000000;
}
}
log.debug(`Setting maxVideoBW in subscriber, requested: ${maxVideoBW}, publisher ${this.publisher.getMaxVideoBW()}, result:${updatedMaxVideoBW}`);
log.debug(`Setting maxVideoBW in subscriber, requested: ${maxVideoBW}, publisher ${this.publisher.getMaxVideoBW ? this.publisher.getMaxVideoBW() : 'No max video BW'}, result:${updatedMaxVideoBW}`);
this.mediaStream.setMaxVideoBW(updatedMaxVideoBW);
}

Expand Down

0 comments on commit 5410432

Please sign in to comment.