Package org.gstreamer

Examples of org.gstreamer.Buffer$API


   * Example test method
   */

  @Test
  public void simple() {
    _stem_ impl = new _stem_Impl();
   
    impl.say("Hello World");
  }
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;
            }
            IntBuffer rgb;
            if (passDirectBuffer) {
                rgb = buffer.getByteBuffer().asIntBuffer();
            } else {
                rgb = IntBuffer.allocate(width * height);
                rgb.put(buffer.getByteBuffer().asIntBuffer()).flip();
            }
           
            listener.rgbFrame(width, height, rgb);
           
            //
            // Dispose of the gstreamer buffer immediately to avoid more being
            // allocated before the java GC kicks in
            //
            buffer.dispose();
        }
View Full Code Here

        if (sendingData)
            if (0 < preQueue.size())
            {
                // There are buffers available in the fifo list to be sent to the
                // appsrc queue.
                Buffer buf = preQueue.remove(0);
                frameCount++;

                long f = (long)frameCount * NANOS_PER_FRAME;
                buf.setCaps(videoCaps);
                buf.setTimestamp(ClockTime.fromNanos(f));
                buf.setDuration(ClockTime.fromNanos(NANOS_PER_FRAME));
                source.pushBuffer(buf);
                buf.dispose();
            }
    }
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;
            }
           
            ByteBuffer data;
            if (passDirectBuffer) {
                data = buffer.getByteBuffer();
            } else {
                data = ByteBuffer.allocate(n);
                data.put(buffer.getByteBuffer()).flip();
            }
           
            listener.byteFrame(caps, n, data);

            //
            // Dispose of the gstreamer buffer immediately to avoid more being
            // allocated before the java GC kicks in
            //
            buffer.dispose();
        }
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;
            }
           
            listener.bufferFrame(width, height, buffer);
           
            //
            // Dispose of the gstreamer buffer immediately to avoid more being
            // allocated before the java GC kicks in
            if (autoDisposeBuffer) {
                buffer.dispose();
            }
        }
View Full Code Here

                    byte[] data = new byte[width * height * 2];
                    public void needData(AppSrc elem, int size) {
                        System.out.println("NEED_DATA: Element=" + elem.getNativeAddress()
                                + " size=" + size);
                        Arrays.fill(data, color++);
                        Buffer buffer = new Buffer(data.length);
                        buffer.getByteBuffer().put(data);
                appsrc.pushBuffer(buffer);
                    }
                });
                appsrc.connect(new AppSrc.ENOUGH_DATA() {
          public void enoughData(AppSrc elem) {
View Full Code Here

TOP

Related Classes of org.gstreamer.Buffer$API

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.