Package org.gstreamer.elements

Examples of org.gstreamer.elements.PlayBin


   
    final String path = locator.toExternalForm();
   
    // logic copied from GstVideoPlayer
    URI uri = parseURI(path);
        playbin = new PlayBin(uri.toString());
        playbin.setURI(uri);
        videoComponent = new GstVideoComponent();
       
        playbin.getBus().connect(new Bus.EOS() {
            public void eosMessage(GstObject source) {
View Full Code Here


    Gst.deinit();
  }

  @Before
  public void setUp() throws Exception {
    playBin = new PlayBin("playbin", testSrc.toURI());
    Element videoSink = ElementFactory.make("fakesink", "videosink");
    Element audioSink = ElementFactory.make("fakesink", "audiosink");
   
    playBin.setVideoSink(videoSink);
    playBin.setAudioSink(audioSink);
View Full Code Here

* @author duo
*/
public class VideoPlayer {
    public static void main(String[] args) {
        args = Gst.init("VideoPlayer", args);
        final PlayBin playbin = new PlayBin("VideoPlayer");
        try{
        playbin.setURI(new URI("v4l2://"));
        System.out.println("v4l2!");
        } catch(Exception e) {
          playbin.setInputFile(new File(args[0]));
        System.out.println("video ...");
        }

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                VideoComponent videoComponent = new VideoComponent();
                playbin.setVideoSink(videoComponent.getElement());

                JFrame frame = new JFrame("VideoPlayer");
                frame.getContentPane().add(videoComponent, BorderLayout.CENTER);
                frame.setPreferredSize(new Dimension(640, 480));
                frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                frame.pack();
                frame.setVisible(true);
                playbin.setState(State.PLAYING);
            }
        });
        Gst.main();
        playbin.setState(State.NULL);
    }
View Full Code Here

TOP

Related Classes of org.gstreamer.elements.PlayBin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.