gstelementfactory.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /* GStreamer
  2. * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
  3. * 2000,2004 Wim Taymans <wim@fluendo.com>
  4. *
  5. * gstelement.h: Header for GstElement
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef __GST_ELEMENT_FACTORY_H__
  23. #define __GST_ELEMENT_FACTORY_H__
  24. /**
  25. * GstElementFactory:
  26. *
  27. * The opaque #GstElementFactory data structure.
  28. */
  29. typedef struct _GstElementFactory GstElementFactory;
  30. typedef struct _GstElementFactoryClass GstElementFactoryClass;
  31. #include <gst/gstconfig.h>
  32. #include <gst/gstelement.h>
  33. #include <gst/gstpad.h>
  34. #include <gst/gstplugin.h>
  35. #include <gst/gstpluginfeature.h>
  36. #include <gst/gsturi.h>
  37. G_BEGIN_DECLS
  38. #define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
  39. #define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
  40. GstElementFactory))
  41. #define GST_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT_FACTORY,\
  42. GstElementFactoryClass))
  43. #define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
  44. #define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
  45. #define GST_ELEMENT_FACTORY_CAST(obj) ((GstElementFactory *)(obj))
  46. GType gst_element_factory_get_type (void);
  47. GstElementFactory * gst_element_factory_find (const gchar *name);
  48. GType gst_element_factory_get_element_type (GstElementFactory *factory);
  49. const gchar * gst_element_factory_get_metadata (GstElementFactory *factory, const gchar *key);
  50. gchar ** gst_element_factory_get_metadata_keys (GstElementFactory *factory);
  51. guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
  52. const GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
  53. GstURIType gst_element_factory_get_uri_type (GstElementFactory *factory);
  54. const gchar * const * gst_element_factory_get_uri_protocols (GstElementFactory *factory);
  55. gboolean gst_element_factory_has_interface (GstElementFactory *factory,
  56. const gchar *interfacename);
  57. GstElement* gst_element_factory_create (GstElementFactory *factory,
  58. const gchar *name) G_GNUC_MALLOC;
  59. GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name) G_GNUC_MALLOC;
  60. gboolean gst_element_register (GstPlugin *plugin, const gchar *name,
  61. guint rank, GType type);
  62. /* Factory list functions */
  63. /**
  64. * GstFactoryListType:
  65. * @GST_ELEMENT_FACTORY_TYPE_DECODER: Decoder elements
  66. * @GST_ELEMENT_FACTORY_TYPE_ENCODER: Encoder elements
  67. * @GST_ELEMENT_FACTORY_TYPE_SINK: Sink elements
  68. * @GST_ELEMENT_FACTORY_TYPE_SRC: Source elements
  69. * @GST_ELEMENT_FACTORY_TYPE_MUXER: Muxer elements
  70. * @GST_ELEMENT_FACTORY_TYPE_DEMUXER: Demuxer elements
  71. * @GST_ELEMENT_FACTORY_TYPE_PARSER: Parser elements
  72. * @GST_ELEMENT_FACTORY_TYPE_PAYLOADER: Payloader elements
  73. * @GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER: Depayloader elements
  74. * @GST_ELEMENT_FACTORY_TYPE_DECRYPTOR: Elements handling decryption (Since 1.6)
  75. * @GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR: Elements handling encryption (Since 1.6)
  76. * @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS: Private, do not use
  77. * @GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO: Elements handling video media types
  78. * @GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO: Elements handling audio media types
  79. * @GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE: Elements handling image media types
  80. * @GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE: Elements handling subtitle media types
  81. * @GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA: Elements handling metadata media types
  82. *
  83. * The type of #GstElementFactory to filter.
  84. *
  85. * All @GstFactoryListType up to @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS are exclusive.
  86. *
  87. * If one or more of the MEDIA types are specified, then only elements
  88. * matching the specified media types will be selected.
  89. */
  90. typedef guint64 GstElementFactoryListType;
  91. #define GST_ELEMENT_FACTORY_TYPE_DECODER (G_GUINT64_CONSTANT (1) << 0)
  92. #define GST_ELEMENT_FACTORY_TYPE_ENCODER (G_GUINT64_CONSTANT (1) << 1)
  93. #define GST_ELEMENT_FACTORY_TYPE_SINK (G_GUINT64_CONSTANT (1) << 2)
  94. #define GST_ELEMENT_FACTORY_TYPE_SRC (G_GUINT64_CONSTANT (1) << 3)
  95. #define GST_ELEMENT_FACTORY_TYPE_MUXER (G_GUINT64_CONSTANT (1) << 4)
  96. #define GST_ELEMENT_FACTORY_TYPE_DEMUXER (G_GUINT64_CONSTANT (1) << 5)
  97. #define GST_ELEMENT_FACTORY_TYPE_PARSER (G_GUINT64_CONSTANT (1) << 6)
  98. #define GST_ELEMENT_FACTORY_TYPE_PAYLOADER (G_GUINT64_CONSTANT (1) << 7)
  99. #define GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER (G_GUINT64_CONSTANT (1) << 8)
  100. #define GST_ELEMENT_FACTORY_TYPE_FORMATTER (G_GUINT64_CONSTANT (1) << 9)
  101. #define GST_ELEMENT_FACTORY_TYPE_DECRYPTOR (G_GUINT64_CONSTANT (1) << 10)
  102. #define GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR (G_GUINT64_CONSTANT (1) << 11)
  103. #define GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS (G_GUINT64_CONSTANT (1) << 48)
  104. #define GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO (G_GUINT64_CONSTANT (1) << 49)
  105. #define GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO (G_GUINT64_CONSTANT (1) << 50)
  106. #define GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE (G_GUINT64_CONSTANT (1) << 51)
  107. #define GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE (G_GUINT64_CONSTANT (1) << 52)
  108. #define GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA (G_GUINT64_CONSTANT (1) << 53)
  109. /**
  110. * GST_ELEMENT_FACTORY_TYPE_ANY: (value 562949953421311) (type GstElementFactoryListType)
  111. *
  112. * Elements of any of the defined GST_ELEMENT_FACTORY_LIST types
  113. */
  114. #define GST_ELEMENT_FACTORY_TYPE_ANY ((G_GUINT64_CONSTANT (1) << 49) - 1)
  115. /**
  116. * GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY: (value 18446462598732840960) (type GstElementFactoryListType)
  117. *
  118. * Elements matching any of the defined GST_ELEMENT_FACTORY_TYPE_MEDIA types
  119. *
  120. * Note: Do not use this if you wish to not filter against any of the defined
  121. * media types. If you wish to do this, simply don't specify any
  122. * GST_ELEMENT_FACTORY_TYPE_MEDIA flag.
  123. */
  124. #define GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY (~G_GUINT64_CONSTANT (0) << 48)
  125. /**
  126. * GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER: (value 2814749767106562) (type GstElementFactoryListType)
  127. *
  128. * All encoders handling video or image media types
  129. */
  130. #define GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)
  131. /**
  132. * GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER: (value 1125899906842626) (type GstElementFactoryListType)
  133. *
  134. * All encoders handling audio media types
  135. */
  136. #define GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO)
  137. /**
  138. * GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS: (value 3940649673949188) (type GstElementFactoryListType)
  139. *
  140. * All sinks handling audio, video or image media types
  141. */
  142. #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)
  143. /**
  144. * GST_ELEMENT_FACTORY_TYPE_DECODABLE: (value 353) (type GstElementFactoryListType)
  145. *
  146. * All elements used to 'decode' streams (decoders, demuxers, parsers, depayloaders)
  147. */
  148. #define GST_ELEMENT_FACTORY_TYPE_DECODABLE \
  149. (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)
  150. /* Element klass defines */
  151. #define GST_ELEMENT_FACTORY_KLASS_DECODER "Decoder"
  152. #define GST_ELEMENT_FACTORY_KLASS_ENCODER "Encoder"
  153. #define GST_ELEMENT_FACTORY_KLASS_SINK "Sink"
  154. #define GST_ELEMENT_FACTORY_KLASS_SRC "Source"
  155. #define GST_ELEMENT_FACTORY_KLASS_MUXER "Muxer"
  156. #define GST_ELEMENT_FACTORY_KLASS_DEMUXER "Demuxer"
  157. #define GST_ELEMENT_FACTORY_KLASS_PARSER "Parser"
  158. #define GST_ELEMENT_FACTORY_KLASS_PAYLOADER "Payloader"
  159. #define GST_ELEMENT_FACTORY_KLASS_DEPAYLOADER "Depayloader"
  160. #define GST_ELEMENT_FACTORY_KLASS_FORMATTER "Formatter"
  161. #define GST_ELEMENT_FACTORY_KLASS_DECRYPTOR "Decryptor"
  162. #define GST_ELEMENT_FACTORY_KLASS_ENCRYPTOR "Encryptor"
  163. #define GST_ELEMENT_FACTORY_KLASS_MEDIA_VIDEO "Video"
  164. #define GST_ELEMENT_FACTORY_KLASS_MEDIA_AUDIO "Audio"
  165. #define GST_ELEMENT_FACTORY_KLASS_MEDIA_IMAGE "Image"
  166. #define GST_ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE "Subtitle"
  167. #define GST_ELEMENT_FACTORY_KLASS_MEDIA_METADATA "Metadata"
  168. gboolean gst_element_factory_list_is_type (GstElementFactory *factory,
  169. GstElementFactoryListType type);
  170. GList * gst_element_factory_list_get_elements (GstElementFactoryListType type,
  171. GstRank minrank) G_GNUC_MALLOC;
  172. GList * gst_element_factory_list_filter (GList *list, const GstCaps *caps,
  173. GstPadDirection direction,
  174. gboolean subsetonly) G_GNUC_MALLOC;
  175. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  176. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstElementFactory, gst_object_unref)
  177. #endif
  178. G_END_DECLS
  179. #endif /* __GST_ELEMENT_FACTORY_H__ */