Package org.gstreamer.elements

Examples of org.gstreamer.elements.DecodeBin2


            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);
       
        decodeBin.connect(new DecodeBin2.NEW_DECODED_PAD() {
            public void newDecodedPad(DecodeBin2 elem, Pad pad, boolean last) {
               
                /* only link once */
                if (pad.isLinked()) {
                    return;
View Full Code Here


            }
        } 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);

        decodeBin.connect(new DecodeBin2.NEW_DECODED_PAD() {
            public void newDecodedPad(DecodeBin2 elem, Pad pad, boolean last) {
                  /* only link once */
                Pad audioPad = audioBin.getStaticPad("sink");
                if (pad.isLinked()) {
                    return;
View Full Code Here

        } 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);

        decodeBin.connect(new DecodeBin2.NEW_DECODED_PAD() {
            public void newDecodedPad(DecodeBin2 elem, Pad pad, boolean last) {
                System.out.println("newDecodedPad");
                  /* only link once */
                Pad audioPad = audioBin.getStaticPad("sink");
                if (pad.isLinked()) {
View Full Code Here

TOP

Related Classes of org.gstreamer.elements.DecodeBin2

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.