Package javax.microedition.media

Examples of javax.microedition.media.MediaException


   
    public void playTone(int note, int duration, int volume)
         throws MediaException {
       
        if (false == nPlayTone(note, duration, volume)) {
            throw new MediaException("can't play tone");
        }
    }   
View Full Code Here


     * @exception MediaException thrown if setMediaTime fails.
     * @return the new media time in microseconds.
     */
    protected long doSetMediaTime(long now) throws MediaException {
        if (seekType == NOT_SEEKABLE)
            throw new MediaException("stream not seekable");

        if (state == STARTED)
            doStop();

        if (now > duration)
            now = duration;

        mediaTimeOffset = now;

        try {
            int count = framePosControl.mapTimeToFrame(now);
            //System.out.println("SetMediaTime to " + now + " (frame = " + count + "), frameCount=" + frameCount);

            if (count + 1 < frameCount) {
                // rewind to beginning
                frameCount = 0;
                seekFirstFrame();        
            }

            // skip frames
            while (frameCount <= count && getFrame())
                // We need to decode all frames to have the correct pixels
                // for frames with transparent color
                decodeFrame();

            displayTime = getDuration(frameCount) / 1000;
            //System.out.println("SetMediaTime: displayTime = " + displayTime + "; frameCount=" + frameCount);

            renderFrame();

            if (state == STARTED)
                // restart the player
                doStart();
        } catch (IOException e) {
            throw new MediaException(e.getMessage());
        }

        return now;
    }
View Full Code Here

            rateControl = new RateCtrl();

            referenceFrame = null;

        } else
            throw new MediaException("invalid GIF header");

    }
View Full Code Here

            frameCount = 0;
            seekFirstFrame();        

            // get first frame
            if (!getFrame())
                throw new MediaException("can't get first frame");

            decodeFrame();

        } catch (IOException e) {
            throw new MediaException("can't seek first frame");
        }
    }
View Full Code Here

        frameCount = 0;

        try {
            seekFirstFrame();
        } catch (IOException e) {
            throw new MediaException(e.getMessage());
        }
    }
View Full Code Here

        return videoHeight;
    }

    public byte[] getSnapshot(String imageType)
        throws MediaException, SecurityException {
        throw new MediaException("Not supported");
    }
View Full Code Here

     * There is no full screen mode now
     */
    public void setDisplayFullScreen(boolean fullScreenMode) throws MediaException {
        checkState();
        if (fullScreenMode) {
            throw new MediaException("No Fullscreen mode");
        }
    }
View Full Code Here

    /**
     * There is no snap shot support now
     */
    public byte[] getSnapshot(String imageType) throws MediaException {
        checkState();
        throw new MediaException("No snapshot support");
    }
View Full Code Here

        checkPermission();

        if (null == imageType) {
            imageType = System.getProperty("video.snapshot.encodings");
            if (null == imageType) {
                throw new MediaException("Requested format is not supported");
            }
        }

        // Need revisit - Check encoding param validity (Not from Sprint PCS QVM based test case)

        byte[] data = null;
        if (hNative != 0) {
            data = nSnapShot(hNative, imageType.toLowerCase());
        }
        if (null == data) {
            throw new MediaException(imageType + " format is not supported");
        }
        return data;
    }
View Full Code Here

TOP

Related Classes of javax.microedition.media.MediaException

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.