mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 20:01:56 +00:00
RTC: Refine comments for SrsRtpPacket2
This commit is contained in:
parent
d6c16a7e23
commit
f2d0c34244
2 changed files with 5 additions and 1 deletions
|
@ -1040,6 +1040,7 @@ srs_error_t SrsRtpPacket2::decode(SrsBuffer* buf)
|
||||||
nalu_type = SrsAvcNaluType((uint8_t)(buf->head()[0] & kNalTypeMask));
|
nalu_type = SrsAvcNaluType((uint8_t)(buf->head()[0] & kNalTypeMask));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: FIXME: We should keep payload to NULL and return if buffer is empty.
|
||||||
// If user set the decode handler, call it to set the payload.
|
// If user set the decode handler, call it to set the payload.
|
||||||
if (decode_handler) {
|
if (decode_handler) {
|
||||||
decode_handler->on_before_decode_payload(this, buf, &payload_, &payload_type_);
|
decode_handler->on_before_decode_payload(this, buf, &payload_, &payload_type_);
|
||||||
|
|
|
@ -294,8 +294,10 @@ private:
|
||||||
private:
|
private:
|
||||||
// The original shared message, all RTP packets can refer to its data.
|
// The original shared message, all RTP packets can refer to its data.
|
||||||
// Note that the size of shared msg, is not the packet size, it's a larger aligned buffer.
|
// Note that the size of shared msg, is not the packet size, it's a larger aligned buffer.
|
||||||
|
// @remark Note that it may point to the whole RTP packet(for RTP parser, which decode RTP packet from buffer),
|
||||||
|
// and it may point to the RTP payload(for RTMP to RTP, which build RTP header and payload).
|
||||||
SrsSharedPtrMessage* shared_buffer_;
|
SrsSharedPtrMessage* shared_buffer_;
|
||||||
// The size of original packet.
|
// The size of RTP packet or RTP payload.
|
||||||
int actual_buffer_size_;
|
int actual_buffer_size_;
|
||||||
// Helper fields.
|
// Helper fields.
|
||||||
public:
|
public:
|
||||||
|
@ -333,6 +335,7 @@ public:
|
||||||
// Parse the TWCC extension, ignore by default.
|
// Parse the TWCC extension, ignore by default.
|
||||||
void enable_twcc_decode() { header.enable_twcc_decode(); } // SrsRtpPacket2::enable_twcc_decode
|
void enable_twcc_decode() { header.enable_twcc_decode(); } // SrsRtpPacket2::enable_twcc_decode
|
||||||
// Get and set the payload of packet.
|
// Get and set the payload of packet.
|
||||||
|
// @remark Note that return NULL if no payload.
|
||||||
void set_payload(ISrsRtpPayloader* p, SrsRtpPacketPayloadType pt) { payload_ = p; payload_type_ = pt; }
|
void set_payload(ISrsRtpPayloader* p, SrsRtpPacketPayloadType pt) { payload_ = p; payload_type_ = pt; }
|
||||||
ISrsRtpPayloader* payload() { return payload_; }
|
ISrsRtpPayloader* payload() { return payload_; }
|
||||||
// Set the padding of RTP packet.
|
// Set the padding of RTP packet.
|
||||||
|
|
Loading…
Reference in a new issue