Package org.gstreamer

Examples of org.gstreamer.Structure$InvalidFieldException


        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) {
View Full Code Here


   * @return
   */
  public BusSyncReply syncMessage(Message message) {
    if (message.getType() != MessageType.ELEMENT)
      return BusSyncReply.PASS;
    Structure s = message.getStructure();
    if (s == null || !s.hasName("prepare-xwindow-id"))
      return BusSyncReply.PASS;
    setOverlay();
//    videosink.getBus().setSyncHandler(oldSyncHandler);
    return BusSyncReply.DROP;
  }
View Full Code Here

      }       
     
      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;
            }
           
            listener.bufferFrame(width, height, buffer);
View Full Code Here

      }       
       
        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;
            }
            IntBuffer rgb;
            if (passDirectBuffer) {
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();
                }
            }

            // Tell swing to use the new buffer
View Full Code Here

        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);
View Full Code Here

   
    public void listenForNewViews(Bus bus) {
      bus.connect(new Bus.MESSAGE() {
      public void busMessage(Bus bus, Message message) {
        if (message.getSource().getNativeAddress().equals(getNativeAddress())) {
          final Structure structure = message.getStructure();
          if (structure != null && "have-ns-view".equals(structure.getName())) {
            final Pointer nsview = (Pointer) structure.getValue("nsview");
            fireNewVideoComponent(nsview);
          }
        }
      }
    });
View Full Code Here

     *
     * @return a string
     */
    @Override
    public String toString() {
        Structure s = getStructure();
        String event = s.getString("event");
        if (event.startsWith("key-")) {
            return String.format("%s: [key=%s]",
                    event, s.getString("key"));
        } else if (event.startsWith("mouse-")) {
            return String.format("%s: [x=%f, y=%f button=%x]",
                    event,
                    s.getDouble("pointer_x"), s.getDouble("pointer_y"),
                    s.getInteger("button"));
        } else {
            return String.format("%s",
                s.getString("event"));
        }
    }
View Full Code Here

    public static NavigationEvent createKeyReleaseEvent(String key) {
        return createKeyEvent("key-release", key);
    }
    private static final class MouseEvent extends NavigationEvent {
        public MouseEvent(String event, double x, double y, int button) {
            super(new Structure("application/x-gst-navigation",
                "event", GType.STRING, event,
                "button", GType.INT, button,
                "pointer_x", GType.DOUBLE, x,
                "pointer_y", GType.DOUBLE, y));
        }
View Full Code Here

         *
         * @return a string
         */
        @Override
        public String toString() {
            Structure s = getStructure();
            return String.format("%s: [x=%f, y=%f button=%x]",
                    s.getString("event"),
                    s.getDouble("pointer_x"), s.getDouble("pointer_y"),
                    s.getInteger("button"));
        }
View Full Code Here

TOP

Related Classes of org.gstreamer.Structure$InvalidFieldException

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.