VZTECH / Mbed 2 deprecated main_src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rtpbuf.cpp Source File

rtpbuf.cpp

00001 #include "rtpbuf.h"
00002 
00003 void rtpbuf_clear (rtpbuf_t * self) {
00004   self->size = 0;
00005 }
00006 
00007 void rtpbuf_put (rtpbuf_t * self, int size, uint8_t * data){
00008   if ((size + self->size) <= RTPBUF_BUFSIZE){
00009     xmemcpy((uint8_t*)self->b+self->size,data,size);
00010     self->size += size;
00011   }
00012 }
00013 
00014 uint8_t * rtpbuf_get (rtpbuf_t * self) {
00015   if (self->size < RTPBUF_PKGSIZE) { return NULL; }
00016   
00017   return (uint8_t*) self->b;
00018 }
00019 
00020 void rtpbuf_next (rtpbuf_t * self) {
00021   if (self->size >= RTPBUF_PKGSIZE){
00022     self->size -= RTPBUF_PKGSIZE;
00023     if (self->size > 0) {
00024       xmemcpy32(self->b, (self->b)+(RTPBUF_PKGSIZE>>2), self->size);
00025     }
00026   }
00027 }