Package org.gstreamer

Examples of org.gstreamer.Caps


        // JNA creates ByteBuffer using native byte order, set masks according to that.
        if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN)
          caps.append("red_mask=(int)0xFF00, green_mask=(int)0xFF0000, blue_mask=(int)0xFF000000");
        else
          caps.append("red_mask=(int)0xFF0000, green_mask=(int)0xFF00, blue_mask=(int)0xFF");
        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


    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

        bufferDispatcher = new BufferDispatcher();
        executor = Gst.getScheduledExecutorService();

        Element formatConverter = ElementFactory.make("ffmpegcolorspace", "formatConverter");
        Element formatFilter = ElementFactory.make("capsfilter", "formatFilter");
        Caps capsFormat = Caps.fromString("video/x-raw-yuv,format=(fourcc)I420,width=" + width + ",height=" + height);
        formatFilter.setCaps(capsFormat);

        Element encoder = ElementFactory.make(encoderStr, "encoder");
        if (encoderPropertyNames != null && encoderPropertyData != null)
        {
View Full Code Here

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

            Caps caps = buffer.getCaps();
            int n = buffer.getSize();
           
            if (n < 1) {
                return;
            }
View Full Code Here

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

        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

        // JNA creates ByteBuffer using native byte order, set masks according to that.
        if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN)
          caps.append("red_mask=(int)0xFF00, green_mask=(int)0xFF0000, blue_mask=(int)0xFF000000");
        else
          caps.append("red_mask=(int)0xFF0000, green_mask=(int)0xFF00, blue_mask=(int)0xFF");
        videofilter.setCaps(new Caps(caps.toString()));
        addMany(conv, videofilter, videosink);
        Element.linkMany(conv, videofilter, videosink);
       
        //
        // Link the ghost pads on the bin to the sink pad on the convertor
View Full Code Here

          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

            }
           
            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

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

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.