Package javax.media

Examples of javax.media.Time


        stream = (PullSourceStream) streams[0];
        readHeader();
        bufferSize = bytesPerSecond;
        tracks[0] = new GsmTrack((AudioFormat) format,
                                /*enabled=*/ true,
                                 new Time(0),
                                 numBuffers,
                                 bufferSize,
                                 minLocation,
                                 maxLocation
                                 );
View Full Code Here


       
        long mStart = mediaStartTime.getNanoseconds();
        long mCurrent =
            (long)((tbCurrent - tbStart)*rate + mStart);

        return new Time(mCurrent);
    }
View Full Code Here

        long contentLength = stream.getContentLength();
        if ( contentLength != SourceStream.LENGTH_UNKNOWN ) {
            double durationSeconds = contentLength / bytesPerSecond;


            duration = new Time(durationSeconds);
            maxLocation = contentLength;

        } else {
            maxLocation = Long.MAX_VALUE;
        }
View Full Code Here

        if(isStarted) {
            long startNano = timeBaseStartTime.getNanoseconds();
            long nowNano = getTimeBase().getNanoseconds();

            if( startNano >= nowNano ) {
                return new Time((nowNano - startNano));
            }
        }

        return getMediaTime();
    }
View Full Code Here

        if (seekLocation != -1)
            location = seekLocation - minLocation;
        else
            location = getLocation(stream) - minLocation;

        return new Time( location / (double) bytesPerSecond );
    }
View Full Code Here

        long mCurrent = t.getNanoseconds();
        long mStart = mediaStartTime.getNanoseconds();
        long tbStart = timeBaseStartTime.getNanoseconds();

        return new Time((long)
            (((mCurrent - mStart)/rate) + tbStart));
    }
View Full Code Here

             ( tracks[0] != null ) ) {
            long mediaSizeAtEOM = ((BasicTrack)
                                 tracks[0]).getMediaSizeAtEOM();
            if (mediaSizeAtEOM > 0) {
                double durationSeconds = mediaSizeAtEOM / bytesPerSecond;
               duration = new Time(durationSeconds);
            }
        }
        return duration;
    }
View Full Code Here

        if( start - now > 0 ) {

            //  Start time is in the future

            //  Set the time-base start time
            this.timeBaseStartTime = new Time(start);

        } else {

            //  Start time is in the past

            //  Set the time-base start time to be now
            this.timeBaseStartTime = new Time(now);
        }

        isStarted = true;
    }
View Full Code Here

       
        int hr = mediaSeeking.GetDuration(duration);
        if (Com.FAILED(hr))
          throw new ComException(hr);
       
        return new Time(duration[0] * 100)// TODO: this assumes REFERENCE_TIME format is being used.
       
      }
      catch (ComException e)
      {
        logger.log(Level.WARNING, "" + e, e);
View Full Code Here

       
        int hr = mediaSeeking.GetCurrentPosition(current);
        if (Com.FAILED(hr))
          throw new ComException(hr);
       
        return new Time(current[0] * 100)// TODO: this assumes REFERENCE_TIME format is being used.
       
      }
      catch (ComException e)
      {
        logger.log(Level.WARNING, "" + e, e);
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.