Package org.gstreamer

Examples of org.gstreamer.Caps


    class AppSinkNewBufferListener implements AppSink.NEW_BUFFER {
        public void newBuffer(AppSink elem)
        {
            Buffer buffer = sink.pullBuffer();

            Caps caps = buffer.getCaps();
            Structure struct = caps.getStructure(0);

            int width = struct.getInteger("width");
            int height = struct.getInteger("height");
            if (width < 1 || height < 1) {
                return;
View Full Code Here


          doHandoff(buffer, pad, true);
        }       
       
        private void doHandoff(Buffer buffer, Pad pad, boolean isPrerollFrame) {
         
            Caps caps = buffer.getCaps();
            int n = buffer.getSize();
           
            if (n < 1) {
              return;
            }
View Full Code Here

                /* only link once */
                if (pad.isLinked()) {
                    return;
                }
                /* check media type */
                Caps caps = pad.getCaps();
                Structure struct = caps.getStructure(0);
                if (struct.getName().startsWith("audio/")) {
                    System.out.println("Linking audio pad: " + struct.getName());
                    pad.link(audioBin.getStaticPad("sink"));
                } else if (struct.getName().startsWith("video/")) {
                    System.out.println("Linking video pad: " + struct.getName());
View Full Code Here

                if (pad.isLinked()) {
                    return;
                }
 
                /* check media type */
                Caps caps = pad.getCaps();
                Structure struct = caps.getStructure(0);
                if (struct.getName().startsWith("audio/")) {
                    System.out.println("Got audio pad");
                    /* link'n'play */
                    pad.link(audioPad)
                }
View Full Code Here

                if (pad.isLinked()) {
                    return;
                }
 
                /* check media type */
                Caps caps = pad.getCaps();
                Structure struct = caps.getStructure(0);
                if (struct.getName().startsWith("audio/")) {
                    System.out.println("Got audio pad");
                    /* link'n'play */
                    pad.link(audioPad)
                }
View Full Code Here

        final int width = 320, height = 200;
        /* setup pipeline */
        pipeline = new Pipeline("pipeline");
        final AppSrc appsrc = (AppSrc) ElementFactory.make("appsrc", "source");
        final Element srcfilter = ElementFactory.make("capsfilter", "srcfilter");
        Caps fltcaps = new Caps("video/x-raw-rgb, framerate=2/1"
                + ", width=" + width + ", height=" + height
                + ", bpp=16, depth=16");
        srcfilter.setCaps(fltcaps);
        final Element videorate = ElementFactory.make("videorate", "videorate");
        final Element ratefilter = ElementFactory.make("capsfilter", "RateFilter");
View Full Code Here

        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"
                + ", width=" + width + ", height=" + height
                + ", bpp=16, depth=16");
        srcfilter.setCaps(fltcaps);
        final Element videorate = ElementFactory.make("videorate", "videorate");
        final Element ratefilter = ElementFactory.make("capsfilter", "RateFilter");
View Full Code Here

        return ref.get() == null;
    }

    @Test public void testReference() throws Exception {
        Object ref = new Object();
        Caps target = new Caps("video/x-raw-rgb");
        ReferenceManager.addKeepAliveReference(ref, target);
        WeakReference<Object> targetRef = new WeakReference<Object>(target);
        target = null;
        assertFalse("target collected prematurely", waitGC(targetRef));
        ref = null;
View Full Code Here

        assertTrue("target not collected when ref is collected", waitGC(targetRef));
    }
    @Test public void testMultipleReferences() throws Exception {
        Object ref1 = new Object();
        Object ref2 = new Object();
        Caps target = new Caps("video/x-raw-rgb");
        ReferenceManager.addKeepAliveReference(ref1, target);
        ReferenceManager.addKeepAliveReference(ref2, target);
        WeakReference<Object> targetRef = new WeakReference<Object>(target);
        target = null;
        assertFalse("target collected prematurely", waitGC(targetRef));
View Full Code Here

        final Element fakesrc = ElementFactory.make("videotestsrc", "source");
        System.out.println("Creating capsfilter");
        final Element flt = ElementFactory.make("capsfilter", "flt");
       
        System.out.println("Creating caps");
        Caps fltcaps = new Caps("video/x-raw-yuv, width=" + width + ", height=" + height +
                ", bpp=32, depth=24, framerate=30/1");
        System.out.println("Setting caps");
        flt.setCaps(fltcaps);
        final Element navtest = ElementFactory.make("navigationtest", "navtest");
        SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

TOP

Related Classes of org.gstreamer.Caps

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.