コード例 #1
0
ファイル: BinTest.cs プロジェクト: jwzl/ossbuild
  public void TestGetByName() {
    Bin bin = new Bin ("test-bin");
    Element e1 = ElementFactory.Make ("fakesrc", "element-name");
    bin.Add (e1);

    e1 = bin.GetByName ("element-name");

    Assert.IsNotNull (e1);
    Assert.AreEqual (e1.Name, "element-name");
  }
コード例 #2
0
 public GStreamerPlayer()
 {
     Application.Init();
     loop = new MainLoop();
     pipeline = new Pipeline("audio-player");
     try {
         bin = (Bin)Parse.Launch("filesrc name=my_filesrc ! progressreport update-freq=1 ! flump3dec ! alsasink");
     } catch {
         bin = (Bin)Parse.Launch("filesrc name=my_filesrc ! progressreport update-freq=1 ! mad ! autoaudiosink");
     }
     if (bin == null)
         throw new Exception("Parse error.");
     filesrc = bin.GetByName("my_filesrc") as FileSrc;
     bin.Bus.AddWatch(new BusFunc(BusCb));
 }