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

RTC: Refine code, remove the assign

This commit is contained in:
winlin 2021-02-28 10:04:30 +08:00
parent 515e4f135b
commit 5af0bf9350
2 changed files with 1 additions and 51 deletions

View file

@ -218,13 +218,6 @@ void SrsRtpExtensionTwcc::reset()
sn_ = 0;
}
void SrsRtpExtensionTwcc::assign(const SrsRtpExtensionTwcc& h)
{
has_twcc_ = h.has_twcc_;
id_ = h.id_;
sn_ = h.sn_;
}
srs_error_t SrsRtpExtensionTwcc::decode(SrsBuffer* buf)
{
srs_error_t err = srs_success;
@ -313,13 +306,6 @@ void SrsRtpExtensionOneByte::reset()
value_ = 0;
}
void SrsRtpExtensionOneByte::assign(const SrsRtpExtensionOneByte& h)
{
has_ext_ = h.has_ext_;
id_ = h.id_;
value_ = h.value_;
}
void SrsRtpExtensionOneByte::set_id(int id)
{
id_ = id;
@ -385,17 +371,6 @@ void SrsRtpExtensions::reset()
has_ext_ = false;
}
void SrsRtpExtensions::assign(const SrsRtpExtensions& h)
{
has_ext_ = h.has_ext_;
types_ = h.types_;
if (has_ext_) {
twcc_.assign(h.twcc_);
audio_level_.assign(h.audio_level_);
}
}
srs_error_t SrsRtpExtensions::decode(SrsBuffer* buf)
{
srs_error_t err = srs_success;
@ -602,27 +577,6 @@ void SrsRtpHeader::reset()
//memset(csrc, 0, sizeof(csrc));
}
void SrsRtpHeader::assign(const SrsRtpHeader& h)
{
// Reset the fields in protocol.
cc = h.cc;
marker = h.marker;
payload_type = h.payload_type;
sequence = h.sequence;
timestamp = h.timestamp;
ssrc = h.ssrc;
// Reset the parsed fields.
padding_length = h.padding_length;
extensions_.assign(h.extensions_);
// Reset other fields.
ignore_padding_ = h.ignore_padding_;
// The CSRC is not used yet, so we never reset it.
//memcpy(csrc, h.csrc, sizeof(csrc));
}
srs_error_t SrsRtpHeader::decode(SrsBuffer* buf)
{
srs_error_t err = srs_success;
@ -1002,7 +956,7 @@ SrsRtpPacket2* SrsRtpPacket2::copy()
//srs_assert(!cp->payload_);
//srs_assert(!cp->shared_msg);
cp->header.assign(header);
cp->header = header;
cp->payload_ = payload_? payload_->copy():NULL;
cp->payload_type_ = payload_type_;