All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gstreamer.elements.DecodeBin Maven / Gradle / Ivy

There is a newer version: 1.6
Show newest version
/* 
 * Copyright (c) 2007 Wayne Meissner
 * 
 * This file is part of gstreamer-java.
 *
 * This code is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License version 3 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * version 3 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with this work.  If not, see .
 */

package org.gstreamer.elements;

import org.gstreamer.Bin;
import org.gstreamer.Caps;
import org.gstreamer.Element;
import org.gstreamer.Pad;
import org.gstreamer.lowlevel.GstAPI.GstCallback;

/**
 * Utility {@link Element} to automatically identify media stream types and hook
 * up elements.
 * 
 * @deprecated This element is deprecated and no longer supported. You should use the uridecodebin or decodebin2 element instead (or, even better: playbin2).
 */
@Deprecated
public class DecodeBin extends Bin {
	public static final String GST_NAME = "decodebin";
    /**
     * Creates a new DecodeBin.
     * 
     * @param name The name used to identify this DecodeBin.
     */
    public DecodeBin(String name) {
        this(makeRawElement(GST_NAME, name));
    }
    public DecodeBin(Initializer init) {
        super(init);
    }

    /**
     * Signal emitted when this {@link DecodeBin} decodes a new pad.
     */
    public static interface NEW_DECODED_PAD {
        /**
         * 
         * @param element The element which has the new Pad.
         * @param pad the new Pad.
         * @param last (unknown)
         */
        public void newDecodedPad(DecodeBin element, Pad pad, boolean last);
    }
    /**
     * Adds a listener for the new-decoded-pad signal
     * 
     * @param listener Listener to be called when a new {@link Pad} is encountered
     * on the {@link Element}
     */
    public void connect(final NEW_DECODED_PAD listener) {
        connect(NEW_DECODED_PAD.class, listener, new GstCallback() {
            @SuppressWarnings("unused")
            public void callback(DecodeBin elem, Pad pad, boolean last) {
                listener.newDecodedPad(elem, pad, last);
            }
        });
    }
    /**
     * Removes a listener for the new-decoded-pad signal
     * 
     * @param listener The listener that was previously added.
     */
    public void disconnect(NEW_DECODED_PAD listener) {
        disconnect(NEW_DECODED_PAD.class, listener);
    }
    

    /**
     * Signal emitted when this {@link DecodeBin} decodes a removed pad.
     */
    public static interface REMOVED_DECODED_PAD {
        /**
         * 
         * @param element The element which has the new Pad.
         * @param pad the new Pad.
         */
        public void removedDecodedPad(DecodeBin element, Pad pad);
    }
    /**
     * Adds a listener for the removed-decoded-pad signal
     * 
     * @param listener Listener to be called when a new {@link Pad} is encountered
     * on the {@link Element}
     */
    public void connect(final REMOVED_DECODED_PAD listener) {
        connect(REMOVED_DECODED_PAD.class, listener, new GstCallback() {
            @SuppressWarnings("unused")
            public void callback(DecodeBin elem, Pad pad) {
                listener.removedDecodedPad(elem, pad);
            }
        });
    }
    /**
     * Removes a listener for the removed-decoded-pad signal
     * 
     * @param listener The listener that was previously added.
     */
    public void disconnect(REMOVED_DECODED_PAD listener) {
        disconnect(REMOVED_DECODED_PAD.class, listener);
    }

    /**
     * Signal is emitted when a pad for which there is no further possible decoding is added to the {@link DecodeBin}.
     */
    public static interface UNKNOWN_TYPE {
        /**
         * 
         * @param element The element which has the new Pad.
         * @param pad the new Pad.
         * @param caps the caps of the pad that cannot be resolved.
         */
        public void unknownType(DecodeBin element, Pad pad, Caps caps);
    }
    /**
     * Adds a listener for the unknown-type signal
     * 
     * @param listener Listener to be called when a new {@link Pad} is encountered
     * on the {@link Element}
     */
    public void connect(final UNKNOWN_TYPE listener) {
        connect(UNKNOWN_TYPE.class, listener, new GstCallback() {
            @SuppressWarnings("unused")
            public void callback(DecodeBin elem, Pad pad, Caps caps) {
                listener.unknownType(elem, pad, caps);
            }
        });
    }
    /**
     * Removes a listener for the unknown-type signal
     * 
     * @param listener The listener that was previously added.
     */
    public void disconnect(UNKNOWN_TYPE listener) {
        disconnect(UNKNOWN_TYPE.class, listener);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy