1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refine audio to RTP packet base.

This commit is contained in:
winlin 2020-05-13 20:13:25 +08:00
parent 588d17c09d
commit 54d8c36905
7 changed files with 129 additions and 190 deletions

View file

@ -280,6 +280,7 @@ SrsRtpPacket2::SrsRtpPacket2()
nalu_type = SrsAvcNaluTypeReserved;
original_bytes = NULL;
frame_type = SrsFrameTypeReserved;
cache_raw = new SrsRtpRawPayload();
cache_fua = new SrsRtpFUAPayload2();
@ -350,6 +351,11 @@ void SrsRtpPacket2::set_decode_handler(ISrsRtpPacketDecodeHandler* h)
decode_handler = h;
}
bool SrsRtpPacket2::is_audio()
{
return frame_type == SrsFrameTypeAudio;
}
int SrsRtpPacket2::nb_bytes()
{
if (!cache_payload) {