/* MediaMtx (C++) - a unit of media data (MediaMTX: internal/unit) One H264 access unit (all NAL units of one picture) with its timestamps. */ #pragma once #include #include #include namespace mtx { typedef std::vector Bytes; struct Unit { int64_t pts = 0; // presentation time, 90 kHz clock, from the source's RTP timestamps (unwrapped) int64_t ntpUs = 0; // wall clock of the unit (us since the epoch) bool idr = false; // contains an IDR picture (random access point) std::vector nalus; // NAL units without start codes size_t byteSize() const { size_t n = 0; for (const Bytes & b : nalus) { n += b.size(); } return n; } }; typedef std::shared_ptr UnitPtr; } // namespace mtx