bin: Use the new group-id field of the stream-start message for stream-start message...
[platform/upstream/gstreamer.git] / gst / gstelementfactory.h
index fc33982..4641457 100644 (file)
  *
  * 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 <gst/gstconfig.h>
 #include <gst/gstelement.h>
-#include <gst/gstobject.h>
+#include <gst/gstpad.h>
 #include <gst/gstplugin.h>
 #include <gst/gstpluginfeature.h>
-#include <gst/gstiterator.h>
+#include <gst/gsturi.h>
 
 G_BEGIN_DECLS
 
-/* FIXME 0.11: Move GstElementDetails into a private header and use it internally
- * in GstElementFactory, GstElementClass and the registry
- */
-
-typedef struct _GstElementDetails GstElementDetails;
-
-/**
- * GstElementDetails:
- * @longname: long, english name
- * @klass: string describing the type of element, as an unordered list
- * separated with slashes ('/'). See draft-klass.txt of the design docs
- * for more details and common types
- * @description: what the element is about
- * @author: who wrote this thing?
- *
- * This struct defines the public information about a #GstElement. It contains
- * meta-data about the element that is mostly for the benefit of editors.
- *
- * The @klass member can be used by applications to filter elements based
- * on functionality.
- */
-/* FIXME: need translatable stuff in here (how handle in registry)?
- * can't we use _N("long name") in element implementations and use _(longname)
- * in gst_element_factory_get_longname()
- */
-struct _GstElementDetails
-{
-  /*< public > */
-  gchar *longname;
-  gchar *klass;
-  gchar *description;
-  gchar *author;
-
-  /*< private >*/
-  gpointer _gst_reserved[GST_PADDING];
-};
-
-/**
- * GST_ELEMENT_DETAILS:
- * @longname: long, english name
- * @klass: string describing the type of element, as an unordered list
- * separated with slashes ('/'). See draft-klass.txt of the design docs
- * for more details and common types
- * @description: what the element is about
- * @author: who wrote this element
- *
- * Macro to initialize #GstElementDetails.
- */
-#define GST_ELEMENT_DETAILS(longname,klass,description,author)          \
-  { longname, klass, description, author, {NULL} }
-
-/**
- * GST_IS_ELEMENT_DETAILS:
- * @details: the #GstElementDetails to check
- *
- * Tests if element details are initialized.
- */
-/* FIXME: what about adding '&& (*__gst_reserved==NULL)' */
-#define GST_IS_ELEMENT_DETAILS(details) (                                       \
-  (details) && ((details)->longname != NULL) && ((details)->klass != NULL)      \
-  && ((details)->description != NULL) && ((details)->author != NULL))
-
 #define GST_TYPE_ELEMENT_FACTORY                (gst_element_factory_get_type())
 #define GST_ELEMENT_FACTORY(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
                                                  GstElementFactory))
@@ -107,67 +50,28 @@ struct _GstElementDetails
 #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 */
-
-  /* FIXME-0.11: deprecate this in favour of meta_data */
-  GstElementDetails     details;
-
-  GList *               staticpadtemplates;     /* GstStaticPadTemplate list */
-  guint                 numpadtemplates;
-
-  /* URI interface stuff */
-  guint                 uri_type;
-  gchar **              uri_protocols;
-
-  GList *               interfaces;             /* interface type names this element implements */
-
-  /*< private >*/
-  /* FIXME-0.11: move up and replace details */
-  gpointer             meta_data;
-  gpointer _gst_reserved[GST_PADDING - 1];
-};
-
-struct _GstElementFactoryClass {
-  GstPluginFeatureClass parent_class;
-
-  gpointer _gst_reserved[GST_PADDING];
-};
-
 GType                   gst_element_factory_get_type            (void);
 
 GstElementFactory *     gst_element_factory_find                (const gchar *name);
 
 GType                   gst_element_factory_get_element_type    (GstElementFactory *factory);
-const gchar *           gst_element_factory_get_longname        (GstElementFactory *factory);
-const gchar *           gst_element_factory_get_klass           (GstElementFactory *factory);
-const gchar *           gst_element_factory_get_description     (GstElementFactory *factory);
-const gchar *           gst_element_factory_get_author          (GstElementFactory *factory);
-const gchar *           gst_element_factory_get_documentation_uri (GstElementFactory *factory);
-const gchar *           gst_element_factory_get_icon_name       (GstElementFactory *factory);
+
+const gchar *           gst_element_factory_get_metadata        (GstElementFactory *factory, const gchar *key);
+gchar **                gst_element_factory_get_metadata_keys   (GstElementFactory *factory);
+
 guint                   gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
 const GList *           gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
-gint                    gst_element_factory_get_uri_type        (GstElementFactory *factory);
-gchar **                gst_element_factory_get_uri_protocols   (GstElementFactory *factory);
+
+GstURIType              gst_element_factory_get_uri_type        (GstElementFactory *factory);
+const gchar * const *   gst_element_factory_get_uri_protocols   (GstElementFactory *factory);
+
 gboolean                gst_element_factory_has_interface       (GstElementFactory *factory,
                                                                  const gchar *interfacename);
 
 GstElement*             gst_element_factory_create              (GstElementFactory *factory,
-                                                                 const gchar *name);
-GstElement*             gst_element_factory_make                (const gchar *factoryname, const gchar *name);
+                                                                 const gchar *name) G_GNUC_MALLOC;
+GstElement*             gst_element_factory_make                (const gchar *factoryname, const gchar *name) G_GNUC_MALLOC;
 
