use gst_element_factory_get_metadata to replace obsolete API

This commit is contained in:
Mark Nauwelaerts 2012-09-15 18:57:09 +02:00
parent c629a44162
commit e491d24341
5 changed files with 24 additions and 12 deletions

View file

@ -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 * we insert a capsfilter with the sorted caps of all possible next
* elements and continue with the capsfilter srcpad */ * elements and continue with the capsfilter srcpad */
factory = gst_element_get_factory (src); 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") is_parser_converter = (strstr (classification, "Parser")
&& strstr (classification, "Converter")); && strstr (classification, "Converter"));
@ -1551,7 +1552,8 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
GstCaps *tcaps; GstCaps *tcaps;
/* We are only interested in skipping decoders */ /* 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_DEBUG ("Trying factory %s",
gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory))); 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 * parser is the only one that does not change the data. A
* valid example for this would be multiple id3demux in a row. * 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; gboolean skip = FALSE;
GList *l; GList *l;
@ -2573,7 +2576,8 @@ is_demuxer_element (GstElement * srcelement)
gint potential_src_pads = 0; gint potential_src_pads = 0;
srcfactory = gst_element_get_factory (srcelement); 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 */ /* Can't be a demuxer unless it has Demux in the klass name */
if (!strstr (klass, "Demux")) if (!strstr (klass, "Demux"))

View file

@ -3543,7 +3543,8 @@ autoplug_select_cb (GstElement * decodebin, GstPad * pad,
/* it's a sink, see if an instance of it actually works */ /* it's a sink, see if an instance of it actually works */
GST_DEBUG_OBJECT (playbin, "we found a sink"); 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 */ /* figure out the klass */
if (strstr (klass, "Audio")) { if (strstr (klass, "Audio")) {

View file

@ -188,7 +188,8 @@ _is_renderer (GstElementFactory * factory)
{ {
const gchar *klass, *name; 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)); name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory));
if (klass != NULL) { if (klass != NULL) {
@ -206,7 +207,8 @@ _is_parser (GstElementFactory * factory)
{ {
const gchar *klass; 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) if (klass != NULL && strstr (klass, "Parser/Subtitle") != NULL)
return TRUE; return TRUE;
@ -355,13 +357,15 @@ _factory_filter (GstPluginFeature * feature, GstCaps ** subcaps)
if (is_renderer && have_video_sink && templ_caps) { if (is_renderer && have_video_sink && templ_caps) {
GST_DEBUG ("Found renderer element %s (%s) with caps %" GST_PTR_FORMAT, 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); gst_plugin_feature_get_name (feature), templ_caps);
*subcaps = gst_caps_merge (*subcaps, templ_caps); *subcaps = gst_caps_merge (*subcaps, templ_caps);
return TRUE; return TRUE;
} else if (!is_renderer && !have_video_sink && templ_caps) { } else if (!is_renderer && !have_video_sink && templ_caps) {
GST_DEBUG ("Found parser element %s (%s) with caps %" GST_PTR_FORMAT, 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); gst_plugin_feature_get_name (feature), templ_caps);
*subcaps = gst_caps_merge (*subcaps, templ_caps); *subcaps = gst_caps_merge (*subcaps, templ_caps);
return TRUE; return TRUE;

View file

@ -248,7 +248,8 @@ gst_caps_list_compatible_codecs (const GstCaps * containerformat,
factory = (GstElementFactory *) tmp->data; factory = (GstElementFactory *) tmp->data;
GST_DEBUG ("Trying with factory %s", 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 */ /* Match all muxer sink pad templates against the available codec formats */
templates = gst_element_factory_get_static_pad_templates (factory); templates = gst_element_factory_get_static_pad_templates (factory);

View file

@ -1918,7 +1918,8 @@ filter_features (GstPluginFeature * feature, gpointer data)
if (!GST_IS_ELEMENT_FACTORY (feature)) if (!GST_IS_ELEMENT_FACTORY (feature))
return FALSE; return FALSE;
f = GST_ELEMENT_FACTORY (feature); 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 FALSE;
return TRUE; return TRUE;
@ -1939,7 +1940,8 @@ init_visualization_features (void)
const gchar *name; const gchar *name;
entry.factory = GST_ELEMENT_FACTORY (walk->data); 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); g_array_append_val (vis_entries, entry);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (vis_combo), name); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (vis_combo), name);