mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 07:26:29 +00:00
gsturi: Optimisation : Cast when we're sure of the type.
Also directly access GstElementFactory->uri_type instead of going through a function that will (once again) check whether it's a GstElementFactory
This commit is contained in:
parent
5583220a1d
commit
a9ed7c0ec4
1 changed files with 4 additions and 3 deletions
|
@ -495,9 +495,9 @@ search_by_entry (GstPluginFeature * feature, gpointer search_entry)
|
||||||
|
|
||||||
if (!GST_IS_ELEMENT_FACTORY (feature))
|
if (!GST_IS_ELEMENT_FACTORY (feature))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
factory = GST_ELEMENT_FACTORY (feature);
|
factory = GST_ELEMENT_FACTORY_CAST (feature);
|
||||||
|
|
||||||
if (gst_element_factory_get_uri_type (factory) != entry->type)
|
if (factory->uri_type != entry->type)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
protocols = gst_element_factory_get_uri_protocols (factory);
|
protocols = gst_element_factory_get_uri_protocols (factory);
|
||||||
|
@ -606,7 +606,8 @@ gst_element_make_from_uri (const GstURIType type, const gchar * uri,
|
||||||
possibilities = g_list_sort (possibilities, sort_by_rank);
|
possibilities = g_list_sort (possibilities, sort_by_rank);
|
||||||
walk = possibilities;
|
walk = possibilities;
|
||||||
while (walk) {
|
while (walk) {
|
||||||
if ((ret = gst_element_factory_create (GST_ELEMENT_FACTORY (walk->data),
|
if ((ret =
|
||||||
|
gst_element_factory_create (GST_ELEMENT_FACTORY_CAST (walk->data),
|
||||||
elementname)) != NULL) {
|
elementname)) != NULL) {
|
||||||
GstURIHandler *handler = GST_URI_HANDLER (ret);
|
GstURIHandler *handler = GST_URI_HANDLER (ret);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue