Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Aug 11, 2023
1 parent aad9afc commit 1dbf213
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/rtcp/ReceiverReportPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { Serializable } from '../Serializable';
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/

// Common RTCP header length + 4.
// Common RTCP header length + 4 (SSRC of packet sender).
const FIXED_HEADER_LENGTH = COMMON_HEADER_LENGTH + 4;

export const RECEPTION_REPORT_LENGTH = 24;
Expand Down
21 changes: 14 additions & 7 deletions src/rtcp/RtcpPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,6 @@ export abstract class RtcpPacket extends Packet
return this.view.getUint8(1);
}

protected writeCommonHeader(): void
{
this.setVersion();

this.setPacketType(this.#packetType);
}

/**
* Get the RTCP header count value.
*/
Expand All @@ -267,8 +260,18 @@ export abstract class RtcpPacket extends Packet
return readBits({ view: this.view, byte: 0, mask: 0b00011111 });
}

protected writeCommonHeader(): void
{
this.setVersion();
this.setPacketType(this.#packetType);
}

/**
* Set the RTCP header count value.
*
* @privateRemarks
* - This method is not public since users should not manipulate this field
* directly.
*/
protected setCount(count: number): void
{
Expand Down Expand Up @@ -324,6 +327,10 @@ export abstract class RtcpPacket extends Packet

/**
* Set the RTCP header packet type.
*
* @privateRemarks
* - This method is not public since users should not manipulate this field
* directly.
*/
private setPacketType(packetType: RtcpPacketType): void
{
Expand Down
5 changes: 5 additions & 0 deletions src/rtcp/UnknownPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ export class UnknownPacket extends RtcpPacket

/**
* Set the RTCP header count value.
*
* @privateRemarks
* - This method is made public for this class since the user is free to add
* whatever body to this packet, and hence the user may want to also
* manipulate this field.
*/
setCount(count: number): void
{
Expand Down

0 comments on commit 1dbf213

Please sign in to comment.