[Ffmpeg-devel] [PATCH] RTP payload format for AMR

Michael Niedermayer michaelni
Wed Mar 14 23:41:25 CET 2007


Hi

On Mon, Mar 12, 2007 at 08:16:42PM +0530, Kite Flyer wrote:
> Hi Michael,
> 
> Thanks for your input. Attached patch is based on the same. Pls see inline.
[...]
> >non constant static and global arrays are forbidden in libav* (with 
> >exceptions
> >for debug code and arrays which are initalized once but never changed)
> >2 RTP instances could not coexist otherwise ...
> >
> 
> Very true. My indifference.
> 
> >one easy way to pack the AMR frames is:
> >
> >uint8_t *toc_buf= s->buf;
> 
> I made it s->buf  + 1 to take care of the (CMR,RRRR) byte before TOC.
> 
> >uint8_t *buf= s->buf + TOC_MAX;
> 
> I have set TOC_MAX to max_payload_size/ 13 where 13 = 1 (toc_byte) +
> 12 (4.75 kbps frame length). It should take care of the one byte
> length for the (CMR,RRRR) byte too.
> 
> >
> >payload_size= s->buf_ptr - buf + size;
> >if(   s->foobar >= TOC_MAX
> >   || TOC_MAX + payload_size  > sizeof(s->buf)
> >   || s->foobar + 1 + payload_size > s->max_payload_size){
> >
> 
> First condition checks if TOC buffer is full. Second condition should
> check if speech buf alone is full. If so, is the third condition
> needed? Pls see my patch.

patch looks ok


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070314/2ebabc72/attachment.pgp>



More information about the ffmpeg-devel mailing list