![](/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@60:b4ec6beb3be3, 2014-10-24 (annotated)
- Committer:
- klauss
- Date:
- Fri Oct 24 15:52:12 2014 +0000
- Revision:
- 60:b4ec6beb3be3
- Parent:
- 0:4d17cd9c8f9d
- Child:
- 69:65665afbad5d
silence start_ext end_ext implementado
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #ifndef _RTPBUF_H |
klauss | 0:4d17cd9c8f9d | 2 | #define _RTPBUF_H |
klauss | 0:4d17cd9c8f9d | 3 | |
klauss | 0:4d17cd9c8f9d | 4 | #include <stdint.h> |
klauss | 60:b4ec6beb3be3 | 5 | #include "debug.h" |
klauss | 0:4d17cd9c8f9d | 6 | |
klauss | 0:4d17cd9c8f9d | 7 | /* IMPORTANT: sizes must be multiple of 4 */ |
klauss | 0:4d17cd9c8f9d | 8 | #define RTPBUF_PKGSIZE 240 /* 30ms @ 8Ksamples/sec */ |
klauss | 0:4d17cd9c8f9d | 9 | #define RTPBUF_BUFSIZE 320 /* 40ms @ 8Ksamples/sec */ |
klauss | 0:4d17cd9c8f9d | 10 | |
klauss | 0:4d17cd9c8f9d | 11 | #if (RTPBUF_PKGSIZE & 0x03) |
klauss | 0:4d17cd9c8f9d | 12 | # error OPS... value forbidden |
klauss | 0:4d17cd9c8f9d | 13 | #endif |
klauss | 0:4d17cd9c8f9d | 14 | #if (RTPBUF_BUFSIZE & 0x03) |
klauss | 0:4d17cd9c8f9d | 15 | # error OPS... value forbidden |
klauss | 0:4d17cd9c8f9d | 16 | #endif |
klauss | 0:4d17cd9c8f9d | 17 | |
klauss | 0:4d17cd9c8f9d | 18 | struct rtpbuf { |
klauss | 0:4d17cd9c8f9d | 19 | uint32_t b[ RTPBUF_BUFSIZE>>2 ]; |
klauss | 0:4d17cd9c8f9d | 20 | int size; |
klauss | 0:4d17cd9c8f9d | 21 | }; |
klauss | 0:4d17cd9c8f9d | 22 | typedef struct rtpbuf rtpbuf_t; |
klauss | 0:4d17cd9c8f9d | 23 | |
klauss | 0:4d17cd9c8f9d | 24 | /* clear the buffer, useful at the start of a new phone call */ |
klauss | 0:4d17cd9c8f9d | 25 | void rtpbuf_clear (rtpbuf_t * self); |
klauss | 0:4d17cd9c8f9d | 26 | |
klauss | 0:4d17cd9c8f9d | 27 | /* use this function to put audio into the fifo */ |
klauss | 0:4d17cd9c8f9d | 28 | void rtpbuf_put (rtpbuf_t * self, int size, uint8_t * data); |
klauss | 0:4d17cd9c8f9d | 29 | |
klauss | 0:4d17cd9c8f9d | 30 | /* use this function to check if there is audio available |
klauss | 0:4d17cd9c8f9d | 31 | * returns NULL if there is no audio available |
klauss | 0:4d17cd9c8f9d | 32 | * or returns a pointer to the audio package */ |
klauss | 0:4d17cd9c8f9d | 33 | uint8_t * rtpbuf_get (rtpbuf_t * self); |
klauss | 0:4d17cd9c8f9d | 34 | |
klauss | 0:4d17cd9c8f9d | 35 | /* use this function to tell rtpbuf that you already consumed |
klauss | 0:4d17cd9c8f9d | 36 | * the data supplied by rtpbuf_get() */ |
klauss | 0:4d17cd9c8f9d | 37 | void rtpbuf_next (rtpbuf_t * self); |
klauss | 0:4d17cd9c8f9d | 38 | |
klauss | 0:4d17cd9c8f9d | 39 | #endif |