fguida / ossbuild-vs2010

Automatically exported from code.google.com/p/ossbuild-vs2010
Other
0 stars 0 forks source link

binding playbin2 video sink to wpf panel #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm having trouble attaching the playbin videosink to a wpf panel, it seems to 
either give me a pad error or open a new window to display in.

I think I maybe either missing a handler or using my handler incorrectly?

The code I'm trying is: 
            playBin = ElementFactory.Make("playbin2", "play") as PlayBin2;

            videoSink = Gst.ElementFactory.Make("d3dvideosink", "Output") as Gst.Video.VideoSink;

            videoSink["force-aspect-ratio"] = true;

            playBin.PadAdded += new Gst.PadAddedHandler(OnVideoPadAdded);

            Gst.Interfaces.XOverlayAdapter overlayAdapter = new Gst.Interfaces.XOverlayAdapter(videoSink.Handle);

            overlayAdapter.XwindowId = (ulong)videoPanel.Handle;

            playBin.VideoSink = videoSink;
            playBin.Uri = @"file:///" + uri;
            playBin.Bus.AddWatch(new BusFunc(BusCall));
            playBin.SetState(State.Playing);

public void OnVideoPadAdded(object sender, Gst.PadAddedArgs args)
        {
            Debug.WriteLine("Entered OnPadAdded");
            sinkpad = playBin.GetRequestPad("sink");
            args.Pad.Link(sinkpad);
        }

It's playing back an avi file I have recordeded.

Any help would be really appreciated

Original issue reported on code.google.com by bradsharp0616 on 18 Jun 2013 at 11:18

GoogleCodeExporter commented 9 years ago
Oh and currently the error it kicks out is:

Internal GStreamer error: pad problem.  Please file a bug at 
http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.: Gstreamer error: {0}

Original comment by bradsharp0616 on 18 Jun 2013 at 11:25

GoogleCodeExporter commented 9 years ago
Ignore this, it was a bug where the videosink wasn't being released in code 
used earlier.

Original comment by bradsharp0616 on 20 Jun 2013 at 7:39