Package javax.media

Examples of javax.media.Time



  // @Override
  public Time getPlayerStartLatency()
  {
    return new Time(0);
  }
View Full Code Here


            if (frameNumber > maxFrame)
                frameNumber = maxFrame; // Do we clamp it or return error
            double time = timePerFrame * frameNumber;
            System.out.println("mapFrameToTime: " + frameNumber + " ==> " +
                                   time);
            return new Time(time);
        }
View Full Code Here

                controller.setRate(fastForwardRate);

    // Always must start, since if controller was
                // started, it needed to be stopped to setRate.
     Time now = controller.getTimeBase().getTime();
                controller.syncStart(now);
            }

    /* Reset previous rate and restart controller.
    */
 
View Full Code Here

     */
    public AbstractPlayer() {
        super();

        controllers = new Vector();
        duration = new Time(0);
    }
View Full Code Here

     * Controllers that this Player may be managing.  If any of
     * the Controllers returns DURATION_UNKNOWN or
     * DURATION_UNBOUNDED, then the duration is set to this value.
     */
    private synchronized final void updateDuration() {
        Time duration = getPlayerDuration();

        if( duration != DURATION_UNKNOWN )
        {
            for(int i = 0, n = controllers.size(); i < n; i++) {
                Controller c =
                    (Controller)controllers.elementAt(i);

                Time d = c.getDuration();

                if( d == DURATION_UNKNOWN ) {
                    duration = d;
                    break;
                }

                if( duration != DURATION_UNBOUNDED &&
                    ( d == DURATION_UNBOUNDED ||
                      d.getNanoseconds() >
                      duration.getNanoseconds() ) )
                {
                    duration = d;
                }
            }
View Full Code Here

        {
            throw new NotRealizedError(
                "Cannot get start latency from an Unrealized Controller");
        }

        Time latency = getPlayerStartLatency();

        for(int i = 0, n = controllers.size(); i < n; i++) {
            Controller c = (Controller)controllers.elementAt(i);
            Time l = c.getStartLatency();

            if( l == LATENCY_UNKNOWN ) {
                continue;
            }

            if( latency == LATENCY_UNKNOWN ||
                l.getNanoseconds() > latency.getNanoseconds() )
            {
                latency = l;
            }
        }
View Full Code Here

     * recalculate and begin again.  Otherwise, stop the
     * controller when we wake up.
     */
    private synchronized void monitorStopTime() throws InterruptedException
    {
        Time stopTime;
        long waittime;

        while ( !isClosing() )
        {
            //  Wait until the controller is started and the
View Full Code Here

     */

    @Override
  public synchronized void controllerUpdate(ControllerEvent event) {
  if (event instanceof EndOfMediaEvent) {
      getPlayer().setMediaTime(new Time(0));
  }
  super.controllerUpdate(event);
    }
View Full Code Here

    public Time getDuration()
    {
      if (formatCtx.duration <= 0)
        return Duration.DURATION_UNKNOWN;  // not sure what formatCtx.duration is set to for unknown/unspecified lengths, but this seems like a reasonable check.
      // formatCtx.duration is in AV_TIME_BASE, is in 1/1000000 sec.  Multiply by 1000 to get nanos.
      return new Time(formatCtx.duration * 1000L);
    }
 
View Full Code Here

    public Time getDuration()
    {
      if (formatCtx.duration <= 0)
        return Duration.DURATION_UNKNOWN;  // not sure what formatCtx.duration is set to for unknown/unspecified lengths, but this seems like a reasonable check.
      // formatCtx.duration is in AV_TIME_BASE, which means it is in milliseconds.  Multiply by 1000 to get nanos.
      return new Time(formatCtx.duration * 1000L);
    }
 
View Full Code Here

TOP

Related Classes of javax.media.Time

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.