X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstelementfactory.h;h=88d417298532bd0fe25170ef3c7004c7b7068cf7;hb=ce43de86902c4e9c8ed4e9682602664cb9bce2ee;hp=b2dff92bb7e89b85c755fe687142bb8e2b4c40d3;hpb=e136cc334fd64f954f2f5bd88b7b6c00c9c90c9c;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstelementfactory.h b/gst/gstelementfactory.h index b2dff92..88d4172 100644 --- a/gst/gstelementfactory.h +++ b/gst/gstelementfactory.h @@ -2,7 +2,7 @@ * Copyright (C) 1999,2000 Erik Walthinsen * 2000,2004 Wim Taymans * - * gstelement.h: Header for GstElement + * gstelementfactory.h: Header for GstElementFactory * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -16,24 +16,27 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GST_ELEMENT_FACTORY_H__ #define __GST_ELEMENT_FACTORY_H__ +/** + * GstElementFactory: + * + * The opaque #GstElementFactory data structure. + */ typedef struct _GstElementFactory GstElementFactory; typedef struct _GstElementFactoryClass GstElementFactoryClass; #include #include -#include +#include #include #include -#include -#include #include G_BEGIN_DECLS @@ -47,58 +50,43 @@ G_BEGIN_DECLS #define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY)) #define GST_ELEMENT_FACTORY_CAST(obj) ((GstElementFactory *)(obj)) -/** - * GstElementFactory: - * - * The opaque #GstElementFactory data structure. - */ -struct _GstElementFactory { - GstPluginFeature parent; - - GType type; /* unique GType of element or 0 if not loaded */ - - gpointer metadata; - - GList * staticpadtemplates; /* GstStaticPadTemplate list */ - guint numpadtemplates; - - /* URI interface stuff */ - GstURIType uri_type; - gchar ** uri_protocols; - - GList * interfaces; /* interface type names this element implements */ - - /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; -}; - -struct _GstElementFactoryClass { - GstPluginFeatureClass parent_class; - - gpointer _gst_reserved[GST_PADDING]; -}; - +GST_API GType gst_element_factory_get_type (void); +GST_API GstElementFactory * gst_element_factory_find (const gchar *name); +GST_API GType gst_element_factory_get_element_type (GstElementFactory *factory); +GST_API const gchar * gst_element_factory_get_metadata (GstElementFactory *factory, const gchar *key); +GST_API +gchar ** gst_element_factory_get_metadata_keys (GstElementFactory *factory); + +GST_API guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory); + +GST_API const GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory); +GST_API GstURIType gst_element_factory_get_uri_type (GstElementFactory *factory); + +GST_API const gchar * const * gst_element_factory_get_uri_protocols (GstElementFactory *factory); +GST_API gboolean gst_element_factory_has_interface (GstElementFactory *factory, const gchar *interfacename); - +GST_API GstElement* gst_element_factory_create (GstElementFactory *factory, const gchar *name) G_GNUC_MALLOC; +GST_API GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name) G_GNUC_MALLOC; +GST_API gboolean gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type); @@ -115,6 +103,8 @@ gboolean gst_element_register (GstPlugin *plug * @GST_ELEMENT_FACTORY_TYPE_PARSER: Parser elements * @GST_ELEMENT_FACTORY_TYPE_PAYLOADER: Payloader elements * @GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER: Depayloader elements + * @GST_ELEMENT_FACTORY_TYPE_DECRYPTOR: Elements handling decryption (Since: 1.6) + * @GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR: Elements handling encryption (Since: 1.6) * @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS: Private, do not use * @GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO: Elements handling video media types * @GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO: Elements handling audio media types @@ -128,89 +118,77 @@ gboolean gst_element_register (GstPlugin *plug * * If one or more of the MEDIA types are specified, then only elements * matching the specified media types will be selected. - * - * Since: 0.10.31 */ typedef guint64 GstElementFactoryListType; -#define GST_ELEMENT_FACTORY_TYPE_DECODER (G_GUINT64_CONSTANT (1) << 0) -#define GST_ELEMENT_FACTORY_TYPE_ENCODER (G_GUINT64_CONSTANT (1) << 1) -#define GST_ELEMENT_FACTORY_TYPE_SINK (G_GUINT64_CONSTANT (1) << 2) -#define GST_ELEMENT_FACTORY_TYPE_SRC (G_GUINT64_CONSTANT (1) << 3) -#define GST_ELEMENT_FACTORY_TYPE_MUXER (G_GUINT64_CONSTANT (1) << 4) -#define GST_ELEMENT_FACTORY_TYPE_DEMUXER (G_GUINT64_CONSTANT (1) << 5) -#define GST_ELEMENT_FACTORY_TYPE_PARSER (G_GUINT64_CONSTANT (1) << 6) -#define GST_ELEMENT_FACTORY_TYPE_PAYLOADER (G_GUINT64_CONSTANT (1) << 7) -#define GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER (G_GUINT64_CONSTANT (1) << 8) -#define GST_ELEMENT_FACTORY_TYPE_FORMATTER (G_GUINT64_CONSTANT (1) << 9) - -#define GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS (G_GUINT64_CONSTANT (1) << 48) - -#define GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO (G_GUINT64_CONSTANT (1) << 49) -#define GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO (G_GUINT64_CONSTANT (1) << 50) -#define GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE (G_GUINT64_CONSTANT (1) << 51) -#define GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE (G_GUINT64_CONSTANT (1) << 52) -#define GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA (G_GUINT64_CONSTANT (1) << 53) +#define GST_ELEMENT_FACTORY_TYPE_DECODER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 0)) +#define GST_ELEMENT_FACTORY_TYPE_ENCODER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 1)) +#define GST_ELEMENT_FACTORY_TYPE_SINK ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 2)) +#define GST_ELEMENT_FACTORY_TYPE_SRC ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 3)) +#define GST_ELEMENT_FACTORY_TYPE_MUXER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 4)) +#define GST_ELEMENT_FACTORY_TYPE_DEMUXER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 5)) +#define GST_ELEMENT_FACTORY_TYPE_PARSER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 6)) +#define GST_ELEMENT_FACTORY_TYPE_PAYLOADER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 7)) +#define GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 8)) +#define GST_ELEMENT_FACTORY_TYPE_FORMATTER ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 9)) +#define GST_ELEMENT_FACTORY_TYPE_DECRYPTOR ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 10)) +#define GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 11)) + +#define GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 48)) + +#define GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 49)) +#define GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 50)) +#define GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 51)) +#define GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 52)) +#define GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 53)) /** - * GST_ELEMENT_FACTORY_TYPE_ANY: + * GST_ELEMENT_FACTORY_TYPE_ANY: (value 562949953421311) (type GstElementFactoryListType) * * Elements of any of the defined GST_ELEMENT_FACTORY_LIST types - * - * Since: 0.10.31 */ -#define GST_ELEMENT_FACTORY_TYPE_ANY ((G_GUINT64_CONSTANT (1) << 49) - 1) +#define GST_ELEMENT_FACTORY_TYPE_ANY ((GstElementFactoryListType)((G_GUINT64_CONSTANT (1) << 49) - 1)) /** - * GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY: + * GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY: (value 18446462598732840960) (type GstElementFactoryListType) * * Elements matching any of the defined GST_ELEMENT_FACTORY_TYPE_MEDIA types * * Note: Do not use this if you wish to not filter against any of the defined * media types. If you wish to do this, simply don't specify any * GST_ELEMENT_FACTORY_TYPE_MEDIA flag. - * - * Since: 0.10.31 */ -#define GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY (~G_GUINT64_CONSTANT (0) << 48) +#define GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY ((GstElementFactoryListType)(~G_GUINT64_CONSTANT (0) << 48)) /** - * GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER: + * GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER: (value 2814749767106562) (type GstElementFactoryListType) * * All encoders handling video or image media types - * - * Since: 0.10.31 */ -#define GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE) +#define GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER ((GstElementFactoryListType)(GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)) /** - * GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER: + * GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER: (value 1125899906842626) (type GstElementFactoryListType) * * All encoders handling audio media types - * - * Since: 0.10.31 */ -#define GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO) +#define GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER ((GstElementFactoryListType)(GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO)) /** - * GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS: + * GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS: (value 3940649673949188) (type GstElementFactoryListType) * * All sinks handling audio, video or image media types - * - * Since: 0.10.31 */ -#define GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS (GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE) +#define GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS ((GstElementFactoryListType)(GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)) /** - * GST_ELEMENT_FACTORY_TYPE_DECODABLE: + * GST_ELEMENT_FACTORY_TYPE_DECODABLE: (value 1377) (type GstElementFactoryListType) * * All elements used to 'decode' streams (decoders, demuxers, parsers, depayloaders) - * - * Since: 0.10.31 */ #define GST_ELEMENT_FACTORY_TYPE_DECODABLE \ - (GST_ELEMENT_FACTORY_TYPE_DECODER | GST_ELEMENT_FACTORY_TYPE_DEMUXER | GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER | GST_ELEMENT_FACTORY_TYPE_PARSER) + ((GstElementFactoryListType)(GST_ELEMENT_FACTORY_TYPE_DECODER | GST_ELEMENT_FACTORY_TYPE_DEMUXER | GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER | GST_ELEMENT_FACTORY_TYPE_PARSER | GST_ELEMENT_FACTORY_TYPE_DECRYPTOR)) /* Element klass defines */ #define GST_ELEMENT_FACTORY_KLASS_DECODER "Decoder" @@ -223,6 +201,8 @@ typedef guint64 GstElementFactoryListType; #define GST_ELEMENT_FACTORY_KLASS_PAYLOADER "Payloader" #define GST_ELEMENT_FACTORY_KLASS_DEPAYLOADER "Depayloader" #define GST_ELEMENT_FACTORY_KLASS_FORMATTER "Formatter" +#define GST_ELEMENT_FACTORY_KLASS_DECRYPTOR "Decryptor" +#define GST_ELEMENT_FACTORY_KLASS_ENCRYPTOR "Encryptor" #define GST_ELEMENT_FACTORY_KLASS_MEDIA_VIDEO "Video" #define GST_ELEMENT_FACTORY_KLASS_MEDIA_AUDIO "Audio" @@ -230,16 +210,34 @@ typedef guint64 GstElementFactoryListType; #define GST_ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE "Subtitle" #define GST_ELEMENT_FACTORY_KLASS_MEDIA_METADATA "Metadata" +/** + * GST_ELEMENT_FACTORY_KLASS_HARDWARE: + * + * Elements interacting with hardware devices should specify this classifier in + * their metadata. You may need to put the element in "READY" state to test if + * the hardware is present in the system. + * + * Since: 1.16 + */ +#define GST_ELEMENT_FACTORY_KLASS_HARDWARE "Hardware" + +GST_API gboolean gst_element_factory_list_is_type (GstElementFactory *factory, GstElementFactoryListType type); +GST_API GList * gst_element_factory_list_get_elements (GstElementFactoryListType type, GstRank minrank) G_GNUC_MALLOC; +GST_API GList * gst_element_factory_list_filter (GList *list, const GstCaps *caps, GstPadDirection direction, gboolean subsetonly) G_GNUC_MALLOC; +#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstElementFactory, gst_object_unref) +#endif + G_END_DECLS #endif /* __GST_ELEMENT_FACTORY_H__ */