[FFmpeg-devel] [PATCH] RTP depacketizer for AMR
Ronald S. Bultje
rsbultje
Wed Jan 27 17:58:13 CET 2010
Hi,
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?
> 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.
> +static const uint8_t frame_sizes_nb[16] = {
> + 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
> +};
Can this be shared with the AMR decoder that is in Vitor's patch? (I
didn't see it on quick look.)
> + /* Make sure we've got a local buffer for storing the packet
> + * while returning one frame at a time. */
> + if (!data->buf || data->buf_size < len) {
> + av_freep(&data->buf);
> + data->buf_size = len;
> + data->buf = av_malloc(data->buf_size);
> + if (!data->buf) {
> + av_log(ctx, AV_LOG_ERROR, "Out of memory\n");
> + return AVERROR_NOMEM;
> + }
> + }
*_dyn_pkt_buf.
> +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?
Ronald
More information about the ffmpeg-devel
mailing list