gst/rtsp/: Use rank to filter out extensions.

Original commit message from CVS:
* gst/rtsp/gstrtspext.c: (gst_rtsp_ext_list_filter),
(gst_rtsp_ext_list_stream_select):
* gst/rtsp/gstrtspext.h:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_setup_streams):
Use rank to filter out extensions.
Add url to stream_select interface call.
This commit is contained in:
Wim Taymans 2007-07-26 15:48:47 +00:00
parent fa9c47f14d
commit 9fa21084bf
4 changed files with 19 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2007-07-26 Wim Taymans <wim.taymans@gmail.com>
* gst/rtsp/gstrtspext.c: (gst_rtsp_ext_list_filter),
(gst_rtsp_ext_list_stream_select):
* gst/rtsp/gstrtspext.h:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_setup_streams):
Use rank to filter out extensions.
Add url to stream_select interface call.
2007-07-25 Wim Taymans <wim.taymans@gmail.com>
* gst/rtsp/Makefile.am:

View file

@ -51,6 +51,7 @@ static gboolean
gst_rtsp_ext_list_filter (GstPluginFeature * feature, gpointer user_data)
{
GstElementFactory *factory;
guint rank;
/* we only care about element factories */
if (!GST_IS_ELEMENT_FACTORY (feature))
@ -61,6 +62,11 @@ gst_rtsp_ext_list_filter (GstPluginFeature * feature, gpointer user_data)
if (!gst_element_factory_has_interface (factory, "GstRTSPExtension"))
return FALSE;
/* only select elements with autoplugging rank */
rank = gst_plugin_feature_get_rank (feature);
if (rank < GST_RANK_MARGINAL)
return FALSE;
return TRUE;
}
@ -202,7 +208,7 @@ gst_rtsp_ext_list_get_transports (GstRTSPExtensionList * ext,
}
GstRTSPResult
gst_rtsp_ext_list_stream_select (GstRTSPExtensionList * ext)
gst_rtsp_ext_list_stream_select (GstRTSPExtensionList * ext, GstRTSPUrl * url)
{
GList *walk;
GstRTSPResult res = GST_RTSP_OK;
@ -210,7 +216,7 @@ gst_rtsp_ext_list_stream_select (GstRTSPExtensionList * ext)
for (walk = ext->extensions; walk; walk = g_list_next (walk)) {
GstRTSPExtension *elem = (GstRTSPExtension *) walk->data;
res = gst_rtsp_extension_stream_select (elem);
res = gst_rtsp_extension_stream_select (elem, url);
}
return res;
}

View file

@ -70,7 +70,7 @@ GstRTSPResult gst_rtsp_ext_list_setup_media (GstRTSPExtensionList *ext, Gs
gboolean gst_rtsp_ext_list_configure_stream (GstRTSPExtensionList *ext, GstCaps *caps);
GstRTSPResult gst_rtsp_ext_list_get_transports (GstRTSPExtensionList *ext, GstRTSPLowerTrans protocols,
gchar **transport);
GstRTSPResult gst_rtsp_ext_list_stream_select (GstRTSPExtensionList *ext);
GstRTSPResult gst_rtsp_ext_list_stream_select (GstRTSPExtensionList *ext, GstRTSPUrl *url);
G_END_DECLS

View file

@ -3305,7 +3305,7 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
}
}
gst_rtsp_ext_list_stream_select (src->extensions);
gst_rtsp_ext_list_stream_select (src->extensions, src->url);
/* we need to activate the streams when we detect activity */
src->need_activate = TRUE;