Examples of Caps

@author Portet to jme3 by user starcom "Paul Kashofer Austria" @see ImageGraphics
  • com.ngt.jopenmetaverse.shared.sim.events.Caps
  • org.gstreamer.Caps
    Structure describing sets of media formats

    Caps (capabilities) are lightweight objects describing media types. They are composed of an array of {@link Structure}.

    Caps are exposed on {@link PadTemplate} to describe all possible types agiven pad can handle. They are also stored in the {@link Registry} along witha description of the {@link Element}.

    Caps are exposed on the element pads using the {@link Pad#getCaps} method. This method describes the possible types that the pad can handle or produce at runtime.

    Caps are also attached to buffers to describe the content of the data pointed to by the buffer with {@link Buffer#setCaps}. Caps attached to a {@link Buffer} allow for format negotiation upstream and downstream.

    A Caps can be constructed with the following code fragment:

    Caps caps = Caps.fromString("video/x-raw-rgb, bpp=32, depth=24, width=640, height=480");

    A Caps is fixed when it has no properties with ranges or lists. Use {@link #isFixed} to test for fixed caps. Only fixed caps can beset on a {@link Pad} or {@link Buffer}.

    Various methods exist to work with the media types such as subtracting or intersecting. @see Structure


  • Examples of org.gstreamer.Caps

              doHandoff(buffer, pad, true);
          }       
           
            private void doHandoff(Buffer buffer, Pad pad, boolean isPrerollFrame) {
             
                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

    Examples of org.gstreamer.Caps

                }
               
                int scaledWidth = currentImage.getWidth();
                if (keepAspect) {
                    // Scale width according to pixel aspect ratio.
                    Caps videoCaps = videoPad.getNegotiatedCaps();
                    Structure capsStruct = videoCaps.getStructure(0);
                    if (capsStruct.hasField("pixel-aspect-ratio")) {
                        Fraction pixelAspectRatio = capsStruct.getFraction("pixel-aspect-ratio");
                        scaledWidth = scaledWidth * pixelAspectRatio.getNumerator() / pixelAspectRatio.getDenominator();
                    }
                }
    View Full Code Here

    Examples of org.gstreamer.Caps

          //
          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

    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

    Examples of org.gstreamer.Caps

              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

    Examples of org.gstreamer.Caps

                    /* 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

    Examples of org.gstreamer.Caps

                    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

    Examples of org.gstreamer.Caps

                    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

    Examples of org.gstreamer.Caps

            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

    Examples of org.gstreamer.Caps

            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
    TOP
    Copyright © 2018 www.massapi.com. 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.