Package com.sun.jna.ptr

Examples of com.sun.jna.ptr.PointerByReference


        // TODO: we need to remove the handler when we are done.
       
        urlStr = callbackURL;
      }
     
      final PointerByReference ppFormatCtx = new PointerByReference();
     
      // Open video file
      final int ret = AVFORMAT.av_open_input_file(ppFormatCtx, urlStr, null, 0, null);
      if (ret != 0) {
        throw new ResourceUnavailableException("av_open_input_file failed: " + ret); // Couldn't open file
      }
     
     
      formatCtx = new AVFormatContext(ppFormatCtx.getValue());
      //System.out.println(new String(formatCtx.filename));
     
     
      // Retrieve stream information
      if (AVFORMAT.av_find_stream_info(formatCtx) < 0)
View Full Code Here


       * do the buffering)
       */
      while (vorbis_p != 0 && audiobuf_ready == 0)
      {
        int ret;
        final PointerByReference pcm = new PointerByReference();

        /* if there's pending, decoded audio, grab it */
        if ((ret = VORBIS.vorbis_synthesis_pcmout(vd, pcm)) > 0)
        {

          final Pointer ppChannels = pcm.getValue();
          final Pointer[] pChannels = ppChannels.getPointerArray(0, vi.channels);

          final float[][] floatArrays = new float[pChannels.length][];
          for (int k = 0; k < pChannels.length; ++k)
          {
View Full Code Here

     * @param listener The listener to be called when an error in the stream is encountered.
     */
    public void connect(final ERROR listener) {
        connect(ERROR.class, listener, new BusCallback() {
            public boolean callback(Bus bus, Message msg, Pointer user_data) {
                PointerByReference err = new PointerByReference();
                gst.gst_message_parse_error(msg, err, null);
                GErrorStruct error = new GErrorStruct(err.getValue());
                listener.errorMessage(msg.getSource(), error.getCode(), error.getMessage());
                GLIB_API.g_error_free(err.getValue());
                return true;
            }
        });
    }
View Full Code Here

     * @param listener The listener to be called when an {@link Element} emits a warning.
     */
    public void connect(final WARNING listener) {
        connect(WARNING.class, listener, new BusCallback() {
            public boolean callback(Bus bus, Message msg, Pointer user_data) {
                PointerByReference err = new PointerByReference();
                gst.gst_message_parse_warning(msg, err, null);               
                GErrorStruct error = new GErrorStruct(err.getValue());
                listener.warningMessage(msg.getSource(), error.getCode(), error.getMessage());
                GLIB_API.g_error_free(err.getValue());
                return true;
            }
        });
    }
View Full Code Here

     * @param listener The listener to be called when an {@link Element} emits a an informational message.
     */
    public void connect(final INFO listener) {
        connect(INFO.class, listener, new BusCallback() {
            public boolean callback(Bus bus, Message msg, Pointer user_data) {
                PointerByReference err = new PointerByReference();
                gst.gst_message_parse_info(msg, err, null);               
                GErrorStruct error = new GErrorStruct(err.getValue());
                listener.infoMessage(msg.getSource(), error.getCode(), error.getMessage());
                GLIB_API.g_error_free(err.getValue());
                return true;
            }
        });
    }
View Full Code Here

     * @param listener The listener to be called when new media tags are found.
     */
    public void connect(final TAG listener) {
        connect(TAG.class, listener, new BusCallback() {
            public boolean callback(Bus bus, Message msg, Pointer user_data) {
                PointerByReference list = new PointerByReference();
                gst.gst_message_parse_tag(msg, list);
                TagList tl = new TagList(TagList.initializer(list.getValue()));
                listener.tagsFound(msg.getSource(), tl);
                return true;
            }
        });
    }
View Full Code Here

                arg = new Memory(args[i].length() + 1);
                arg.setString(0, args[i], false);
                argsCopy[i + 1] = arg;
            }
            argvMemory.write(0, argsCopy, 0, argsCopy.length);
            argvRef = new PointerByReference(argvMemory);
            argcRef = new IntByReference(args.length + 1);
        }
View Full Code Here

        T next;       
        IteratorImpl() {
            next = getNext();
        }
        private T getNext() {
            PointerByReference nextRef = new PointerByReference();
            if (gst.gst_iterator_next(handle(), nextRef) == 1) {               
                return NativeObject.objectFor(nextRef.getValue(), objectType, false);               
            }
            return null;
        }
View Full Code Here

     * Gets the list of tags contained in this message.
     *
     * @return the list of tags in this message.
     */
    public TagList getTagList() {
        PointerByReference list = new PointerByReference();
        gst.gst_message_parse_tag(this, list);
        return objectFor(list.getValue(), TagList.class, false, true);
    }
View Full Code Here

     *
     * @param data A string representation of a Structure.
     * @return A new Structure or null when the string could not be parsed.
     */
    public static Structure fromString(String data) {
        return new Structure(gst.ptr_gst_structure_from_string(data, new PointerByReference()));
    }
View Full Code Here

TOP

Related Classes of com.sun.jna.ptr.PointerByReference

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.