Hi,
We've just started trying out gStreamer-Sharp to see if we can create pipelines with a view to writing a media player component for our C# software. Some pipelines can be created, linked and run no problem, but others fail. Anyway I have a repro-case below that fails to link from an avidemux element into an mpeg4 element programmatically, although it works on the command line. Is there something really basic we're doing incorrectly here? We also don't seem to be able to get logging up and running from the software either, although obviously the command-line displays it. Is this possible? Thanks for any help you can give. Robin using System.Windows.Forms; using Gst; using Gst.Interfaces; namespace Test_gStreamer { public partial class MainForm : Form { #region Private Variables // Pipeline. private Gst.Pipeline MyPipeline; // Elements. private Gst.Element MyFileSource, MyDemux, MyMpeg4, MyDrawSink; // Overlay adapter. private XOverlayAdapter MySinkAdapter; #endregion public MainForm() { InitializeComponent(); // Initialise gStreamer. Gst.Application.Init(); // Create new pipeline. MyPipeline = new Gst.Pipeline(); Pipeline pipeline = new Pipeline("pipeline"); // Construct pipeline filescr -> avidemux -> mpeg4 -> directdrawsink MyFileSource = ElementFactory.Make("filesrc", "filesrc"); MyFileSource["location"] = "c:\\test.mp4"; MyDemux = ElementFactory.Make("avidemux", "avidemux"); MyMpeg4 = ElementFactory.Make("ffdec_mpeg4", "ffdec_mpeg4"); MyDrawSink = ElementFactory.Make("directdrawsink", "directdrawsink"); // Output to our window. MySinkAdapter = new XOverlayAdapter(MyDrawSink.Handle); MySinkAdapter.XwindowId = (ulong)this.Handle; // Add and link pipeline. MyPipeline.Add(MyFileSource, MyDemux, MyMpeg4, MyDrawSink); if (!MyFileSource.Link(MyDemux)) { // Failed. } if (!MyDemux.Link(MyMpeg4)) { // FAILS HERE } if (!MyMpeg4.Link(MyDrawSink)) { // Failed. } // Play video. MyPipeline.SetState(Gst.State.Playing); } } } _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |