Asterisk - The Open Source Telephony Project GIT-master-0644429
Data Fields
ast_trans_pvt Struct Reference

Default structure for translators, with the basic fields and buffers, all allocated as part of the same chunk of memory. The buffer is preceded by AST_FRIENDLY_OFFSET bytes in front of the user portion. 'buf' points right after this space. More...

#include <translate.h>

Collaboration diagram for ast_trans_pvt:
Collaboration graph
[legend]

Data Fields

int datalen
 actual space used in outbuf More...
 
struct ast_formatexplicit_dst
 
struct ast_frame f
 
int interleaved_stereo
 
struct ast_trans_pvtnext
 
struct timeval nextin
 
struct timeval nextout
 
union {
   char *   c
 
   int16_t *   i16
 
   unsigned char *   uc
 
   uint8_t *   ui8
 
outbuf
 
plc_state_tplc
 
void * pvt
 
int samples
 
struct ast_translatort
 

Detailed Description

Default structure for translators, with the basic fields and buffers, all allocated as part of the same chunk of memory. The buffer is preceded by AST_FRIENDLY_OFFSET bytes in front of the user portion. 'buf' points right after this space.

*_framein() routines operate in two ways:

  1. some convert on the fly and place the data directly in outbuf; in this case 'samples' and 'datalen' contain the number of samples and number of bytes available in the buffer. In this case we can use a generic *_frameout() routine that simply takes whatever is there and places it into the output frame.
  2. others simply store the (unconverted) samples into a working buffer, and leave the conversion task to *_frameout(). In this case, the intermediate buffer must be in the private descriptor, 'datalen' is left to 0, while 'samples' is still updated with the number of samples received.

Definition at line 213 of file translate.h.

Field Documentation

◆ c

char* c

◆ datalen

int datalen

◆ explicit_dst

struct ast_format* explicit_dst

If a translation path using a format with attributes requires the output to be a specific set of attributes, this variable will be set describing those attributes to the translator. Otherwise, the translator must choose a set of format attributes for the destination that preserves the quality of the audio in the best way possible. For example with the Opus Codec, explicit_dst contains an attribute which describes whether both parties want to do forward-error correction (FEC).

Definition at line 237 of file translate.h.

Referenced by destroy(), generate_interpolated_slin(), lintoilbc_new(), and newpvt().

◆ f

struct ast_frame f

used in frameout. This frame holds a f.subclass.format ref.

Definition at line 215 of file translate.h.

Referenced by ast_trans_frameout(), ast_translate(), dahdi_decoder_frameout(), dahdi_encoder_frameout(), dahdi_translate(), destroy(), fax_gateway_framehook(), framein(), lintoilbc_frameout(), newpvt(), and resamp_new().

◆ i16

int16_t* i16

◆ interleaved_stereo

int interleaved_stereo

indicates if samples are in interleaved order, for stereo lin

Definition at line 238 of file translate.h.

Referenced by set_format().

◆ next

struct ast_trans_pvt* next

next in translator chain

Definition at line 227 of file translate.h.

Referenced by ast_translate(), ast_translate_path_to_str(), ast_translator_build_path(), and ast_translator_free_path().

◆ nextin

struct timeval nextin

Definition at line 228 of file translate.h.

Referenced by ast_translate(), and ast_translator_build_path().

◆ nextout

struct timeval nextout

Definition at line 229 of file translate.h.

Referenced by ast_translate(), and ast_translator_build_path().

◆ 

union { ... } outbuf

◆ plc

optional plc pointer

Definition at line 226 of file translate.h.

◆ pvt

void* pvt

◆ samples

int samples

◆ t

struct ast_translator* t

◆ uc

unsigned char* uc

the useful portion of the buffer

Definition at line 222 of file translate.h.

Referenced by alawtoulaw_framein(), lintocodec2_frameout(), lintolpc10_frameout(), and ulawtoalaw_framein().

◆ ui8

uint8_t* ui8

Definition at line 224 of file translate.h.

Referenced by lintog722_framein().


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