JackTrip: PacketHeader Class Reference

JackTrip

Signals | Public Member Functions | Static Public Member Functions | List of all members
PacketHeader Class Referenceabstract

Base class for header type. Subclass this struct to create a new header. More...

`#include <PacketHeader.h>`

Inheritance diagram for PacketHeader:
[legend]
Collaboration diagram for PacketHeader:
[legend]

## Signals
void | signalError (const char *error_message)

## Public Member Functions
| PacketHeader (JackTrip *jacktrip)
| The class Constructor. More...
virtual | ~PacketHeader ()
| The class Destructor. More...
virtual void | fillHeaderCommonFromAudio ()=0
virtual void | parseHeader ()=0
| Parse the packet header and take appropriate measures (like change settings, or quit the program if peer settings don't match) More...
virtual void | checkPeerSettings (int8_t *full_packet)=0
virtual uint64_t | getPeerTimeStamp (int8_t *full_packet) const =0
virtual uint16_t | getPeerSequenceNumber (int8_t *full_packet) const =0
virtual uint16_t | getPeerBufferSize (int8_t *full_packet) const =0
virtual uint8_t | getPeerSamplingRate (int8_t *full_packet) const =0
virtual uint8_t | getPeerBitResolution (int8_t *full_packet) const =0
virtual uint8_t | getPeerNumChannels (int8_t *full_packet) const =0
virtual uint8_t | getPeerConnectionMode (int8_t *full_packet) const =0
virtual void | increaseSequenceNumber ()
| Increase sequence number for counter, a 16bit number. More...
virtual uint16_t | getSequenceNumber () const
| Returns the current sequence number. More...
virtual int | getHeaderSizeInBytes () const =0
| Get the header size in bytes. More...
virtual void | putHeaderInPacketBaseClass (int8_t *full_packet, const HeaderStruct &header_struct)
virtual void | putHeaderInPacket (int8_t *full_packet)=0
| Put the header in buffer pointed by full_packet. More...

## Static Public Member Functions
static uint64_t | usecTime ()
| Return a time stamp in microseconds. More...

## Detailed Description

Base class for header type. Subclass this struct to create a new header.

## Constructor & Destructor Documentation

## ◆ PacketHeader()

PacketHeader::PacketHeader | ( | JackTrip * | jacktrip | ) |

The class Constructor.

## ◆ ~PacketHeader()

virtual PacketHeader::~PacketHeader | ( |  | ) |
| inlinevirtual

The class Destructor.

## Member Function Documentation

## ◆ checkPeerSettings()

virtual void PacketHeader::checkPeerSettings | ( | int8_t * | full_packet | ) |
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ fillHeaderCommonFromAudio()

virtual void PacketHeader::fillHeaderCommonFromAudio | ( |  | ) |
| pure virtual

Todo:
  Implement this using a JackTrip Method (Mediator) member instead of the reference to JackAudio

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getHeaderSizeInBytes()

virtual int PacketHeader::getHeaderSizeInBytes | ( |  | ) | const
| pure virtual

Get the header size in bytes.

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerBitResolution()

virtual uint8_t PacketHeader::getPeerBitResolution | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerBufferSize()

virtual uint16_t PacketHeader::getPeerBufferSize | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerConnectionMode()

virtual uint8_t PacketHeader::getPeerConnectionMode | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerNumChannels()

virtual uint8_t PacketHeader::getPeerNumChannels | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerSamplingRate()

virtual uint8_t PacketHeader::getPeerSamplingRate | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerSequenceNumber()

virtual uint16_t PacketHeader::getPeerSequenceNumber | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getPeerTimeStamp()

virtual uint64_t PacketHeader::getPeerTimeStamp | ( | int8_t * | full_packet | ) | const
| pure virtual

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ getSequenceNumber()

virtual uint16_t PacketHeader::getSequenceNumber | ( |  | ) | const
| inlinevirtual

Returns the current sequence number.

Returns
  16bit Sequence number

Reimplemented in DefaultHeader.

## ◆ increaseSequenceNumber()

virtual void PacketHeader::increaseSequenceNumber | ( |  | ) |
| inlinevirtual

Increase sequence number for counter, a 16bit number.

Reimplemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ parseHeader()

virtual void PacketHeader::parseHeader | ( |  | ) |
| pure virtual

Parse the packet header and take appropriate measures (like change settings, or quit the program if peer settings don't match)

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ putHeaderInPacket()

virtual void PacketHeader::putHeaderInPacket | ( | int8_t * | full_packet | ) |
| pure virtual

Put the header in buffer pointed by full_packet.

Parameters

  full_packet | Pointer to full packet (audio+header). Size must be sizeof(header part) + sizeof(audio part)

Implemented in EmptyHeader, JamLinkHeader, and DefaultHeader.

## ◆ putHeaderInPacketBaseClass()

virtual void PacketHeader::putHeaderInPacketBaseClass | ( | int8_t * | full_packet,
|  | const HeaderStruct & | header_struct
| ) |  |
| inlinevirtual

## ◆ signalError

void PacketHeader::signalError | ( | const char * | error_message | ) |
| signal

## ◆ usecTime()

uint64_t PacketHeader::usecTime | ( |  | ) |
| static

Return a time stamp in microseconds.

Returns
  Time stamp: microseconds since midnight (0 hour), January 1, 1970

The documentation for this class was generated from the following files:

- src/PacketHeader.h
- src/PacketHeader.cpp
- src/release/moc_PacketHeader.cpp