[FFmpeg-devel] [PATCH] RTP depacketizer for AMR

Martin Storsjö martin
Sun Jan 31 21:29:59 CET 2010


On Wed, 27 Jan 2010, Ronald S. Bultje wrote:

> On Wed, Jan 27, 2010 at 7:50 AM, Martin Storsj? <martin at martin.st> wrote:
> > Here's the first shot at an RTP depacketizer for AMR. It has been tested
> > with libavformat's RTP AMR packetizer, QuickTime Broadcaster and samples
> > from Darwin Streaming Server.
> 
> Does it work with Colin & Vitor's AMR decoder?

Tested with the SoC AMR decoder, works just fine.

> > I also tried returning all frames at once, but ffmpeg.c gives the
> > "Multiple frames in a packet from stream" error message (but works fine
> > except for that).
> 
> CODEC_CAP_SUBFRAMES in the decoder fixes that.

Returning all frames from the packet at once, for now.

> > +static int amr_parse_sdp_line(AVFormatContext *s, int st_index,
> > +                              PayloadContext *data, const char *line)
> [..]
> > +    if (av_strstart(line, "fmtp:", &p)) {
> [..]
> > +        while (*p && *p == ' ') p++; /* strip spaces */
> > +        while (*p && *p != ' ') p++; /* eat protocol identifier */
> > +        while (*p && *p == ' ') p++; /* strip trailing spaces */
> > +
> > +        while (rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, sizeof(value))) {
> > +            if (!strcmp(attr, "octet-align"))
> > +                octet_align = atoi(value);
> > +            else if (!strcmp(attr, "crc"))
> > +                crc = atoi(value);
> > +            else if (!strcmp(attr, "interleaving"))
> > +                interleaving = atoi(value);
> > +            else if (!strcmp(attr, "channels"))
> > +                channels = atoi(value);
> > +        }
> 
> Can you document what format it's looking for here?

Documented.

Updated patch that returns all frames from the RTP packet at once. All 
other issues are taken care of, except for sharing the frame size tables 
with other code handling AMR.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtpdec-amr.patch
Type: text/x-diff
Size: 10332 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100131/114b2ea9/attachment.patch>



More information about the ffmpeg-devel mailing list