public static void Main (string[] args) { Application.Init(); loop = new MainLoop(); // Construct all the elements pipeline = new Pipeline(); appsrc = new Gst.App.AppSrc ("AppSrcDemo"); Element color = ElementFactory.Make ("ffmpegcolorspace"); Element sink = ElementFactory.Make ("autovideosink"); // Link the elements pipeline.Add (appsrc, color, sink); Element.Link (appsrc, color, sink); // Set the caps on the AppSrc to RGBA, 640x480, 4 fps, square pixels Gst.Video.VideoFormat fmt = (BitConverter.IsLittleEndian) ? Gst.Video.VideoFormat.BGRA : Gst.Video.VideoFormat.ARGB; appsrc.Caps = Gst.Video.VideoUtil.FormatNewCaps (fmt, 640, 480, 4, 1, 1, 1); // Connect the handlers appsrc.NeedData += PushAppData; pipeline.Bus.AddSignalWatch(); pipeline.Bus.Message += MessageHandler; // Run, loop, run! pipeline.SetState (State.Playing); loop.Run(); pipeline.SetState (State.Null); }
public static void Main(string[] args) { Application.Init(); loop = new MainLoop(); // Construct all the elements pipeline = new Pipeline(); appsrc = new Gst.App.AppSrc("AppSrcDemo"); Element color = ElementFactory.Make("ffmpegcolorspace"); Element sink = ElementFactory.Make("autovideosink"); // Link the elements pipeline.Add(appsrc, color, sink); Element.Link(appsrc, color, sink); // Set the caps on the AppSrc to RGBA, 640x480, 4 fps, square pixels Gst.Video.VideoFormat fmt = (BitConverter.IsLittleEndian) ? Gst.Video.VideoFormat.BGRA : Gst.Video.VideoFormat.ARGB; appsrc.Caps = Gst.Video.VideoUtil.FormatNewCaps(fmt, 640, 480, 4, 1, 1, 1); // Connect the handlers 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 EnoughData_cb(IntPtr inst) { try { AppSrc __obj = GLib.Object.GetObject(inst, false) as AppSrc; __obj.OnEnoughData(); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, false); } }
static void NeedData_cb(IntPtr inst, uint length) { try { AppSrc __obj = GLib.Object.GetObject(inst, false) as AppSrc; __obj.OnNeedData(length); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, false); } }
static int PushBufferListEvent_cb(IntPtr inst, IntPtr buffer_list) { try { AppSrc __obj = GLib.Object.GetObject(inst, false) as AppSrc; Gst.FlowReturn __result; __result = __obj.OnPushBufferListEvent(buffer_list == IntPtr.Zero ? null : (Gst.BufferList)GLib.Opaque.GetOpaque(buffer_list, typeof(Gst.BufferList), false)); return((int)__result); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, true); // NOTREACHED: above call does not return. throw e; } }
static int EndOfStreamEvent_cb(IntPtr inst) { try { AppSrc __obj = GLib.Object.GetObject(inst, false) as AppSrc; Gst.FlowReturn __result; __result = __obj.OnEndOfStreamEvent(); return((int)__result); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, true); // NOTREACHED: above call does not return. throw e; } }
static bool SeekData_cb(IntPtr inst, ulong offset) { try { AppSrc __obj = GLib.Object.GetObject(inst, false) as AppSrc; bool __result; __result = __obj.OnSeekData(offset); return(__result); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, true); // NOTREACHED: above call does not return. throw e; } }