[ruby-gnome2-doc-cvs] [Hiki] update - tut-gst-elements-create

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2004年 4月 1日 (木) 20:43:16 JST


-------------------------
REMOTE_ADDR = 195.207.101.112
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/en/?tut-gst-elements-create
-------------------------
  = Creating a Gst::Element
+ {{link("tut-gst-elements-intro", nil, "tut-gst", "tut-gst-elements-properties")}}
  
  A Gst::Element object is created from a factory. To create an element, you have to get access to a Gst::ElementFactory object using a unique factory name.
  
  The following code example is used to get a factory that can be used to create the 'mad' element, an mp3 decoder. 
  
    factory = Gst::ElementFactory.find("mad")
  
  Once you have the handle to the element factory, you can create a real element with the following code fragment:
  
    element = factory.create("decoder")
  
  Gst::ElementFactory#create will use the element factory to create an element with the given name. The name of the element is something you can use later on to look up the element in a Gst::Bin, for example. You can pass nil as the name argument to get a unique, default name (which is the default value for this argument).
  
  A simple shortcut exists for creating an element from a factory. The following example creates an element named "decoder" from the element factory named "mad". This convenience method is most widely used to create an element.
  
    element = Gst::ElementFactory.make("mad", "decoder")





ruby-gnome2-cvs メーリングリストの案内
Back to archive index