mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
RTC: Merge package AV
This commit is contained in:
parent
690c64e046
commit
5bd2812405
2 changed files with 13 additions and 37 deletions
|
@ -771,28 +771,6 @@ srs_error_t SrsRtcPlayer::messages_to_packets(SrsRtcSource* source, const vector
|
|||
if (pkt->is_audio()) {
|
||||
info.nn_audios++;
|
||||
|
||||
if ((err = package_opus(pkt)) != srs_success) {
|
||||
return srs_error_wrap(err, "package opus");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// For video, we should process all NALUs in samples.
|
||||
info.nn_videos++;
|
||||
|
||||
// For video, we should set the RTP packet informations about this consumer.
|
||||
if ((err = package_video(pkt)) != srs_success) {
|
||||
return srs_error_wrap(err, "package video");
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcPlayer::package_opus(SrsRtpPacket2* pkt)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
pkt->header.set_timestamp(audio_timestamp);
|
||||
pkt->header.set_sequence(audio_sequence++);
|
||||
pkt->header.set_ssrc(audio_ssrc);
|
||||
|
@ -804,17 +782,17 @@ srs_error_t SrsRtcPlayer::package_opus(SrsRtpPacket2* pkt)
|
|||
|
||||
// TODO: FIXME: Why 960? Need Refactoring?
|
||||
audio_timestamp += 960;
|
||||
|
||||
return err;
|
||||
continue;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcPlayer::package_video(SrsRtpPacket2* pkt)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
// For video, we should process all NALUs in samples.
|
||||
info.nn_videos++;
|
||||
|
||||
// For video, we should set the RTP packet informations about this consumer.
|
||||
pkt->header.set_sequence(video_sequence++);
|
||||
pkt->header.set_ssrc(video_ssrc);
|
||||
pkt->header.set_payload_type(video_payload_type);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -242,8 +242,6 @@ public:
|
|||
private:
|
||||
srs_error_t send_messages(SrsRtcSource* source, const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
||||
srs_error_t messages_to_packets(SrsRtcSource* source, const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
||||
srs_error_t package_opus(SrsRtpPacket2* pkt);
|
||||
srs_error_t package_video(SrsRtpPacket2* pkt);
|
||||
srs_error_t send_packets(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
||||
srs_error_t send_packets_gso(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
||||
public:
|
||||
|
|
Loading…
Reference in a new issue