[FFmpeg-devel] [PATCH] rtsp: Store some parsed values straight to RTSPState
Martin Storsjö
martin
Mon Dec 27 10:04:45 CET 2010
Hi,
In the review of the patch for adding support for the Content-Base header
some weeks ago, Ronald pointed out that storing large strings (a URL) in
the RTSPMessageHeader struct isn't really optimal. (This struct is stored
on the stack in many places.)
Attached is a patchset that changes ff_rtsp_parse_line to receive a
pointer to the RTSPState, together with the method name (since we might
want to handle some headers differently depending on which method it was a
reply to), and lastly changes the parsing of Content-Base to store the
result directly in RTSPState.
This is a slight change in the architecture of the RTSP header parsing -
initially it never took any action, it simply parsed out the reply headers
into a struct that the caller inspected, who chose what to do with it.
With this in place, the parser itself can change state, too. (The http
auth parsing was an exception before, which also updated state directly.)
With this in place, parsing of the RTP-Info header is much more
straightforward - if done without this, RTSPMessageHeader would grow a
lot, if storing all the urls of all streams.
// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-rtsp-Add-a-method-parameter-to-ff_rtsp_read_reply.patch
Type: text/x-diff
Size: 3913 bytes
Desc:
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101227/707a2c22/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-rtsp-Pass-RTSPState-to-ff_rtsp_parse_line-instead-of.patch
Type: text/x-diff
Size: 3024 bytes
Desc:
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101227/707a2c22/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-rtsp-Pass-the-method-name-to-ff_rtsp_parse_line.patch
Type: text/x-diff
Size: 2171 bytes
Desc:
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101227/707a2c22/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-rtsp-Store-the-Content-Base-header-value-straight-to.patch
Type: text/x-diff
Size: 2253 bytes
Desc:
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101227/707a2c22/attachment-0003.patch>
More information about the ffmpeg-devel
mailing list