/* find the factory for the uri first */
if (!(factory =
- gst_rtsp_mount_points_find_factory (priv->mount_points,
- state->uri)))
+ gst_rtsp_mount_points_match (priv->mount_points,
+ state->uri->abspath, NULL)))
goto no_factory;
/* check if we have access to the factory */
static void gst_rtsp_mount_points_finalize (GObject * obj);
-static GstRTSPMediaFactory *find_factory (GstRTSPMountPoints * mounts,
- const GstRTSPUrl * url);
-
static void
gst_rtsp_mount_points_class_init (GstRTSPMountPointsClass * klass)
{
gobject_class->finalize = gst_rtsp_mount_points_finalize;
- klass->find_factory = find_factory;
-
GST_DEBUG_CATEGORY_INIT (rtsp_media_debug, "rtspmountpoints", 0,
"GstRTSPMountPoints");
}
return result;
}
-static GstRTSPMediaFactory *
-find_factory (GstRTSPMountPoints * mounts, const GstRTSPUrl * url)
-{
- g_return_val_if_fail (GST_IS_RTSP_MOUNT_POINTS (mounts), NULL);
- g_return_val_if_fail (url != NULL, NULL);
-
- return gst_rtsp_mount_points_match (mounts, url->abspath, NULL);
-}
-
-/**
- * gst_rtsp_mount_points_find_factory:
- * @mounts: a #GstRTSPMountPoints
- * @url: a url
- *
- * Find the #GstRTSPMediaFactory for @url. The default implementation of this object
- * will use the media factory added with gst_rtsp_mount_points_add_factory ().
- *
- * Returns: (transfer full): the #GstRTSPMediaFactory for @url. g_object_unref() after usage.
- */
-GstRTSPMediaFactory *
-gst_rtsp_mount_points_find_factory (GstRTSPMountPoints * mounts,
- const GstRTSPUrl * url)
-{
- GstRTSPMediaFactory *result;
- GstRTSPMountPointsClass *klass;
-
- g_return_val_if_fail (GST_IS_RTSP_MOUNT_POINTS (mounts), NULL);
- g_return_val_if_fail (url != NULL, NULL);
-
- klass = GST_RTSP_MOUNT_POINTS_GET_CLASS (mounts);
-
- if (klass->find_factory)
- result = klass->find_factory (mounts, url);
- else
- result = NULL;
-
- return result;
-}
-
static gboolean
has_prefix (DataItem * str, DataItem * prefix)
{
#include <gst/gst.h>
-#include <gst/rtsp/gstrtspurl.h>
-
#include "rtsp-media-factory.h"
#ifndef __GST_RTSP_MOUNT_POINTS_H__
*/
struct _GstRTSPMountPointsClass {
GObjectClass parent_class;
-
- GstRTSPMediaFactory * (*find_factory) (GstRTSPMountPoints *mounts,
- const GstRTSPUrl *url);
};
GType gst_rtsp_mount_points_get_type (void);
/* creating a mount points */
GstRTSPMountPoints * gst_rtsp_mount_points_new (void);
-GstRTSPMediaFactory * gst_rtsp_mount_points_find_factory (GstRTSPMountPoints *mounts,
- const GstRTSPUrl *url);
-
+/* finding a media factory */
GstRTSPMediaFactory * gst_rtsp_mount_points_match (GstRTSPMountPoints *mounts,
const gchar *path,
gint * matched);
-/* finding a media factory */
/* managing media to a mount point */
void gst_rtsp_mount_points_add_factory (GstRTSPMountPoints *mounts,
const gchar *path,
fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test2",
&url2) == GST_RTSP_OK);
- fail_unless (gst_rtsp_mount_points_find_factory (mounts, url) == NULL);
+ fail_unless (gst_rtsp_mount_points_match (mounts, url->abspath,
+ NULL) == NULL);
factory = gst_rtsp_media_factory_new ();
gst_rtsp_mount_points_add_factory (mounts, "/test", factory);
- fail_unless (gst_rtsp_mount_points_find_factory (mounts, url) == factory);
+ fail_unless (gst_rtsp_mount_points_match (mounts, url->abspath,
+ NULL) == factory);
g_object_unref (factory);
- fail_unless (gst_rtsp_mount_points_find_factory (mounts, url2) == NULL);
+ fail_unless (gst_rtsp_mount_points_match (mounts, url2->abspath,
+ NULL) == NULL);
gst_rtsp_mount_points_remove_factory (mounts, "/test");
- fail_unless (gst_rtsp_mount_points_find_factory (mounts, url) == NULL);
- fail_unless (gst_rtsp_mount_points_find_factory (mounts, url2) == NULL);
+ fail_unless (gst_rtsp_mount_points_match (mounts, url->abspath,
+ NULL) == NULL);
+ fail_unless (gst_rtsp_mount_points_match (mounts, url2->abspath,
+ NULL) == NULL);
gst_rtsp_url_free (url);
gst_rtsp_url_free (url2);