Package org.gstreamer

Examples of org.gstreamer.Element


      sink.connect(new AppSinkNewBufferListener());
     
      //
      // Convert the input into 32bit RGB so it can be fed directly to a BufferedImage
      //
      Element conv = ElementFactory.make("ffmpegcolorspace", "ColorConverter");
      Element videofilter = ElementFactory.make("capsfilter", "ColorFilter");
      StringBuilder caps = new StringBuilder("video/x-raw-rgb, bpp=32, depth=24, endianness=(int)4321, ");
      caps.append(mask);
      videofilter.setCaps(new Caps(caps.toString()));
      addMany(conv, videofilter, sink);
      Element.linkMany(conv, videofilter, sink);

      //
      // Link the ghost pads on the bin to the sink pad on the convertor
View Full Code Here


        sink.connect((BaseSink.PREROLL_HANDOFF) new DataHandoffListener());
       
        //
        // Adding identity element
        //
        Element conv = ElementFactory.make("identity", "Data");       
        addMany(conv, sink);
        Element.linkMany(conv, sink);

        //
        // Link the ghost pads on the bin to the sink pad on the convertor
        //
        addPad(new GhostPad("sink", conv.getStaticPad("sink")))
    }
View Full Code Here

    public ByteDataSink(String name, Pipeline pipeline, Listener listener) {
        super(initializer(gst.ptr_gst_bin_new(name)));
        this.listener = listener;

        Element element = pipeline.getElementByName(name);
        if (element != null) {
           
            // TODO: Fix. This doesn't work as it should. getElementByName() returns a
            // BaseSink which cannot be casted to FakeSink.
            sink = (BaseSink) element;
View Full Code Here

        System.setProperty("apple.awt.graphics.UseQuartz", "false");
       
        args = Gst.init("SwingVideoTest", args);
       
        pipe = new Pipeline("pipeline");
        final Element videosrc = ElementFactory.make("videotestsrc", "source");
        final Element videofilter = ElementFactory.make("capsfilter", "flt");
        videofilter.setCaps(Caps.fromString("video/x-raw-yuv, width=720, height=576"
                + ", bpp=32, depth=32, framerate=25/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                // Create the video component and link it in
                VideoComponent videoComponent = new VideoComponent();
                Element videosink = videoComponent.getElement();
                pipe.addMany(videosrc, videofilter, videosink);
                Element.linkMany(videosrc, videofilter, videosink);
               
                // Now create a JFrame to display the video output
                JFrame frame = new JFrame("Swing Video Test");
View Full Code Here

     * an object created 'the proper way'
     */
    @Test public void testObjectPtrRef() throws Exception {
  // the following probably puts 'e' into the object reference map

      Element e = ElementFactory.make("fakesink", "fakesink");
     
      GValue v = new GValue();
      api.g_value_init(v, GType.OBJECT);
      api.g_value_set_object(v, e);
     
View Full Code Here

        args = Gst.init(name, args);
        if (args.length < 1) {
            System.err.println("Usage: " + name + " <filename>");
            System.exit(1);
        }
        Element src = ElementFactory.make("filesrc", "Input File");
        src.set("location", args[0]);
       
        DecodeBin2 decodeBin = new DecodeBin2("Decode Bin");
        pipe = new Pipeline("main pipeline");
        Element decodeQueue = ElementFactory.make("queue", "Decode Queue");
        pipe.addMany(src, decodeQueue, decodeBin);
        Element.linkMany(src, decodeQueue, decodeBin);

        /* create audio output */
        final Bin audioBin = new Bin("Audio Bin");

        Element conv = ElementFactory.make("audioconvert", "Audio Convert");
        Element resample = ElementFactory.make("audioresample", "Audio Resample");
        Element sink = ElementFactory.make("autoaudiosink", "sink");
        audioBin.addMany(conv, resample, sink);
        Element.linkMany(conv, resample, sink);
        audioBin.addPad(new GhostPad("sink", conv.getStaticPad("sink")));
        pipe.add(audioBin);
       
View Full Code Here

    }
    public static void main(String[] args) {
        args = Gst.init("Dynamic Pad Test", args);
        /* create elements */
        Pipeline pipeline = new Pipeline("my_pipeline");
        Element source = ElementFactory.make("filesrc", "source");
        source.set("location", args[0]);
        Element demux = ElementFactory.make("oggdemux", "demuxer");
       
        /* you would normally check that the elements were created properly */
       
        /* put together a pipeline */
        pipeline.addMany(source, demux);
        Element.linkPads(source, "src", demux, "sink");
       
        /* listen for newly created pads */
        demux.connect(new Element.PAD_ADDED() {
            public void padAdded(Element element, Pad pad) {
               System.out.println("New Pad " + pad.getName() + " was created");
            }
        });
       
View Full Code Here

        args = Gst.init(name, args);
        if (args.length < 1) {
            System.err.println("Usage: " + name + " <filename>");
            System.exit(1);
        }
        Element src = null;
        if (true) try {
            final FileInputStream srcFile = new FileInputStream(args[0]);
//            src = new InputStreamSrc(new BufferedInputStream(srcFile), "input file");
            src = new InputStreamSrc(srcFile, "input file");
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
        /*else if (true) {
            try {
                final RandomAccessFile f = new RandomAccessFile(args[0], "r");
           
    //            src = new InputStreamSrc(new BufferedInputStream(srcFile), "input file");
                src = new ReadableByteChannelSrc(f.getChannel(), "input_file");
            } catch (Exception ex) {
                ex.printStackTrace();
                throw new RuntimeException(ex);
            }
        } else if (true) {
            src = ElementFactory.make("filesrc", "Input File");
            src.set("location", args[0]);
        }*/
        DecodeBin2 decodeBin = (DecodeBin2) ElementFactory.make("decodebin2", "Decode Bin");
        Pipeline pipe = new Pipeline("main pipeline");
        pipe.addMany(src, decodeBin);
        src.link(decodeBin);
       
        /* create audio output */
        final Bin audioBin = new Bin("Audio Bin");
       
        Element conv = ElementFactory.make("audioconvert", "Audio Convert");
        Element sink = ElementFactory.make("autoaudiosink", "sink");
        audioBin.addMany(conv, sink);
        Element.linkMany(conv, sink);       
        audioBin.addPad(new GhostPad("sink", conv.getStaticPad("sink")));
       
        pipe.add(audioBin);
View Full Code Here

       
        //
        // Construct a pipeline: filesrc ! OutputStreamSink
        //
        Pipeline inputPipe = new Pipeline("input pipeline");
        Element filesrc = ElementFactory.make("filesrc", "File source");
        filesrc.set("location", args[0]);
        Element outputstream = new WriteableByteChannelSink(pipeChannel.sink(), "output stream");
        inputPipe.addMany(filesrc, outputstream);
        Element.linkMany(filesrc, outputstream);
        inputPipe.play();
        //
        // Now construct the output pipeline to process the data
        //
       
        Element src = null;
        try {           
            src = new ReadableByteChannelSrc(pipeChannel.source(), "input file");
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
       
        DecodeBin2 decodeBin = (DecodeBin2) ElementFactory.make("decodebin2", "Decode Bin");
        Pipeline pipe = new Pipeline("main pipeline");
        pipe.addMany(src, decodeBin);
        src.link(decodeBin);
       
        /* create audio output */
        final Bin audioBin = new Bin("Audio Bin");
       
        Element conv = ElementFactory.make("audioconvert", "Audio Convert");
        Element sink = ElementFactory.make("autoaudiosink", "sink");
        audioBin.addMany(conv, sink);
        Element.linkMany(conv, sink);       
        audioBin.addPad(new GhostPad("sink", conv.getStaticPad("sink")));
       
        pipe.add(audioBin);
View Full Code Here

                bus.connect(new Bus.ERROR() {
                    public void errorMessage(GstObject source, int code, String message) {
                        System.out.println("Error: code=" + code + " message=" + message);
                    }
                });
                final Element videoSink = ElementFactory.make(overlayFactory, "overlay video sink");
                player.setVideoSink(videoSink);
                //
                // Setting the overlay window ID is supposed to be done from a sync handler
                // but that doesn't work on windows
                //
View Full Code Here

TOP

Related Classes of org.gstreamer.Element

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.