[asterisk-video] How do you send large frames?

Olle E Johansson oej at edvina.net
Wed May 17 23:05:08 MST 2006


17 maj 2006 kl. 23.48 skrev John Martin:

> Hi Olle,
>
>  Maybe you missed Duane’s post as the mailing lists switched around…
Yes, I did. Sorry.

Just to check that I understand this: The codec divides the frame  
into several RTP frames itself, so we have individual RTP frames?
Then we really need to fix the formats.

 From format_h624.c:

#define BUF_SIZE        4096    /* Two Real h264 Frames */

------
static struct ast_frame *h264_read(struct ast_filestream *s, int  
*whennext)
{
         int res;
         int mark=0;
         unsigned short len;
         unsigned int ts;
         struct h264_desc *fs = (struct h264_desc *)s->private;

         /* Send a frame from the file to the appropriate channel */
         if ((res = fread(&len, 1, sizeof(len), s->f)) < 1)
                 return NULL;
         len = ntohs(len);
         mark = (len & 0x8000) ? 1 : 0;
         len &= 0x7fff;
         if (len > BUF_SIZE) {
                 ast_log(LOG_WARNING, "Length %d is too long\n", len);
                 len = BUF_SIZE; /* XXX truncate */
         }

--------

Seems like we truncate frames bigger than 4096 bytes on reading from  
file. I don't know where that assumption
came from, but the same BUF_SIZE seems to exist in format_h263 as well.

/O



More information about the asterisk-video mailing list