MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / initialize

Method initialize

src/mpegts/PacketBuffer.cpp:46–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// =============================================================================
45
46void PacketBuffer::initialize(const uint32_t ssrc, const long timestamp) {
47 // initialize RTP header
48 _buffer[0] = 0x80; // version: 2, padding: 0, extension: 0, CSRC: 0
49 _buffer[1] = 33; // marker: 0, payload type: 33 (MP2T)
50 _buffer[2] = (0 >> 8) & 0xff; // sequence number
51 _buffer[3] = (0 >> 0) & 0xff; // sequence number
52 _buffer[4] = (timestamp >> 24) & 0xff; // timestamp
53 _buffer[5] = (timestamp >> 16) & 0xff; // timestamp
54 _buffer[6] = (timestamp >> 8) & 0xff; // timestamp
55 _buffer[7] = (timestamp >> 0) & 0xff; // timestamp
56 _buffer[8] = (ssrc >> 24) & 0xff; // synchronization source
57 _buffer[9] = (ssrc >> 16) & 0xff; // synchronization source
58 _buffer[10] = (ssrc >> 8) & 0xff; // synchronization source
59 _buffer[11] = (ssrc >> 0) & 0xff; // synchronization source
60
61 _initialized = true;
62}
63
64bool PacketBuffer::trySyncing() {
65 if (isSynced()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected