![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
rtpbuf.h@137:32dd35a6dbc9, 2015-11-24 (annotated)
- Committer:
- klauss
- Date:
- Tue Nov 24 14:06:22 2015 +0000
- Revision:
- 137:32dd35a6dbc9
- Parent:
- 121:ee02790d00b7
core source of the .bin (09/21/2015) in the field
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 69:65665afbad5d | 1 | /** |
klauss | 69:65665afbad5d | 2 | * @file rtpbuf.h |
klauss | 69:65665afbad5d | 3 | * @Synopsis Implementa funcionalidades de conversão entre u-law e a-law |
klauss | 69:65665afbad5d | 4 | * @author Jhonatan Casale / PedroZN |
klauss | 69:65665afbad5d | 5 | * @version 1 |
klauss | 69:65665afbad5d | 6 | * @date 2014-11-05 |
klauss | 69:65665afbad5d | 7 | * \note IMPORTANT: sizes must be multiple of 4 |
klauss | 69:65665afbad5d | 8 | */ |
klauss | 121:ee02790d00b7 | 9 | #ifndef __RTPBUF_H__ |
klauss | 121:ee02790d00b7 | 10 | #define __RTPBUF_H__ |
klauss | 0:4d17cd9c8f9d | 11 | |
klauss | 0:4d17cd9c8f9d | 12 | #include <stdint.h> |
klauss | 121:ee02790d00b7 | 13 | #include <stdlib.h> |
klauss | 74:81c47fff88a5 | 14 | #include "utils.h" |
klauss | 0:4d17cd9c8f9d | 15 | |
klauss | 121:ee02790d00b7 | 16 | const uint16_t RTPBUF_PKGSIZE = 240; |
klauss | 69:65665afbad5d | 17 | ///< 30ms @ 8Ksamples/sec |
klauss | 121:ee02790d00b7 | 18 | const uint16_t RTPBUF_BUFSIZE = 320; |
klauss | 69:65665afbad5d | 19 | ///< 40ms @ 8Ksamples/sec |
klauss | 0:4d17cd9c8f9d | 20 | |
klauss | 0:4d17cd9c8f9d | 21 | #if (RTPBUF_PKGSIZE & 0x03) |
klauss | 0:4d17cd9c8f9d | 22 | # error OPS... value forbidden |
klauss | 0:4d17cd9c8f9d | 23 | #endif |
klauss | 0:4d17cd9c8f9d | 24 | #if (RTPBUF_BUFSIZE & 0x03) |
klauss | 0:4d17cd9c8f9d | 25 | # error OPS... value forbidden |
klauss | 0:4d17cd9c8f9d | 26 | #endif |
klauss | 0:4d17cd9c8f9d | 27 | |
klauss | 0:4d17cd9c8f9d | 28 | struct rtpbuf { |
klauss | 0:4d17cd9c8f9d | 29 | uint32_t b[ RTPBUF_BUFSIZE>>2 ]; |
klauss | 69:65665afbad5d | 30 | ///< A fila de audio. |
klauss | 69:65665afbad5d | 31 | int size; |
klauss | 69:65665afbad5d | 32 | ///< Representa o tamanho da fila. |
klauss | 0:4d17cd9c8f9d | 33 | }; |
klauss | 0:4d17cd9c8f9d | 34 | typedef struct rtpbuf rtpbuf_t; |
klauss | 0:4d17cd9c8f9d | 35 | |
klauss | 69:65665afbad5d | 36 | /** clear the buffer, useful at the start of a new phone call |
klauss | 69:65665afbad5d | 37 | */ |
klauss | 0:4d17cd9c8f9d | 38 | void rtpbuf_clear (rtpbuf_t * self); |
klauss | 0:4d17cd9c8f9d | 39 | |
klauss | 69:65665afbad5d | 40 | /** use this function to put audio into the fifo |
klauss | 69:65665afbad5d | 41 | */ |
klauss | 0:4d17cd9c8f9d | 42 | void rtpbuf_put (rtpbuf_t * self, int size, uint8_t * data); |
klauss | 0:4d17cd9c8f9d | 43 | |
klauss | 69:65665afbad5d | 44 | /** use this function to check if there is audio available |
klauss | 0:4d17cd9c8f9d | 45 | * returns NULL if there is no audio available |
klauss | 69:65665afbad5d | 46 | * or returns a pointer to the audio package |
klauss | 69:65665afbad5d | 47 | */ |
klauss | 0:4d17cd9c8f9d | 48 | uint8_t * rtpbuf_get (rtpbuf_t * self); |
klauss | 0:4d17cd9c8f9d | 49 | |
klauss | 69:65665afbad5d | 50 | /** |
klauss | 69:65665afbad5d | 51 | * use this function to tell rtpbuf that you already consumed |
klauss | 69:65665afbad5d | 52 | * the data supplied by rtpbuf_get() |
klauss | 69:65665afbad5d | 53 | */ |
klauss | 0:4d17cd9c8f9d | 54 | void rtpbuf_next (rtpbuf_t * self); |
klauss | 0:4d17cd9c8f9d | 55 | |
klauss | 0:4d17cd9c8f9d | 56 | #endif |