[FFmpeg-devel] [RFC] Separating the RTSP muxer/demuxer and SDP demuxer

Martin Storsjö martin
Thu Oct 7 14:36:59 CEST 2010


On Thu, 7 Oct 2010, Ronald S. Bultje wrote:

> Hi,
> 
> On Thu, Oct 7, 2010 at 6:01 AM, Martin Storsj? <martin at martin.st> wrote:
> > The rtpdec code has dependencies on some other demuxers, that are chained
> > for decoding some formats. More precisely, the asf, rm, mpegts and mov
> > demuxers are used.
> 
> (I don't think you're discussing this part here yet, but here goes
> anyway.) This can be fixed in part, but it's not pretty.
> - mpegts and asf will always be enabled, the RTP stream contains full
> demuxer streams
> - only a small subset of mov/rm is used, so we can split that in new
> shared files or add relevant #if .._DEMUXER in movdec/rmdec.c (little
> ugly)

Yes, this is another issue that can be dealt with separately, if wanted.

> > rtsp.c ? ? ? - handling of RTSP protocol things, shared by the RTSP muxer
> > ? ? ? ? ? ? ? and demuxer
> > rtspenc.c ? ?- RTSP muxer only
> > rtspcommon.c - common code shared by all three components, such as opening
> > ? ? ? ? ? ? ? of the transport contexts, cleanup of transport contexts,
> > ? ? ? ? ? ? ? common parsing helpers such as get_word(), get_word_sep(),
> > ? ? ? ? ? ? ? get_word_until_chars()
> > rtprecv.c ? ?- functions for receiving RTP packets, shared by the RTSP and
> > ? ? ? ? ? ? ? SDP demuxers
> > rtspdec.c ? ?- RTSP demuxer only
> > sdpdec.c ? ? - SDP demuxer only
> >
> > (This is written on top of the patches from the SAP muxer, where common
> > code for setting up a chained RTP muxer is split into rtpenc_chain.c.)
> >
> > So, the files built for each of the three components would be:
> >
> > RTSP muxer: rtsp.c, rtspcommon.c, rtspenc.c
> > RTSP demuxer: rtsp.c, rtspcommon.c, rtprecv.c, rtspdec.c
> > SDP demuxer: rtspcommon.c, rtprecv.c, sdpdec.o
> [..]
> > So, what do you think? Is splitting it this way worthwhile, or does it
> > just separate the code too much, making it harder to follow when the
> > control flow jumps around between all of the files?
> 
> How much space is saved by this?

In a full build, nothing is saved of course. I'm not sure if any of these 
parts are used in space-constrained builds. In a build of the split code, 
the size of the object files are as follows:
rtsp.o 73156
rtspcommon.o 42392
rtspdec.o 48672
sdpdec.o 36068
rtspenc.o 42892
rtprecv.o 54656

All the rtpdec*.o sum up to about 504 KB.

So being able to leave out all the rtpdec code if it ins't desired would 
be quite a big gain, but on the other hand, I don't think anyone is using 
the RTSP muxer in such a space constrained place.

But I'm not sure if this is so desireable from a space saving point of 
view, I think it's more desireable for the build system modularity it 
gives, Diego has wanted to split this code for quite some time.

// Martin



More information about the ffmpeg-devel mailing list