-/** @brief Number of samples to infill by in one go
- *
- * This is an upper bound - in practice we expect the underlying audio API to
- * only ask for a much smaller number of samples in any one go.
- */
-#define INFILL_SAMPLES (44100 * 2) /* 1s */
-
-/** @brief Received packet
- *
- * Received packets are kept in a binary heap (see @ref pheap) ordered by
- * timestamp.
- */
-struct packet {
- /** @brief Next packet in @ref next_free_packet or @ref received_packets */
- struct packet *next;
-
- /** @brief Number of samples in this packet */
- uint32_t nsamples;
-
- /** @brief Timestamp from RTP packet
- *
- * NB that "timestamps" are really sample counters. Use lt() or lt_packet()
- * to compare timestamps.
- */
- uint32_t timestamp;
-
- /** @brief Flags
- *
- * Valid values are:
- * - @ref IDLE - the idle bit was set in the RTP packet
- */
- unsigned flags;
-/** @brief idle bit set in RTP packet*/
-#define IDLE 0x0001
-
- /** @brief Raw sample data
- *
- * Only the first @p nsamples samples are defined; the rest is uninitialized
- * data.
- */
- uint16_t samples_raw[MAXSAMPLES];
-};
-
-/** @brief Return true iff \f$a < b\f$ in sequence-space arithmetic
- *
- * Specifically it returns true if \f$(a-b) mod 2^{32} < 2^{31}\f$.
- *
- * See also lt_packet().
- */
-static inline int lt(uint32_t a, uint32_t b) {
- return (uint32_t)(a - b) & 0x80000000;
-}
-
-/** @brief Return true iff a >= b in sequence-space arithmetic */
-static inline int ge(uint32_t a, uint32_t b) {
- return !lt(a, b);
-}
-
-/** @brief Return true iff a > b in sequence-space arithmetic */
-static inline int gt(uint32_t a, uint32_t b) {
- return lt(b, a);
-}
-
-/** @brief Return true iff a <= b in sequence-space arithmetic */
-static inline int le(uint32_t a, uint32_t b) {
- return !lt(b, a);
-}
-
-/** @brief Ordering for packets, used by @ref pheap */
-static inline int lt_packet(const struct packet *a, const struct packet *b) {
- return lt(a->timestamp, b->timestamp);
-}
-