mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
WebRTC: Fix no audio and video issue for Firefox. (#3079) v4.0.268
* Remove extern SrsPps* duplicate declarations * fix(rtmp2rtc): fix video payload type for rtmp to rtc bridge (#3041) * Revert changes not belongs to this PR. * Fix naming issue, follow SRS style. * Use srs_assert instead of assert. * Fix firefox no audio issue. Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
7d782ee8c9
commit
e529536563
4 changed files with 14 additions and 7 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 4.0 Changelog
|
## SRS 4.0 Changelog
|
||||||
|
|
||||||
|
* v4.0, 2022-11-22, Pick [#3079](https://github.com/ossrs/srs/issues/3079): WebRTC: Fix no audio and video issue for Firefox. v4.0.268
|
||||||
* v4.0, 2022-10-10, For [#2901](https://github.com/ossrs/srs/issues/2901): Edge: Fast disconnect and reconnect. v4.0.267
|
* v4.0, 2022-10-10, For [#2901](https://github.com/ossrs/srs/issues/2901): Edge: Fast disconnect and reconnect. v4.0.267
|
||||||
* v4.0, 2022-09-27, For [#3167](https://github.com/ossrs/srs/issues/3167): WebRTC: Refine sequence jitter algorithm. v4.0.266
|
* v4.0, 2022-09-27, For [#3167](https://github.com/ossrs/srs/issues/3167): WebRTC: Refine sequence jitter algorithm. v4.0.266
|
||||||
* v4.0, 2022-09-16, For [#3179](https://github.com/ossrs/srs/issues/3179): WebRTC: Make sure the same m-lines order for offer and answer. v4.0.265
|
* v4.0, 2022-09-16, For [#3179](https://github.com/ossrs/srs/issues/3179): WebRTC: Make sure the same m-lines order for offer and answer. v4.0.265
|
||||||
|
|
|
@ -722,6 +722,8 @@ SrsRtcFromRtmpBridger::SrsRtcFromRtmpBridger(SrsRtcSource* source)
|
||||||
if (!descs.empty()) {
|
if (!descs.empty()) {
|
||||||
audio_ssrc = descs.at(0)->ssrc_;
|
audio_ssrc = descs.at(0)->ssrc_;
|
||||||
}
|
}
|
||||||
|
// Note we must use the PT of source, see https://github.com/ossrs/srs/pull/3079
|
||||||
|
audio_payload_type_ = descs.empty() ? kAudioPayloadType : descs.front()->media_->pt_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// video track ssrc
|
// video track ssrc
|
||||||
|
@ -730,6 +732,8 @@ SrsRtcFromRtmpBridger::SrsRtcFromRtmpBridger(SrsRtcSource* source)
|
||||||
if (!descs.empty()) {
|
if (!descs.empty()) {
|
||||||
video_ssrc = descs.at(0)->ssrc_;
|
video_ssrc = descs.at(0)->ssrc_;
|
||||||
}
|
}
|
||||||
|
// Note we must use the PT of source, see https://github.com/ossrs/srs/pull/3079
|
||||||
|
video_payload_type_ = descs.empty() ? kVideoPayloadType : descs.front()->media_->pt_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -900,7 +904,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_opus(SrsAudioFrame* audio, SrsRtpPack
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
pkt->header.set_payload_type(kAudioPayloadType);
|
pkt->header.set_payload_type(audio_payload_type_);
|
||||||
pkt->header.set_ssrc(audio_ssrc);
|
pkt->header.set_ssrc(audio_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeAudio;
|
pkt->frame_type = SrsFrameTypeAudio;
|
||||||
pkt->header.set_marker(true);
|
pkt->header.set_marker(true);
|
||||||
|
@ -1044,7 +1048,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_stap_a(SrsRtcSource* source, SrsShare
|
||||||
return srs_error_new(ERROR_RTC_RTP_MUXER, "sps/pps empty");
|
return srs_error_new(ERROR_RTC_RTP_MUXER, "sps/pps empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(video_payload_type_);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
pkt->nalu_type = (SrsAvcNaluType)kStapA;
|
pkt->nalu_type = (SrsAvcNaluType)kStapA;
|
||||||
|
@ -1126,7 +1130,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_nalus(SrsSharedPtrMessage* msg, const
|
||||||
SrsRtpPacket* pkt = new SrsRtpPacket();
|
SrsRtpPacket* pkt = new SrsRtpPacket();
|
||||||
pkts.push_back(pkt);
|
pkts.push_back(pkt);
|
||||||
|
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(video_payload_type_);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
pkt->nalu_type = (SrsAvcNaluType)first_nalu_type;
|
pkt->nalu_type = (SrsAvcNaluType)first_nalu_type;
|
||||||
|
@ -1160,7 +1164,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_nalus(SrsSharedPtrMessage* msg, const
|
||||||
SrsRtpPacket* pkt = new SrsRtpPacket();
|
SrsRtpPacket* pkt = new SrsRtpPacket();
|
||||||
pkts.push_back(pkt);
|
pkts.push_back(pkt);
|
||||||
|
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(video_payload_type_);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
pkt->nalu_type = (SrsAvcNaluType)kFuA;
|
pkt->nalu_type = (SrsAvcNaluType)kFuA;
|
||||||
|
@ -1190,7 +1194,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_single_nalu(SrsSharedPtrMessage* msg,
|
||||||
SrsRtpPacket* pkt = new SrsRtpPacket();
|
SrsRtpPacket* pkt = new SrsRtpPacket();
|
||||||
pkts.push_back(pkt);
|
pkts.push_back(pkt);
|
||||||
|
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(video_payload_type_);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
pkt->header.set_sequence(video_sequence++);
|
pkt->header.set_sequence(video_sequence++);
|
||||||
|
@ -1223,7 +1227,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_fu_a(SrsSharedPtrMessage* msg, SrsSam
|
||||||
SrsRtpPacket* pkt = new SrsRtpPacket();
|
SrsRtpPacket* pkt = new SrsRtpPacket();
|
||||||
pkts.push_back(pkt);
|
pkts.push_back(pkt);
|
||||||
|
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(video_payload_type_);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
pkt->header.set_sequence(video_sequence++);
|
pkt->header.set_sequence(video_sequence++);
|
||||||
|
|
|
@ -261,6 +261,8 @@ private:
|
||||||
uint16_t video_sequence;
|
uint16_t video_sequence;
|
||||||
uint32_t audio_ssrc;
|
uint32_t audio_ssrc;
|
||||||
uint32_t video_ssrc;
|
uint32_t video_ssrc;
|
||||||
|
uint8_t audio_payload_type_;
|
||||||
|
uint8_t video_payload_type_;
|
||||||
public:
|
public:
|
||||||
SrsRtcFromRtmpBridger(SrsRtcSource* source);
|
SrsRtcFromRtmpBridger(SrsRtcSource* source);
|
||||||
virtual ~SrsRtcFromRtmpBridger();
|
virtual ~SrsRtcFromRtmpBridger();
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 267
|
#define VERSION_REVISION 268
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue