close

以下是我自己的看法, 你可以參照官網

在Gstreamer 的架構當中, 一個管線(pipeline)通常會有一個以上的Bin以及2個以上的元件(Element),

封包流會依照你給的順序從 Element的 srcpad 流向 另一個 Element的 sinkpad.

在這裡 srcpad 就是送, sinkpad 就是收

所以我們從sample code範例當中可以看到建立pipeline以及bin之後

 

#include <gst/gst.h>
int main (int   argc, char *argv[])
{
  GstElement *bin, *pipeline, *source, *sink;

  /* init */
  gst_init (&argc, &argv);

  /* create */
  pipeline = gst_pipeline_new ("my_pipeline"); // 建立 pipeline
  bin = gst_bin_new ("my_bin"); // 建立 bin
  // 新增 fakesrc element
  source = gst_element_factory_make ("fakesrc", "source"); 
  // 新增 fakesink element
  sink = gst_element_factory_make ("fakesink", "sink"); 

  /* First add the elements to the bin */
  // 將Element 加入到bin裡面
  gst_bin_add_many (GST_BIN (bin), source, sink, NULL); 
  /* add the bin to the pipeline */
  gst_bin_add (GST_BIN (pipeline), bin); // 將bin加到 pipeline裡面

  /* link the elements */
  gst_element_link (source, sink); // 將fakesrc與 fakesink串起來

}

透過 gst-inspaect-1.0 fakesrc可以看到它的pad有src

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstFakeSrc

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      ANY

而fakesink則有sinkpad, 所以它才能串起來

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSink
                         +----GstFakeSink

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      ANY

 

 
 
arrow
arrow
    文章標籤
    GStreamer
    全站熱搜
    創作者介紹
    創作者 stephenwei 的頭像
    stephenwei

    stephenwei的部落格

    stephenwei 發表在 痞客邦 留言(0) 人氣()