Commit e491d243 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

use gst_element_factory_get_metadata to replace obsolete API

parent c629a441
......@@ -1483,7 +1483,8 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
* we insert a capsfilter with the sorted caps of all possible next
* elements and continue with the capsfilter srcpad */
factory = gst_element_get_factory (src);
classification = gst_element_factory_get_klass (factory);
classification =
gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
is_parser_converter = (strstr (classification, "Parser")
&& strstr (classification, "Converter"));
......@@ -1551,7 +1552,8 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
GstCaps *tcaps;
/* We are only interested in skipping decoders */
if (strstr (gst_element_factory_get_klass (factory), "Decoder")) {
if (strstr (gst_element_factory_get_metadata (factory,
GST_ELEMENT_METADATA_KLASS), "Decoder")) {
GST_DEBUG ("Trying factory %s",
gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
......@@ -1901,7 +1903,8 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
* parser is the only one that does not change the data. A
* valid example for this would be multiple id3demux in a row.
*/
if (strstr (gst_element_factory_get_klass (factory), "Parser")) {
if (strstr (gst_element_factory_get_metadata (factory,
GST_ELEMENT_METADATA_KLASS), "Parser")) {
gboolean skip = FALSE;
GList *l;
......@@ -2573,7 +2576,8 @@ is_demuxer_element (GstElement * srcelement)
gint potential_src_pads = 0;
srcfactory = gst_element_get_factory (srcelement);
klass = gst_element_factory_get_klass (srcfactory);
klass =
gst_element_factory_get_metadata (srcfactory, GST_ELEMENT_METADATA_KLASS);
/* Can't be a demuxer unless it has Demux in the klass name */
if (!strstr (klass, "Demux"))
......
......@@ -3543,7 +3543,8 @@ autoplug_select_cb (GstElement * decodebin, GstPad * pad,
/* it's a sink, see if an instance of it actually works */
GST_DEBUG_OBJECT (playbin, "we found a sink");
klass = gst_element_factory_get_klass (factory);
klass =
gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
/* figure out the klass */
if (strstr (klass, "Audio")) {
......
......@@ -188,7 +188,8 @@ _is_renderer (GstElementFactory * factory)
{
const gchar *klass, *name;
klass = gst_element_factory_get_klass (factory);
klass =
gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory));
if (klass != NULL) {
......@@ -206,7 +207,8 @@ _is_parser (GstElementFactory * factory)
{
const gchar *klass;
klass = gst_element_factory_get_klass (factory);
klass =
gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
if (klass != NULL && strstr (klass, "Parser/Subtitle") != NULL)
return TRUE;
......@@ -355,13 +357,15 @@ _factory_filter (GstPluginFeature * feature, GstCaps ** subcaps)
if (is_renderer && have_video_sink && templ_caps) {
GST_DEBUG ("Found renderer element %s (%s) with caps %" GST_PTR_FORMAT,
gst_element_factory_get_longname (factory),
gst_element_factory_get_metadata (factory,
GST_ELEMENT_METADATA_LONGNAME),
gst_plugin_feature_get_name (feature), templ_caps);
*subcaps = gst_caps_merge (*subcaps, templ_caps);
return TRUE;
} else if (!is_renderer && !have_video_sink && templ_caps) {
GST_DEBUG ("Found parser element %s (%s) with caps %" GST_PTR_FORMAT,
gst_element_factory_get_longname (factory),
gst_element_factory_get_metadata (factory,
GST_ELEMENT_METADATA_LONGNAME),
gst_plugin_feature_get_name (feature), templ_caps);
*subcaps = gst_caps_merge (*subcaps, templ_caps);
return TRUE;
......
......@@ -248,7 +248,8 @@ gst_caps_list_compatible_codecs (const GstCaps * containerformat,
factory = (GstElementFactory *) tmp->data;
GST_DEBUG ("Trying with factory %s",
gst_element_factory_get_longname (factory));
gst_element_factory_get_metadata (factory,
GST_ELEMENT_METADATA_LONGNAME));
/* Match all muxer sink pad templates against the available codec formats */
templates = gst_element_factory_get_static_pad_templates (factory);
......
......@@ -1918,7 +1918,8 @@ filter_features (GstPluginFeature * feature, gpointer data)
if (!GST_IS_ELEMENT_FACTORY (feature))
return FALSE;
f = GST_ELEMENT_FACTORY (feature);
if (!g_strrstr (gst_element_factory_get_klass (f), "Visualization"))
if (!g_strrstr (gst_element_factory_get_metadata (f,
GST_ELEMENT_METADATA_KLASS), "Visualization"))
return FALSE;
return TRUE;
......@@ -1939,7 +1940,8 @@ init_visualization_features (void)
const gchar *name;
entry.factory = GST_ELEMENT_FACTORY (walk->data);
name = gst_element_factory_get_longname (entry.factory);
name = gst_element_factory_get_metadata (entry.factory,
GST_ELEMENT_METADATA_LONGNAME);
g_array_append_val (vis_entries, entry);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (vis_combo), name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment