Package org.gstreamer

Examples of org.gstreamer.Pipeline$API


        args = Gst.init("unknown", args);
        Version v = Gst.getVersion();
        System.out.println(PREFIX + "Gst.init succeeded. gstreamer version " + v);
        System.out.flush();
        pipe = new Pipeline();
        if (pipe == null) {
            throw new RuntimeException("Failed to create Pipeline");
        }
        System.out.println(PREFIX + "Pipeline created successfully");
        System.out.flush();
View Full Code Here


public class TunerTest {
  public static void main(String[] args) {
    args = Gst.init("ColorBalance video test", args);

    Pipeline pipe = new Pipeline("pipeline");
    final Element videosrc = ElementFactory.make("v4l2src", "source");
    videosrc.set("device", "/dev/video0");
    final Element videosink = ElementFactory.make("xvimagesink", "xv");

    pipe.addMany(videosrc, videosink);
    Element.linkMany(videosrc, videosink);
           
    pipe.play();

    Tuner tun = Tuner.wrap(videosrc);

    List<TunerNorm> normList = tun.getNormList();
    for (TunerNorm n : normList) {
View Full Code Here

    public static void main(String[] args) {

        args = Gst.init("FakeSrcTest", args);
        final int width = 320, height = 200;
        /* setup pipeline */
        pipeline = new Pipeline("pipeline");
        final FakeSrc fakesrc = (FakeSrc) ElementFactory.make("fakesrc", "source");
        //fakesrc = ElementFactory.make("videotestsrc", "source");
        final Element srcfilter = ElementFactory.make("capsfilter", "srcfilter");
      
        Caps fltcaps = new Caps("video/x-raw-rgb, framerate=2/1"
View Full Code Here

        // Initialize the gstreamer framework, and let it interpret any command
        // line flags it is interested in.
        //
        args = Gst.init("AudioPanorama", args);
        PanoramaSink sink = new PanoramaSink("panorama sink");
        Pipeline pipe;
        if (args.length > 0) {
            PlayBin2 playbin = new PlayBin2("AudioPanorama");

            playbin.setInputFile(new File(args[0]));
           
            playbin.setAudioSink(sink);
            pipe = playbin;
        } else {
            pipe = new Pipeline("AudioPanorama");

            Element src = ElementFactory.make("audiotestsrc", "src");
            src.set("wave", 2);
            Element convert = ElementFactory.make("audioconvert", "convert");
            pipe.addMany(src, convert, sink);
            Element.linkMany(src, convert, sink);
        }
        Gst.getScheduledExecutorService().scheduleAtFixedRate(new Panner(sink),
                100, PERIOD / 100, TimeUnit.MILLISECONDS);
        // Start the pipeline playing
        pipe.play();

        Gst.main();

        // Clean up (gstreamer requires elements to be in State.NULL before disposal)
        pipe.stop();
    }
View Full Code Here

        // Initialize the gstreamer framework, and let it interpret any command
        // line flags it is interested in.
        //
        args = Gst.init("SimplePipeline", args);
       
        Pipeline pipe = new Pipeline("SimplePipeline");
        Element src = ElementFactory.make("fakesrc", "Source");
        Element sink = ElementFactory.make("fakesink", "Destination");
       
       
        // Add the elements to the Bin
        pipe.addMany(src, sink);
       
        // Link fakesrc to fakesink so data can flow
        src.link(sink);
       
        // Start the pipeline playing
        pipe.play();
        Gst.main();
        pipe.stop();
    }
View Full Code Here

      shell.setSize(640, 480);
      shell.setLayout(new GridLayout(1, false));

      shell.setText("SWT Video Test");

      Pipeline pipe = new Pipeline("SWT Overlay Test");
      Element src = ElementFactory.make("videotestsrc", "videotest");
      VideoComponent component = new VideoComponent(shell, SWT.NONE, true);
      component.getElement().setName("video");
      component.setKeepAspect(true);
      component.setLayoutData(new GridData(GridData.FILL_BOTH));
      Element sink = component.getElement();

      pipe.addMany(src, sink);
      Element.linkMany(src, sink);
      pipe.play();

      shell.open();
      while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
          display.sleep();
      }
      pipe.stop();
      display.dispose();

    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

        args = Gst.init("SwingVideoTest", args);       
        System.out.println("Creating MainLoop");
       
        /* setup pipeline */
        System.out.println("Creating pipeline");
        pipeline = new Pipeline("pipeline");
        System.out.println("Pipeline created");
        System.out.flush();
       
        System.out.println("Creating videotestsrc");
        final Element fakesrc = ElementFactory.make("videotestsrc", "source");
View Full Code Here

    public TypeFindTest() {
    }
    public static void main(String[] args) {
        args = Gst.init("TypeFind Test", args);
        /* create elements */
        Pipeline pipeline = new Pipeline("my_pipeline");
        Element source = ElementFactory.make("filesrc", "source");
        source.set("location", args[0]);
        TypeFind typefind = new TypeFind("typefinder");
       
        /* you would normally check that the elements were created properly */
       
        /* put together a pipeline */
        pipeline.addMany(source, typefind);
        Element.linkMany(source, typefind);
       
        /* listen for types found */
        typefind.connect(new TypeFind.HAVE_TYPE() {

            public void typeFound(Element elem, int probability, Caps caps) {
                System.out.printf("New type found: probability=%d caps=%s\n",
                        probability, caps.toString());
            }
        });
       
        /* start the pipeline */
        pipeline.play();
       
        Gst.main();
    }
View Full Code Here

/**
* Test consequtive Gst.main/Gst.quit call sequences
*/
public class DoubleQuit {
    private static Pipeline makePipe() {
        Pipeline pipe = new Pipeline("AudioPanorama");

        Element src = ElementFactory.make("audiotestsrc", "src");
        src.set("wave", 2);
        Element convert = ElementFactory.make("audioconvert", "convert");
        Element sink = ElementFactory.make("fakesink", "sink");
        pipe.addMany(src, convert, sink);
        Element.linkMany(src, convert, sink);
        return pipe;
    }
View Full Code Here

        // line flags it is interested in.
        //
        args = Gst.init("DoubleQuit", args);
       
        for (int i = 0; i < 2; ++i) {
            Pipeline pipe = makePipe();
            Gst.getScheduledExecutorService().schedule(new Runnable() {

                public void run() {
                    Gst.quit();
                }
            }, 1, TimeUnit.SECONDS);
            // Start the pipeline playing
            pipe.play();
            System.out.println("Running main loop " + i);
            Gst.main();
            // Clean up (gstreamer requires elements to be in State.NULL before disposal)
            pipe.stop();
        }
    }
View Full Code Here

TOP

Related Classes of org.gstreamer.Pipeline$API

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.