-/* FIXME 0.11: move these two into our private headers */
-void                    __gst_element_factory_add_static_pad_template (GstElementFactory *elementfactory,
-                                                                 GstStaticPadTemplate *templ);
-void                    __gst_element_factory_add_interface     (GstElementFactory *elementfactory,
-                                                                 const gchar *interfacename);
 gboolean                gst_element_register                    (GstPlugin *plugin, const gchar *name,
                                                                  guint rank, GType type);
 
@@ -197,8 +101,6 @@ 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;
@@ -227,7 +129,8 @@ typedef guint64 GstElementFactoryListType;
  *
  * Elements of any of the defined GST_ELEMENT_FACTORY_LIST types
  *
- * Since: 0.10.31
+ * Value: 562949953421311
+ * Type: GstElementFactoryListType
  */
 #define  GST_ELEMENT_FACTORY_TYPE_ANY ((G_GUINT64_CONSTANT (1) << 49) - 1)
 
@@ -237,10 +140,11 @@ typedef guint64 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 
+ * media types. If you wish to do this, simply don't specify any
  * GST_ELEMENT_FACTORY_TYPE_MEDIA flag.
  *
- * Since: 0.10.31
+ * Value: 18446462598732840960
+ * Type: GstElementFactoryListType
  */
 #define GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY (~G_GUINT64_CONSTANT (0) << 48)
 
@@ -249,7 +153,8 @@ typedef guint64 GstElementFactoryListType;
  *
  * All encoders handling video or image media types
  *
- * Since: 0.10.31
+ * Value: 2814749767106562
+ * Type: GstElementFactoryListType
  */
 #define GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)
 
@@ -258,7 +163,8 @@ typedef guint64 GstElementFactoryListType;
  *
  * All encoders handling audio media types
  *
- * Since: 0.10.31
+ * Value: 1125899906842626
+ * Type: GstElementFactoryListType
  */
 #define GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO)
 
@@ -267,7 +173,8 @@ typedef guint64 GstElementFactoryListType;
  *
  * All sinks handling audio, video or image media types
  *
- * Since: 0.10.31
+ * Value: 3940649673949188
+ * Type: GstElementFactoryListType
  */
 #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)
 
@@ -276,39 +183,40 @@ typedef guint64 GstElementFactoryListType;
  *
  * All elements used to 'decode' streams (decoders, demuxers, parsers, depayloaders)
  *
- * Since: 0.10.31
+ * Value: 353
+ * Type: GstElementFactoryListType
  */
 #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)
 
 /* Element klass defines */
-#define GST_ELEMENT_FACTORY_KLASS_DECODER              "Decoder"
-#define GST_ELEMENT_FACTORY_KLASS_ENCODER              "Encoder"
-#define GST_ELEMENT_FACTORY_KLASS_SINK                 "Sink"
-#define GST_ELEMENT_FACTORY_KLASS_SRC                  "Source"
-#define GST_ELEMENT_FACTORY_KLASS_MUXER                        "Muxer"
-#define GST_ELEMENT_FACTORY_KLASS_DEMUXER              "Demuxer"
-#define GST_ELEMENT_FACTORY_KLASS_PARSER               "Parser"
-#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_MEDIA_VIDEO          "Video"
-#define GST_ELEMENT_FACTORY_KLASS_MEDIA_AUDIO          "Audio"
-#define GST_ELEMENT_FACTORY_KLASS_MEDIA_IMAGE          "Image"
-#define GST_ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE       "Subtitle"
-#define GST_ELEMENT_FACTORY_KLASS_MEDIA_METADATA       "Metadata"
+#define GST_ELEMENT_FACTORY_KLASS_DECODER               "Decoder"
+#define GST_ELEMENT_FACTORY_KLASS_ENCODER               "Encoder"
+#define GST_ELEMENT_FACTORY_KLASS_SINK                  "Sink"
+#define GST_ELEMENT_FACTORY_KLASS_SRC                   "Source"
+#define GST_ELEMENT_FACTORY_KLASS_MUXER                 "Muxer"
+#define GST_ELEMENT_FACTORY_KLASS_DEMUXER               "Demuxer"
+#define GST_ELEMENT_FACTORY_KLASS_PARSER                "Parser"
+#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_MEDIA_VIDEO           "Video"
+#define GST_ELEMENT_FACTORY_KLASS_MEDIA_AUDIO           "Audio"
+#define GST_ELEMENT_FACTORY_KLASS_MEDIA_IMAGE           "Image"
+#define GST_ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE        "Subtitle"
+#define GST_ELEMENT_FACTORY_KLASS_MEDIA_METADATA        "Metadata"
 
 gboolean      gst_element_factory_list_is_type      (GstElementFactory *factory,
-                                                    GstElementFactoryListType type);
+                                                     GstElementFactoryListType type);
 
 GList *       gst_element_factory_list_get_elements (GstElementFactoryListType type,
-                                                    GstRank minrank);
+                                                     GstRank minrank) G_GNUC_MALLOC;
 
 
 GList *       gst_element_factory_list_filter       (GList *list, const GstCaps *caps,
-                                                    GstPadDirection direction,
-                                                    gboolean subsetonly);
+                                                     GstPadDirection direction,
+                                                     gboolean subsetonly) G_GNUC_MALLOC;
 G_END_DECLS
 
 #endif /* __GST_ELEMENT_FACTORY_H__ */