Class Gst::ElementFactory

Abstract

Creates Gst::Element instances.

Inherits from: Gst::PluginFeature .

Included in: Gst .

Index: RANK_MARGINAL RANK_NONE RANK_PRIMARY RANK_SECONDARY create details each_pad_template find make pad_templates rank rank_marginal? rank_none? rank_primary? rank_secondary? to_s

Class methods
findfind(aFactoryNameString) -> aGstElementFactory
 

Searches for an element factory of the given name. If found, returns a Gst::ElementFactory object. Otherwise, returns nil.

makemake(aFactoryNameString, anElementNameString=nil) -> aGstElement
 

Creates a new Gst::Element of the type defined by the given element factory.

If element name is ommited (or nil), then the element will receive a guaranteed unique name, consisting of the element factory name and a number. If name is given, it will be given the name supplied.

Example:

  # Creates a 'mad' GStreamer element, named 'foo':
  elem1 = Gst::ElementFactory.make("mad", "foo")
 
  # This line does exactly the same thing:
  elem2 = Gst::ElementFactory.find("mad").create("foo")

Instance methods
createcreate(anElementNameString=nil) -> aGstElement
 

Creates a new element of the type defined by the element factory.

If element name is ommited (or nil), then the element will receive a guaranteed unique name, consisting of the element factory name and a number. If name is given, it will be given the name supplied.

detailsdetails -> aHash
 

Gets some public information about the factory, mostly for the benefit of editors.

This information is encapsulated in a Hash object, with the following (String) keys:

  • longname: long (English) element name.

  • klass: type of element, as hierarchy.

  • license: license under which the element is provided.

  • description: a short description about the element.

  • version: version of the element.

  • author: some information about the author(s).

  • copyright: some copyright details (year, etc..).

Example:

  # Prints all details related to the 'mad' element:
  Gst::ElementFactory.find("mad").details do |k, v| 
      p "#{k}: #{v}"
  end
each_pad_templateeach_pad_template { |aPadTemplateObject| block } -> nil
 

Calls the block for each pad template of the factory, passing a reference to the Gst::PadTemplate as parameter.

pad_templatespad_templates -> anArray
 

Requests all pad templates of factory, in an array of Gst::PadTemplate objects.

rankrank -> aFixnum
 

Gets the rank of the factory:

rank_marginal?rank_marginal? -> aBoolean
 

Checks if the rank of the factory equals RANK_MARGINAL.

rank_none?rank_none? -> aBoolean
 

Checks if the rank of the factory equals RANK_NONE.

rank_primary?rank_primary? -> aBoolean
 

Checks if the rank of the factory equals RANK_PRIMARY.

rank_secondary?rank_secondary? -> aBoolean
 

Checks if the rank of the factory equals RANK_SECONDARY.

to_sto_s -> aString
 

Gets a string representing the factory.

Constants
RANK_MARGINAL

The element is only marginally usefull for autoplugging.

RANK_NONE

The plugin may not be used in autoplugging.

RANK_PRIMARY

The plugin is well suited for autoplugging.

RANK_SECONDARY

The plugin is suited for autoplugging but only as a second candidate.