Asterisk - The Open Source Telephony Project  21.4.1
Macros
smoother.h File Reference

Asterisk internal frame definitions. More...

#include "asterisk/endian.h"

Go to the source code of this file.

Macros

#define AST_SMOOTHER_FLAG_BE   (1 << 1)
 
#define AST_SMOOTHER_FLAG_FORCED   (1 << 2)
 
#define AST_SMOOTHER_FLAG_G729   (1 << 0)
 

AST_Smoother

#define ast_smoother_feed(s, f)   __ast_smoother_feed(s, f, 0)
 
#define ast_smoother_feed_be(s, f)   __ast_smoother_feed(s, f, 0)
 
#define ast_smoother_feed_le(s, f)   __ast_smoother_feed(s, f, 1)
 
struct ast_smootherast_smoother_new (int bytes)
 
void ast_smoother_set_flags (struct ast_smoother *smoother, int flags)
 
int ast_smoother_get_flags (struct ast_smoother *smoother)
 
int ast_smoother_test_flag (struct ast_smoother *s, int flag)
 
void ast_smoother_free (struct ast_smoother *s)
 
void ast_smoother_reset (struct ast_smoother *s, int bytes)
 
void ast_smoother_reconfigure (struct ast_smoother *s, int bytes)
 Reconfigure an existing smoother to output a different number of bytes per frame. More...
 
int __ast_smoother_feed (struct ast_smoother *s, struct ast_frame *f, int swap)
 
struct ast_frameast_smoother_read (struct ast_smoother *s)
 

Detailed Description

Asterisk internal frame definitions.

Definition in file smoother.h.

Function Documentation

void ast_smoother_reconfigure ( struct ast_smoother s,
int  bytes 
)

Reconfigure an existing smoother to output a different number of bytes per frame.

Parameters
sthe smoother to reconfigure
bytesthe desired number of bytes per output frame

Definition at line 86 of file smoother.c.

87 {
88  /* if there is no change, then nothing to do */
89  if (s->size == bytes) {
90  return;
91  }
92  /* set the new desired output size */
93  s->size = bytes;
94  /* if there is no 'optimized' frame in the smoother,
95  * then there is nothing left to do
96  */
97  if (!s->opt) {
98  return;
99  }
100  /* there is an 'optimized' frame here at the old size,
101  * but it must now be put into the buffer so the data
102  * can be extracted at the new size
103  */
104  smoother_frame_feed(s, s->opt, s->opt_needs_swap);
105  s->opt = NULL;
106 }