Add some more documentation and do some minor cleanups here and there.
GstElement *pipeline;
GstStateChangeReturn ret;
- /* find the factory for the uri first */
- if (!(factory = gst_rtsp_media_mapping_find_factory (client->mapping, uri)))
- goto no_factory;
/* check what kind of format is accepted, we don't really do anything with it
* and always return SDP for now. */
break;
}
- /* create a pipeline to preroll the media */
- pipeline = gst_pipeline_new ("client-describe-pipeline");
+ /* find the factory for the uri first */
+ if (!(factory = gst_rtsp_media_mapping_find_factory (client->mapping, uri)))
+ goto no_factory;
/* prepare the media and add it to the pipeline */
if (!(media = gst_rtsp_media_factory_construct (factory, uri)))
goto no_media;
+
+ /* create a pipeline to preroll the media */
+ pipeline = gst_pipeline_new ("client-describe-pipeline");
gst_bin_add (GST_BIN_CAST (pipeline), media->element);
GstRTSPMethod options;
GString *str;
- gst_rtsp_message_init_response (&response, GST_RTSP_STS_OK,
- gst_rtsp_status_as_text (GST_RTSP_STS_OK), request);
-
options = GST_RTSP_DESCRIBE |
GST_RTSP_OPTIONS |
// GST_RTSP_PAUSE |
if (options & GST_RTSP_TEARDOWN)
g_string_append (str, ", TEARDOWN");
+ gst_rtsp_message_init_response (&response, GST_RTSP_STS_OK,
+ gst_rtsp_status_as_text (GST_RTSP_STS_OK), request);
+
gst_rtsp_message_add_header (&response, GST_RTSP_HDR_PUBLIC, str->str);
g_string_free (str, TRUE);
{
GstRTSPMediaFactory *result;
- /* find the location of the media in the hashtable */
+ /* find the location of the media in the hashtable we only use the absolute
+ * path of the uri to find a mapping. If the mapping depends on other
+ * properties found in the url, this method should be overridden. */
result = g_hash_table_lookup (mapping->mappings, url->abspath);
if (result)
g_object_ref (result);
* @mapping: a #GstRTSPMediaMapping
* @url: a url
*
- * Find the #GstRTSPMediaFactory for @url from the mappings registered in @mapping.
+ * Find the #GstRTSPMediaFactory for @url. The default implementation of this object
+ * will use the mappings added with gst_rtsp_media_mapping_add_factory ().
*
* Returns: the #GstRTSPMediaFactory for @url. g_object_unref() after usage.
*/
* GstRTSPMediaMapping:
* @mappings: the mountpoint to media mappings
*
- * Creates a #GstRTSPMedia object for a given url.
+ * Creates a #GstRTSPMediaFactory object for a given url.
*/
struct _GstRTSPMediaMapping {
GObject parent;
GHashTable *mappings;
};
+/**
+ * GstRTSPMediaMappingClass:
+ * @find_media: Create or return a previously cached #GstRTSPMediaFactory object
+ * for the given url. the default implementation will use the mappings
+ * added with gst_rtsp_media_mapping_add_factory ().
+ *
+ * The class for the media mapping object.
+ */
struct _GstRTSPMediaMappingClass {
GObjectClass parent_class;
* GstRTSPMedia:
* @media: the owner #GstRTSPMedia
*
- * A class that contains the elements to handle the media
- * provided by @media.
+ * A class that contains the GStreamer element along with a list of
+ * #GstRTSPediaStream objects that can produce data.
+ *
+ * This object is usually created from a #GstRTSPMediaFactory.
*/
struct _GstRTSPMedia {
GObject parent;
* @lock: locking the session hashtable
* @session: hashtable of sessions indexed by the session id.
*
- * An object that keeps track of the active sessions.
+ * An object that keeps track of the active sessions. This object is usually
+ * attached to a #GstRTSPServer object to manage the sessions in that server.
*/
struct _GstRTSPSessionPool {
GObject parent;
/**
* GstRTSPSessionPoolClass:
- *
- * @create_session_id: create a new random session id. Subclasses should not
- * check if the session exists.
+ * @create_session_id: create a new random session id. Subclasses can create
+ * custom session ids and should not check if the session exists.
*/
struct _GstRTSPSessionPoolClass {
GObjectClass parent_class;