![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include "config.h"#include "config_unix.h"#include "config_win32.h"#include <inttypes.h>#include "debug.h"#include "rtp/rtp.h"#include "rtp/rtp_callback.h"#include "rtp/ptime.h"#include "rtp/pbuf.h"#include "tv.h"#include "utils/color_out.h"#include "utils/macros.h"
Go to the source code of this file.
Classes | |
| struct | pbuf |
| struct | pbuf_node |
Macros | |
| #define | MOD_NAME "[Pbuf] " |
| #define | PBUF_MAGIC 0xcafebabe |
Enumerations | |
| enum | { DEFAULT_STATS_INTERVAL = 128 , STAT_INT_MIN_DIVISOR = sizeof(unsigned long long) * CHAR_BIT , WRAPAROUND_THRESHOLD = 900000 } |
| enum | { NUMBER_WORD_BYTES = sizeof(unsigned long long) , NUMBER_WORD_BITS = NUMBER_WORD_BYTES * CHAR_BIT } |
Functions | |
| static void | add_coded_unit (struct pbuf_node *node, rtp_packet *pkt) |
| static void | compute_longest_gap (int *longest_gap, int *accumulated_loss, unsigned long long int packets) |
| static struct pbuf_node * | create_new_pnode (rtp_packet *pkt, long long playout_delay_us) |
| static int | frame_complete (struct pbuf_node *frame) |
| static void | free_cdata (struct coded_data *head) |
| static int | get_consecutive_zeros (unsigned long long int packets) __attribute__((const)) |
| int | pbuf_decode (struct pbuf *playout_buf, time_ns_t curr_time, decode_frame_t decode_func, void *data) |
| void | pbuf_destroy (struct pbuf *playout_buf) |
| struct pbuf * | pbuf_init (volatile int *delay_ms) |
| void | pbuf_insert (struct pbuf *playout_buf, rtp_packet *pkt) |
| int | pbuf_is_empty (struct pbuf *playout_buf) |
| static void | pbuf_process_stats (struct pbuf *playout_buf, rtp_packet *pkt) |
| void | pbuf_remove (struct pbuf *playout_buf, time_ns_t curr_time) |
| void | pbuf_set_playout_delay (struct pbuf *playout_buf, double playout_delay) |
| static void | pbuf_validate (struct pbuf *playout_buf) |
| #define MOD_NAME "[Pbuf] " |
Definition at line 80 of file pbuf.c.
Referenced by pbuf_insert(), and pbuf_process_stats().
| #define PBUF_MAGIC 0xcafebabe |
Definition at line 71 of file pbuf.c.
Referenced by create_new_pnode(), and pbuf_validate().
| anonymous enum |
| Enumerator | |
|---|---|
| DEFAULT_STATS_INTERVAL | |
| STAT_INT_MIN_DIVISOR | |
| WRAPAROUND_THRESHOLD | |
| anonymous enum |
|
static |
Add "pkt" to the frame represented by "node". The "node" has previously been created, and has some coded data already...
New arrivals are filed to the list in descending sequence number order
Definition at line 236 of file pbuf.c.
References pbuf_node::cdata, coded_data::data, pbuf_node::mbit, coded_data::nxt, coded_data::prv, pbuf_node::rtp_timestamp, and coded_data::seqno.
Referenced by pbuf_insert().
|
static |
Definition at line 332 of file pbuf.c.
References get_consecutive_zeros(), MAX, and NUMBER_WORD_BITS.
Referenced by pbuf_process_stats().

|
static |
Definition at line 280 of file pbuf.c.
References pbuf_node::arrival_time, pbuf_node::cdata, coded_data::data, pbuf_node::deletion_time, get_time_in_ns(), pbuf_node::magic, pbuf_node::mbit, coded_data::nxt, PBUF_MAGIC, pbuf_node::playout_time, coded_data::prv, pbuf_node::rtp_timestamp, and coded_data::seqno.
Referenced by pbuf_insert().

|
static |
Definition at line 540 of file pbuf.c.
References frame.
Referenced by pbuf_decode(), and pbuf_remove().
|
static |
Definition at line 486 of file pbuf.c.
References coded_data::data, and coded_data::nxt.
Referenced by pbuf_destroy(), and pbuf_remove().
|
static |
Definition at line 315 of file pbuf.c.
References MAX, and NUMBER_WORD_BITS.
Referenced by compute_longest_gap().
| int pbuf_decode | ( | struct pbuf * | playout_buf, |
| time_ns_t | curr_time, | ||
| decode_frame_t | decode_func, | ||
| void * | data ) |
Definition at line 562 of file pbuf.c.
References pbuf_node::cdata, pbuf_node::completed, debug_msg, pbuf_node::decoded, pbuf::expected_pkts_cum, frame_complete(), pbuf::frst, NS_IN_SEC, pbuf_node::nxt, pbuf_validate(), pbuf_node::playout_time, pbuf::received_pkts_cum, and pbuf_node::rtp_timestamp.
Referenced by audio_receiver_thread(), ultragrid_rtp_video_rxtx::receiver_loop(), and vidcap_rtsp_thread().

| void pbuf_destroy | ( | struct pbuf * | playout_buf | ) |
Definition at line 195 of file pbuf.c.
References pbuf_node::cdata, pbuf::expected_pkts_cum, free_cdata(), pbuf::frst, pbuf::last, LOG_LEVEL_INFO, log_msg(), pbuf_node::nxt, pbuf_validate(), pbuf_node::prv, and pbuf::received_pkts_cum.
Referenced by pdb_destroy_item().

| struct pbuf * pbuf_init | ( | volatile int * | delay_ms | ) |
Definition at line 174 of file pbuf.c.
References debug_msg, DEFAULT_STATS_INTERVAL, pbuf::frst, pbuf::last, pbuf::last_report_seq, pbuf::offset_ms, pbuf::playout_delay_us, and pbuf::stats_interval.
Referenced by pdb_create_item().
| void pbuf_insert | ( | struct pbuf * | playout_buf, |
| rtp_packet * | pkt ) |
Definition at line 420 of file pbuf.c.
References add_coded_unit(), pbuf_node::completed, create_new_pnode(), debug_msg, pbuf_node::decoded, pbuf::frst, pbuf::last, LOG_LEVEL_VERBOSE, log_msg(), MOD_NAME, pbuf_node::nxt, pbuf::offset_ms, pbuf_process_stats(), pbuf_validate(), pbuf::playout_delay_us, pbuf_node::prv, pbuf_node::rtp_timestamp, and WRAPAROUND_THRESHOLD.
Referenced by rtp_recv_callback().

| int pbuf_is_empty | ( | struct pbuf * | playout_buf | ) |
Definition at line 553 of file pbuf.c.
References FALSE, pbuf::frst, and TRUE.
Referenced by audio_receiver_thread(), and ultragrid_rtp_video_rxtx::receiver_loop().
|
inlinestatic |
Definition at line 345 of file pbuf.c.
References abs(), compute_longest_gap(), pbuf::dups, pbuf::expected_pkts, pbuf::expected_pkts_cum, pbuf::last_display_ts, pbuf::last_report_seq, pbuf::last_seq, LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE, log_msg(), pbuf::longest_gap, MAX, pbuf::max_out_of_order_dist, MOD_NAME, NUMBER_WORD_BITS, pbuf::out_of_order_pkts, pbuf::packets, pbuf::received_pkts, pbuf::received_pkts_cum, STAT_INT_MIN_DIVISOR, pbuf::stats_interval, TERM_FG_RED, and TERM_FG_RESET.
Referenced by pbuf_insert().

Definition at line 498 of file pbuf.c.
References pbuf_node::cdata, pbuf_node::deletion_time, frame_complete(), free_cdata(), pbuf::frst, pbuf::last, pbuf_node::nxt, pbuf_validate(), and pbuf_node::prv.
Referenced by audio_receiver_thread(), ultragrid_rtp_video_rxtx::receiver_loop(), and vidcap_rtsp_thread().

| void pbuf_set_playout_delay | ( | struct pbuf * | playout_buf, |
| double | playout_delay ) |
Definition at line 597 of file pbuf.c.
References pbuf::playout_delay_us.
Referenced by audio_receiver_thread(), and ultragrid_rtp_video_rxtx::receiver_process_messages().
|
static |
Definition at line 121 of file pbuf.c.
References pbuf_node::cdata, coded_data::data, pbuf::frst, pbuf::last, pbuf_node::magic, coded_data::nxt, pbuf_node::nxt, PBUF_MAGIC, coded_data::prv, pbuf_node::prv, pbuf_node::rtp_timestamp, and UNUSED.
Referenced by pbuf_decode(), pbuf_destroy(), pbuf_insert(), and pbuf_remove().