mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 06:29:31 +00:00
Set pipeline to null state in the end and use the real NeedData event of appsrc
This commit is contained in:
parent
103aea2d7d
commit
7613c99e54
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue