From: Sebastian Dröge Date: Tue, 28 May 2013 10:41:27 +0000 (+0200) Subject: elementfactory: Add support for checking only the media type of a factory X-Git-Tag: 1.1.1~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee21c26cea0a8b8ec8765199cfde6b126aef7912;p=platform%2Fupstream%2Fgstreamer.git elementfactory: Add support for checking only the media type of a factory And while at it also add Metadata and Subtitle media types. --- diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 66fc72e..bf556ee 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -730,8 +730,9 @@ gst_element_factory_list_is_type (GstElementFactory * factory, res = (strstr (klass, "Formatter") != NULL); /* Filter by media type now, we only test if it - * matched any of the types above. */ - if (res + * matched any of the types above or only checking the media + * type was requested. */ + if ((res || !(type & (GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS - 1))) && (type & (GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | 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) && (strstr (klass, "Video") != NULL)) || ((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; }