UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
channel_map Struct Reference

#include <utils.h>

Collaboration diagram for channel_map:
Collaboration graph

Public Member Functions

 ~channel_map ()
 
void compute_contributors ()
 
bool validate ()
 

Public Attributes

int * contributors = nullptr
 
int ** map = nullptr
 
int max_output = -1
 
int size = 0
 
int * sizes = nullptr
 

Detailed Description

Definition at line 167 of file utils.h.

Constructor & Destructor Documentation

◆ ~channel_map()

channel_map::~channel_map ( )

Definition at line 782 of file utils.cpp.

782 {
783 free(sizes);
784 for(int i = 0; i < size; ++i) {
785 free(map[i]);
786 }
787 free(map);
788 free(contributors);
789}
int * contributors
Definition utils.h:172
int * sizes
Definition utils.h:171
int size
Definition utils.h:173

References contributors, size, and sizes.

Member Function Documentation

◆ compute_contributors()

void channel_map::compute_contributors ( )

Definition at line 804 of file utils.cpp.

804 {
805 for (int i = 0; i < size; ++i) {
806 for (int j = 0; j < sizes[i]; ++j) {
807 max_output = std::max(map[i][j], max_output);
808 }
809 }
810 contributors = (int *) calloc(max_output + 1, sizeof(int));
811 for (int i = 0; i < size; ++i) {
812 for (int j = 0; j < sizes[i]; ++j) {
813 contributors[map[i][j]] += 1;
814 }
815 }
816}
int max_output
Definition utils.h:174

References contributors, max_output, size, and sizes.

Referenced by parse_channel_map_cfg().

◆ validate()

bool channel_map::validate ( )

Definition at line 791 of file utils.cpp.

791 {
792 for(int i = 0; i < size; ++i) {
793 for(int j = 0; j < sizes[i]; ++j) {
794 if(map[i][j] < 0) {
795 log_msg(LOG_LEVEL_ERROR, "Audio channel mapping - negative parameter occured.\n");
796 return false;
797 }
798 }
799 }
800
801 return true;
802}
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_ERROR
general errors
Definition debug.h:59

References LOG_LEVEL_ERROR, log_msg(), size, and sizes.

Referenced by parse_channel_map_cfg().

Here is the call graph for this function:

Member Data Documentation

◆ contributors

int* channel_map::contributors = nullptr

Definition at line 172 of file utils.h.

Referenced by ~channel_map(), compute_contributors(), and decode_audio_frame().

◆ map

int** channel_map::map = nullptr

Definition at line 170 of file utils.h.

Referenced by audio_decoder_init(), decode_audio_frame(), and parse_channel_map_cfg().

◆ max_output

int channel_map::max_output = -1

Definition at line 174 of file utils.h.

Referenced by audio_decoder_reconfigure(), compute_contributors(), and decode_audio_frame().

◆ size

◆ sizes

int* channel_map::sizes = nullptr

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