GNOME Bugzilla – Bug 380895
A couple of corrections and improvements for the RTSP support
Last modified: 2007-01-10 15:20:24 UTC
The attached patch resolves a couple of problems with the current RTSP support. It also adds a couple of features to make it possible to use the RTSP code in an RTSP server. Below is a suggested commit message, outlining the changes. * gst/rtsp/rtspconnection.c: (rtsp_connection_create): Allow url to be NULL to be able to use it for server connections. * gst/rtsp/rtspconnection.c: (rtsp_connection_connect): Require that conn->url is non-NULL. * gst/rtsp/rtspconnection.c: (rtsp_connection_send): Can now send responses as well as requests. * gst/rtsp/rtspconnection.c: (read_line): No longer hangs in an endless loop if EOF is received. * gst/rtsp/rtspdefs.c: (rtsp_init_status), (rtsp_status_as_text): Can now convert a status code to a text string. * gst/rtsp/rtspdefs.c: (rtsp_status_to_string): Removed. * gst/rtsp/rtspdefs.c: (rtsp_find_header_field): Return RTSP_HDR_INVALID for unknown headers. * gst/rtsp/rtspdefs.c: (rtsp_find_method): Return RTSP_INVALID for unknown methods. * gst/rtsp/rtspmessage.c: (rtsp_message_new): Create an empty message. * gst/rtsp/rtspmessage.c: (rtsp_message_init): Intialize an empty message. * gst/rtsp/rtspmessage.c: (rtsp_message_new_response), (rtsp_message_init_response): Allow reason to be NULL, in which case rtsp_status_as_text() is used to find the reason to use. * gst/rtsp/rtspmessage.c: (rtsp_message_init_response): Copy CSeq and Session headers from the request. * gst/rtsp/rtspmessage.c: (rtsp_message_unset): Only free memory corresponding to the currently set message type. * gst/rtsp/rtspmessage.c: (rtsp_message_get_header): Allow value to be NULL, to allow for checking the existence of a header without retrieving it. * gst/rtsp/rtspmessage.c: (rtsp_message_new_request), (rtsp_message_init_request), (rtsp_message_new_response), (rtsp_message_init_response), (rtsp_message_add_header), (rtsp_message_get_header), (rtsp_message_set_body), (rtsp_message_get_body): * gst/rtsp/rtspmessage.h: Added const to function arguments as appropriate. * gst/rtsp/rtspconnection.c: (read_line), (rtsp_connection_read): * gst/rtsp/rtspmessage.c: (dump_mem): * gst/rtsp/sdpmessage.c: (sdp_message_get_attribute_val_n), (sdp_media_get_attribute_val_n), (read_string), (read_string_del), (sdp_message_parse_buffer), (print_media), (sdp_message_dump): Use guint rather than gint to avoid compiler warnings. * gst/rtsp/sdpmessage.c: (sdp_parse_line): Avoid a compiler warning when initializing nmedia.
Created attachment 77420 [details] [review] Strengthen the RTSP implementation.
Btw, the above commit message may not be compatible with cicl, as it does not mention gst/rtsp/gstrtspsrc.c, and mentions some files multiple times.
going to commit this after the freeze.
commited, thanks!