elementfactory: Add support for checking only the media type of a factory

And while at it also add Metadata and Subtitle media types.
This commit is contained in:
Sebastian Dröge 2013-05-28 12:41:27 +02:00
parent ab6a1085ee
commit ee21c26cea

View file

@ -730,8 +730,9 @@ gst_element_factory_list_is_type (GstElementFactory * factory,
res = (strstr (klass, "Formatter") != NULL); res = (strstr (klass, "Formatter") != NULL);
/* Filter by media type now, we only test if it /* Filter by media type now, we only test if it
* matched any of the types above. */ * matched any of the types above or only checking the media
if (res * type was requested. */
if ((res || !(type & (GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS - 1)))
&& (type & (GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO | && (type & (GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO |
GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO |
GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE))) GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)))
@ -740,7 +741,11 @@ gst_element_factory_list_is_type (GstElementFactory * factory,
|| ((type & GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO) || ((type & GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO)
&& (strstr (klass, "Video") != NULL)) && (strstr (klass, "Video") != NULL))
|| ((type & GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE) || ((type & GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)
&& (strstr (klass, "Image") != NULL)); && (strstr (klass, "Image") != NULL)) ||
((type & GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE)
&& (strstr (klass, "Subtitle") != NULL)) ||
((type & GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA)
&& (strstr (klass, "Metadata") != NULL));
return res; return res;
} }