[FFmpeg-devel] [PATCH/RFC] change function prototype of parse_sdp_a_line

Ronald S. Bultje rsbultje
Mon Nov 17 15:56:03 CET 2008


Hi,

long subject / separate thread to attract attention from the Lucas,
after our previous discussions.

So, here's what I have: RDT is integrated now (mostly). The SDP
contains lines like this (uncut):

sdp: v='0'
sdp: o='- 380109 380109 IN IP4 192.168.97.57'
sdp: s='Absolute Radio LIVE from London UK in Real Audio 10 AAC'
sdp: i='Absolute Radio (C) TIML Radio Limited 2008'
sdp: c='IN IP4 0.0.0.0'
sdp: t='0 0'
sdp: a='SdpplinVersion:1610641560'
sdp: a='StreamCount:integer;1'
sdp: a='control:*'
sdp: a='Clock Start Time:integer;1314992104'
sdp: a='Content Rating:integer;0'
sdp: a='Flags:integer;9'
sdp: a='IsRealDataType:integer;1'
sdp: a='LiveStream:integer;1'
sdp: a='Author:buffer;"QWJzb2x1dGUgUmFkaW8A"'
sdp: a='Copyright:buffer;"KEMpIFRJTUwgUmFkaW8gTGltaXRlZCAyMDA4AA=="'
sdp: a='Title:buffer;"QWJzb2x1dGUgUmFkaW8gTElWRSBmcm9tIExvbmRvbiBVSyBpbiBSZWFsIEF1ZGlvIDEwIEFBQwA="'
sdp: a='Audiences:string;"16k Substream for 28k Dial-up;28k
Dial-up;56k Dial-up;150k LAN;"'
sdp: a='audioMode:string;"music"'
sdp: a='Creation Date:string;"10/30/2008 15:31:11"'
sdp: a='Generated By:string;"Helix Producer SDK 10.0 for Windows,
Build 10.0.0.195"'
sdp: a='Modification Date:string;"10/30/2008 15:31:11"'
sdp: a='videoMode:string;"normal"'
sdp: m='audio 0 RTP/AVP 101'
sdp: b='AS:134'
sdp: b='RR:4800'
sdp: b='RS:1600'
sdp: a='control:streamid=0'
sdp: a='range:npt=0-'
sdp: a='length:npt=0'
sdp: a='rtpmap:101 x-pn-multirate-realaudio-live/1000'
sdp: a='fmtp:101 '
sdp: a='mimetype:string;"audio/x-pn-multirate-realaudio-live"'
sdp: a='AvgBitRate:integer;128000'
sdp: a='ActualPreroll:integer;2229'
sdp: a='AvgPacketSize:integer;1500'
sdp: a='EndTime:integer;0'
sdp: a='MaxBitRate:integer;128000'
sdp: a='MaxPacketSize:integer;1500'
sdp: a='MinimumSwitchOverlap:integer;200'
sdp: a='Preroll:integer;4458'
sdp: a='SeekGreaterOnSwitch:integer;0'
sdp: a='StartTime:integer;0'
sdp: a='OpaqueData:buffer;"TUxUSQAIAAAAAAABAAEAAgACAAMAAwAEAAAAVi5yYf0ABQAALnJhNQAAABAABQAAAEYAAgAAAjQAAAAAAAHaYAAAAAAACAI0AC8AAAAAViIAAFYiAAAAEAABZ2VucmNvb2sBBwAAAAAACAEAAAECAAASAAAAVi5yYf0ABQAALnJhNQAAABAABQAAAEYAAwAAAlgAAAAAAAJdmQAAAAAACQJYADwAAAAAViIAAFYiAAAAEAABZ2VucmNvb2sBBwAAAAAACAEAAAECAAAXAAAAXi5yYf0ABQAALnJhNQAAABAABQAAAE4AFQAAAdEAAAAAAAOqtAAAAAAAEAHRAF0AAAAArEQAAKxEAAAAEAACZ2VucmNvb2sBBwAAAAAAEAEAAAMIAAAgAAAAAAACAAQAAABRLnJh/QAFAAAucmE1AAAAEAAFAAAAQQACAAABcwAAAAAADqYAAAAAAAABAXMBcwAAAACsRAAArEQAAAAQAAJ2YnJmcmFhYwEHAAAAAAADAhIQ"'
sdp: a='RMFF 1.0 Flags:buffer;"AAgAAgAAAAIAAAACAAAAAgAA"'
sdp: a='ASMRuleBook:string;"#($Bandwidth <
20671),AverageBandwidth=16192,Priority=5;#($Bandwidth <
20671),AverageBandwidth=0,Priority=5,OnDepend=\"1\",
OffDepend=\"1\";#($Bandwidth >= 20671) && ($Bandwidth <
32041),AverageBandwidth=20671,Priority=5;#($Bandwidth >= 20671) &&
($Bandwidth < 32041),AverageBandwidth=0,Priority=5,OnDepend=\"2\",
OffDepend=\"2\";#($Bandwidth >= 32041) && ($Bandwidth <
128000),AverageBandwidth=32041,Priority=5;#($Bandwidth >= 32041) &&
($Bandwidth < 128000),AverageBandwidth=0,Priority=5,OnDepend=\"4\",
OffDepend=\"4\";#($Bandwidth >=
128000),AverageBandwidth=128000,Priority=5;#($Bandwidth >=
128000),AverageBandwidth=0,Priority=5,OnDepend=\"6\",
OffDepend=\"6\";"'
sdp: a='StreamName:string;"Audio Stream"'

You see that after the m= line, a lot of data follows that is all part
of this m= line. In case of multiple m= lines, each of them are
repeated per m= line. the ASMRuleBook or OpaqueData lines can be used
to detect how many streams this particular set has (these are
Michael's terminology; in the Real specs, a set is a stream and a
stream is a rule). In lavf/c, we want to create one AVStream per
stream/rule. Fortunately, the RTSP/RTP stack has a nice separation
between RSTPStream and AVStream, and this separation works so well
that I was able (without any patching in rtsp.c or rtp*.c) to map one
RTSPStream to multiple AVStreams.

The problem is that I need to create and access these streams when I
need them. I create them in the parse_sdp_a_line callback in rdt.c,
and that I currently do in the ff_real_parse_sdp_a_line() function
(this is the *server*-specific SDP line parsing, not the *RTP
payload*-specific SDP line parsing), which therefore has access to a
AVFormatContext. That is already in SVN. The second thing I need is
that I need access to *all* streams when I parse the OpaqueData in the
subsequent callback to the payload-SDP line parsing function
(rdt_parse_sdp_a_line() in this case). Currently, this function takes
an AVStream, which means it won't work for RTSP implementations that
support stream selection.

There are multiple solutions for this, and my patch is just a simple
try at one of them, I'm open to whatever:
- make parse_sdp_a_line take a AVFormatContext. this solves everything for now.
- export RTSPStream, add pointers to the AVStream array and make
parse_sdp_a_line take a RTSPStream.
- completely change my implementation of how RTSPStreams and AVStreams
map to each other?
- something entirely different?

Please comment. :-).

Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rtsp-change-parse_sdp_a_line-prototype.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081117/612f66a4/attachment.txt>



More information about the ffmpeg-devel mailing list