[FFmpeg-devel] [PATCH] RTSP-MS 12/15: ASF payload support

Michael Niedermayer michaelni
Sat Jan 10 23:50:06 CET 2009


On Tue, Jan 06, 2009 at 12:15:41AM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> RTSP-MS servers send out ASF payloads, basically ASF packets. The RTSP
> packet header identifies these by the RTSP stream ID (starting at 0),
> whereas internally, these are matched to their ASF stream ID (which
> starts at 1). These two are incompatible, and therefore every RTSP
> stream has a stream:<ASF stream ID> property in the SDP to match the
> two against each other. This patch adds support for the ASF payload
> and parses that stream to match ASF streams against RTSP streams.
> 
> In this case, we use that to copy the ASF stream data (from the
> previously parsed ASF header) back into the RTSP AVStream object. This
> is probably ugly, but I don't think it's possible to work around it,
> or at the very least I wouldn't know how to. Let me know if anyone has
> thoughts on this...
[...]
> +static int
> +asfrtp_parse_sdp_line (AVFormatContext *s, int stream_index,
> +                       PayloadContext *asf, const char *line)
> +{
> +    if (av_strstart(line, "stream:", &line)) {
> +        RTSPState *rt = s->priv_data;
> +
> +        s->streams[stream_index]->id = strtol(line, NULL, 10);
> +
> +        if (rt->asf_ctx) {
> +            int i;
> +
> +            for (i = 0; i < rt->asf_ctx->nb_streams; i++) {
> +                if (s->streams[stream_index]->id == rt->asf_ctx->streams[i]->id) {
> +                    *s->streams[stream_index]->codec =
> +                        *rt->asf_ctx->streams[i]->codec;

> +                    s->streams[stream_index]->codec->extradata =
> +                        av_malloc(s->streams[stream_index]->codec->extradata_size);
> +                    memcpy(s->streams[stream_index]->codec->extradata,
> +                           rt->asf_ctx->streams[i]->codec->extradata,
> +                           s->streams[stream_index]->codec->extradata_size);

you are missing FF_INPUT_BUFFER_PADDING_SIZE besides
why not just set extradata(_size) to 0 in the source? or does that fail somehow?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090110/13481b70/attachment.pgp>



More information about the ffmpeg-devel mailing list