[FFmpeg-devel] [PATCH] RTP/Vorbis payload implementation (GSoC qual task)

Colin McQuillan m.niloc
Sun Apr 12 14:48:26 CEST 2009


Thanks for the reviews! Updated patch attached.

2009/4/12 Luca Barbato <lu_zero at gentoo.org>:
[...]
>
> +/**
> + * Length encoding described in RFC5215 section 3.1.1.
> + */
> +static int read_base128(uint8_t ** buf, uint8_t * buf_end)
> +{
> +    int n = 0;
> +    for (; *buf < buf_end; ++*buf) {
> +        n <<= 7;
> +        n += **buf & 0x7f;
> +        if (!(**buf & 0x80)) {
> +            ++*buf;
> +            return n;
> +        }
> +    }
> +    return 0;
> +}
>
> You should use the implementation that's already present in ffmpeg.
>

There's a ByteIOContext function ff_get_v but I couldn't find anything
for plain bytes (I grepped for <<=\?\s*7 and \*\s*128).

2009/4/12 Michael Niedermayer <michaelni at gmx.at>:
[...]

>
>> +
>> + ? ? ? ?/* loop on each attribute */
>> + ? ? ? ?while (rtsp_next_attr_and_value
>> + ? ? ? ? ? ? ? (&p, attr, sizeof(attr), value, value_alloc)) {
>> + ? ? ? ? ? ?/* grab the codec extra_data from the config parameter of the fmtp line */
>> + ? ? ? ? ? ?sdp_parse_fmtp_config_vorbis(stream, vorbis_data, attr, value);
>> + ? ? ? ?}
>> + ? ? ? ?av_free(value);
>
> also duplicate to at least rtp_h264.c
>
[...]

The while loop is common to both. Would you suggest a
rtsp_next_attr_and_value_foreach that takes a function pointer? I
don't see any other factoring to be done here since different SDP
parameters are interesting to different protocols.

--
Colin McQuillan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-vorbis-rtp-2.patch
Type: text/x-diff
Size: 11184 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090412/75c33550/attachment.patch>



More information about the ffmpeg-devel mailing list