GNOME Bugzilla – Bug 586180
RTSP improvements
Last modified: 2009-08-24 12:01:52 UTC
As requested by Wim I add a report with my suggested improvements to the RTSP code. The original discussion concerned commit 8ed062f (support for HTTP messages), but I have included all my intended changes here for review as I believe it will better show the ratinale for adding simple HTTP support to the RTSP code. The patch contains the following commits: e326849... rtsp: Add initial buffer support. c6de461... rtsp: Added gst_rtsp_connection_create_from_fd(). 8ed062f... rtsp: Added support for HTTP messages d0b5b51... rtsp: Improved parsing of messages. b97d6c7... rtsp: Made parse_string() return a result. 9ae3686... rtsp: Normalize lines (remove extra whitespace) before parsing. a033959... rtsp: Ignore the Content-Length for POST requests. b32db61... rtsp: Rewrote gen_tunnel_reply(). 7784a77... rtsp: Rewrote setup_tunneling(). b052009... rtsp: Improve parse_line(). 27345f4... rtsp: Add error_full callback to GstRTSPWatchFuncs. ebfb315... rtsp: Add message_blocked to GstRTSPWatchFuncs. 1a946fc... rtsp: Write as much as possible in gst_rtsp_source_dispatch(). a21e495... rtsp: Allow gst_rtsp_connection_do_tunnel() to just setup decoding co ntext. 6fc6010... rtsp: Added gst_rtsp_connection_set_http_mode(). I have also provided the final gstrtspconnection.c file as it can sometimes be hard to tell from the diffs what's actually going on. I have tried my utmost to main compatibility with the current code (including what I believe to be a number of bugs in setup_tunneling()), but as I only use the code for an RTSP server the code is only partially tested for client support.
Created attachment 136876 [details] [review] Git log with diffs
Created attachment 136877 [details] Git log with diffs
Created attachment 136878 [details] The final gstrtspconnection.c
Created attachment 140984 [details] Git log with diffs Updated the patches to match my latest development. This removes ebfb315 which is no longer needed and instead adds b1cada8, ef4226a and f420e7e. With these patches applied I can finally run our complete RTSP test suite without any errors. aff964d... rtsp: Add initial buffer support. 012d03c... rtsp: Added gst_rtsp_connection_create_from_fd(). e4c253d... rtsp: Added support for HTTP messages d34b996... rtsp: Improved parsing of messages. d52b3eb... rtsp: Made parse_string() return a result. 98ed7ad... rtsp: Normalize lines (remove extra whitespace) before parsing. 9424dc1... rtsp: Ignore the Content-Length for POST requests. 810aa3f... rtsp: Rewrote gen_tunnel_reply(). fc0c58f... rtsp: Rewrote setup_tunneling(). 6a1ebff... rtsp: Improve parse_line(). 3bdcc74... rtsp: Add error_full callback to GstRTSPWatchFuncs. 98c41b7... rtsp: Write as much as possible in gst_rtsp_source_dispatch(). cef407d... rtsp: Allow gst_rtsp_connection_do_tunnel() to just setup decoding context. 0c45d76... rtsp: Added gst_rtsp_connection_set_http_mode(). b1cada8... rtsp: Made gst_rtsp_watch_queue_data() thread safe. ef4226a... rtsp: Added new API for sending using GstRTSPWatch. f420e7e... rtsp: Made read_line() support LWS.
Created attachment 140985 [details] The final gstrtspconnection.c Updated gstrtspconnection.c to match my latest development.
Created attachment 141534 [details] Git log with diffs Updated the patches after having tested the code with rtspsrc (a couple of minor fixes required). Also added support for correct parsing of WWW-Authenticate headers (63f7376) and for not splitting headers which should not be split (a5c3520). de8c427... rtsp: Add initial buffer support. c3ec2c1... rtsp: Added gst_rtsp_connection_create_from_fd(). 88da260... rtsp: Added support for HTTP messages 41d582a... rtsp: Improved parsing of messages. a51948d... rtsp: Made parse_string() return a result. f272a47... rtsp: Normalize lines (remove extra whitespace) before parsing. 0fd5139... rtsp: Ignore the Content-Length for POST requests. 27e25c9... rtsp: Rewrote gen_tunnel_reply(). 4db1ca1... rtsp: Rewrote setup_tunneling(). b59748c... rtsp: Improve parse_line(). 63f7376... rtsp: Parse WWW-Authenticate headers correctly. a5c3520... rtsp: Do not split headers which should not be split. 0ae63e6... rtsp: Made read_line() support LWS. c63653e... rtsp: Add error_full callback to GstRTSPWatchFuncs. 60118e2... rtsp: Write as much as possible in gst_rtsp_source_dispatch(). ac5c5f4... rtsp: Allow gst_rtsp_connection_do_tunnel() to just setup decoding context. c7f7531... rtsp: Added gst_rtsp_connection_set_http_mode(). cd0891f... rtsp: Made gst_rtsp_watch_queue_data() thread safe. 1fb73d0... rtsp: Added new API for sending using GstRTSPWatch.
Created attachment 141535 [details] The final gstrtspconnection.c Updated gstrtspconnection.c to match my latest development.
This has now been pushed...