Package org.gstreamer

Examples of org.gstreamer.State


     * Sets the media file to play.
     *
     * @param uri The URI that describes the location of the media file.
     */
    public void setURI(URI uri) {
        State old = playbin.getState();
        playbin.ready();
        playbin.setURI(uri);
        playbin.setState(old);
    }
View Full Code Here


            @Override
            public void stateChanged(ChangeEvent e) {
                int time = progressSlider.getValue();
                synchronized (playbinLock) {
                    if (gstPlaybin2 != null && !autoTracking) {
                        State orig = gstPlaybin2.getState();
                        if (gstPlaybin2.pause() == StateChangeReturn.FAILURE) {
                            logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); //NON-NLS
                            infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                            return;
                        }
View Full Code Here

        );
    }// </editor-fold>

    private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pauseButtonActionPerformed
        synchronized (playbinLock) {
            State state = gstPlaybin2.getState();
            if (state.equals(State.PLAYING)) {
                if (gstPlaybin2.pause() == StateChangeReturn.FAILURE) {
                    logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); //NON-NLS
                    infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                    return;
                }
                pauseButton.setText("►");
                // Is this call necessary considering we just called gstPlaybin2.pause()?
                if (gstPlaybin2.setState(State.PAUSED) == StateChangeReturn.FAILURE) {
                    logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.PAUSED) failed."); //NON-NLS
                    infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                    return;
                }
            } else if (state.equals(State.PAUSED)) {
                if (gstPlaybin2.play() == StateChangeReturn.FAILURE) {
                    logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); //NON-NLS
                    infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                    return;
                }
                pauseButton.setText("||");
                // Is this call necessary considering we just called gstPlaybin2.play()?
                if (gstPlaybin2.setState(State.PLAYING) == StateChangeReturn.FAILURE) {
                    logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.PLAYING) failed."); //NON-NLS
                    infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                    return;
                }
            } else if (state.equals(State.READY)) {
                ExtractMedia em = new ExtractMedia(currentFile, getJFile(currentFile));
                em.execute();
                em.getExtractedBytes();
            }
        }
View Full Code Here

TOP

Related Classes of org.gstreamer.State

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.