Exemple #1
0
  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");
  }
 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));
 }