Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
rtpbuf.h
00001 /** 00002 * @file rtpbuf.h 00003 * @Synopsis Implementa funcionalidades de conversão entre u-law e a-law 00004 * @author Jhonatan Casale / PedroZN 00005 * @version 1 00006 * @date 2014-11-05 00007 * \note IMPORTANT: sizes must be multiple of 4 00008 */ 00009 #ifndef __RTPBUF_H__ 00010 #define __RTPBUF_H__ 00011 00012 #include <stdint.h> 00013 #include <stdlib.h> 00014 #include "utils.h" 00015 00016 const uint16_t RTPBUF_PKGSIZE = 240; 00017 ///< 30ms @ 8Ksamples/sec 00018 const uint16_t RTPBUF_BUFSIZE = 320; 00019 ///< 40ms @ 8Ksamples/sec 00020 00021 #if (RTPBUF_PKGSIZE & 0x03) 00022 # error OPS... value forbidden 00023 #endif 00024 #if (RTPBUF_BUFSIZE & 0x03) 00025 # error OPS... value forbidden 00026 #endif 00027 00028 struct rtpbuf { 00029 uint32_t b[ RTPBUF_BUFSIZE>>2 ]; 00030 ///< A fila de audio. 00031 int size; 00032 ///< Representa o tamanho da fila. 00033 }; 00034 typedef struct rtpbuf rtpbuf_t; 00035 00036 /** clear the buffer, useful at the start of a new phone call 00037 */ 00038 void rtpbuf_clear (rtpbuf_t * self); 00039 00040 /** use this function to put audio into the fifo 00041 */ 00042 void rtpbuf_put (rtpbuf_t * self, int size, uint8_t * data); 00043 00044 /** use this function to check if there is audio available 00045 * returns NULL if there is no audio available 00046 * or returns a pointer to the audio package 00047 */ 00048 uint8_t * rtpbuf_get (rtpbuf_t * self); 00049 00050 /** 00051 * use this function to tell rtpbuf that you already consumed 00052 * the data supplied by rtpbuf_get() 00053 */ 00054 void rtpbuf_next (rtpbuf_t * self); 00055 00056 #endif
Generated on Tue Jul 12 2022 16:25:12 by
