I'm in the middle of building an RTSP server, and am creating two request/response objects named TRTSPRequest
and TRTSPResponse
similar to TWebRequest
and TWebResponse
but specific to RTSP. I have a feeling I'm re-inventing the wheel and that there's a much easier path I can take here. I've gotten 400 lines of code into creating this server, and most of it is just parsing the request headers.
Is there something in Delphi XE2 / Indy 10 I can re-use that can parse the RTSP headers for me? Or am I stuck having to parse it all myself?
Since RTSP is very similar to HTTP, can I use the HTTP request/response objects? Or will it get confused by the RTSP structure?
For example, can I use IdHTTPHeaderInfo.pas
and tweak it all for RTSP and call it IdRTSPHeaderInfo.pas
?
According to RFC 2326...
Easy to parse: RTSP can be parsed by standard HTTP or MIME parsers.
and
HTTP-friendly: Where sensible, RTSP reuses HTTP concepts, so that the existing infrastructure can be reused. This infrastructure includes PICS (Platform for Internet Content Selection [15,16]) for associating labels with content. However, RTSP does not just add methods to HTTP since the controlling continuous media requires server state in most cases.
So how should I do this?