Set pipeline to null state in the end and use the real NeedData event of appsrc
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 21 Jun 2009 08:28:05 +0000 (10:28 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 21 Jun 2009 08:28:05 +0000 (10:28 +0200)
samples/AppSrc.cs

index 75f3619de7a3d49fd04cd83a6c25155f771f62bd..7cdead9de56fecdc72751a70ed0f56069d533f51 100644 (file)
@@ -18,7 +18,7 @@ public class AppSrcDemo
 {
        static MainLoop loop;
        static Gst.App.AppSrc appsrc;
-  static Pipeline pipeline;
+       static Pipeline pipeline;
 
        public static void Main (string[] args)
        {
@@ -39,16 +39,17 @@ public class AppSrcDemo
                appsrc.Caps = Gst.Video.VideoUtil.FormatNewCaps(Gst.Video.VideoFormat.BGRA, 640, 480, 4, 1, 1, 1);
 
                // Connect the handlers
-               GLib.Signal.Lookup(appsrc, "need-data").AddDelegate(new EventHandler(PushAppData));
+               appsrc.NeedData += PushAppData;
                pipeline.Bus.AddSignalWatch();
                pipeline.Bus.Message += MessageHandler;
 
                // Run, loop, run!
                pipeline.SetState(State.Playing);
                loop.Run();
+               pipeline.SetState(State.Null);
        }
 
-       static void PushAppData(object o, EventArgs e)
+       static void PushAppData(object o, Gst.App.NeedDataArgs args)
        {
                ulong mseconds = 0;
                if (appsrc.Clock != null)