UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
state_audio_decoder_summary Struct Reference
Collaboration diagram for state_audio_decoder_summary:
Collaboration graph

Public Member Functions

 ~state_audio_decoder_summary ()
 
void update (unsigned long int bufnum)
 

Private Member Functions

void print () const
 

Private Attributes

unsigned long int last_bufnum = -1
 
int64_t missed = 0
 
int64_t played = 0
 
steady_clock::time_point t_last = steady_clock::now()
 

Detailed Description

Definition at line 106 of file audio_decoders.cpp.

Constructor & Destructor Documentation

◆ ~state_audio_decoder_summary()

state_audio_decoder_summary::~state_audio_decoder_summary ( )
inline

Definition at line 122 of file audio_decoders.cpp.

122 {
123 print();
124 }

References print().

Here is the call graph for this function:

Member Function Documentation

◆ print()

void state_audio_decoder_summary::print ( ) const
inlineprivate

Definition at line 114 of file audio_decoders.cpp.

114 {
116 << SUNDERLINE("Audio dec stats")
117 << " (cumulative): " << SBOLD(played) << " played / "
118 << SBOLD(played + missed) << " total audio frames\n";
119 }
#define SBOLD(x)
Definition color_out.h:80
#define SUNDERLINE(x)
Definition color_out.h:81
#define LOG_LEVEL_INFO
normal reporting
Definition debug.h:62
#define LOG(level)
Definition debug.h:313

References LOG, LOG_LEVEL_INFO, missed, played, SBOLD, and SUNDERLINE.

Referenced by ~state_audio_decoder_summary(), and update().

◆ update()

void state_audio_decoder_summary::update ( unsigned long int bufnum)
inline

Definition at line 126 of file audio_decoders.cpp.

126 {
127 if (last_bufnum != static_cast<unsigned long int>(-1)) {
128 if ((last_bufnum + 1) % (1U<<BUFNUM_BITS) == bufnum) {
129 played += 1;
130 } else {
131 unsigned long int diff = (bufnum - last_bufnum + 1 + (1U<<BUFNUM_BITS)) % (1U<<BUFNUM_BITS);
132 if (diff >= (1U<<BUFNUM_BITS) / 2) {
133 diff -= (1U<<BUFNUM_BITS) / 2;
134 }
135 missed += diff;
136 }
137 }
138 last_bufnum = bufnum;
139
140 auto now = steady_clock::now();
141 if (duration_cast<seconds>(steady_clock::now() - t_last).count() > CUMULATIVE_REPORTS_INTERVAL) {
142 print();
143 t_last = now;
144 }
145 }
#define CUMULATIVE_REPORTS_INTERVAL
Definition debug.h:110
int count
Definition hd-rum.c:44
#define BUFNUM_BITS
Definition rtp_types.h:171
steady_clock::time_point t_last

References BUFNUM_BITS, count, CUMULATIVE_REPORTS_INTERVAL, last_bufnum, missed, played, print(), and t_last.

Referenced by decode_audio_frame().

Here is the call graph for this function:

Member Data Documentation

◆ last_bufnum

unsigned long int state_audio_decoder_summary::last_bufnum = -1
private

Definition at line 108 of file audio_decoders.cpp.

Referenced by update().

◆ missed

int64_t state_audio_decoder_summary::missed = 0
private

Definition at line 110 of file audio_decoders.cpp.

Referenced by print(), and update().

◆ played

int64_t state_audio_decoder_summary::played = 0
private

Definition at line 109 of file audio_decoders.cpp.

Referenced by print(), and update().

◆ t_last

steady_clock::time_point state_audio_decoder_summary::t_last = steady_clock::now()
private

Definition at line 112 of file audio_decoders.cpp.

Referenced by update().


The documentation for this struct was generated from the following file: