• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Rational类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.monte.media.math.Rational的典型用法代码示例。如果您正苦于以下问题:Java Rational类的具体用法?Java Rational怎么用?Java Rational使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Rational类属于org.monte.media.math包,在下文中一共展示了Rational类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: MonteScreenRecorder

import org.monte.media.math.Rational; //导入依赖的package包/类
public MonteScreenRecorder() {
	GraphicsConfiguration gc = GraphicsEnvironment
			.getLocalGraphicsEnvironment().getDefaultScreenDevice()
			.getDefaultConfiguration();
	this.files = new TreeSet<File>();
	try {
		this.screenRecorder = new ScreenRecorder(gc, new Format(
				MediaTypeKey, MediaType.FILE, MimeTypeKey, FormatKeys.MIME_QUICKTIME),
				new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey,
						VideoFormatKeys.ENCODING_QUICKTIME_ANIMATION,
						CompressorNameKey,
						ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, DepthKey,
						24, FrameRateKey, Rational.valueOf(15), QualityKey,
						1.0f, KeyFrameIntervalKey, 15 * 60), new Format(
						MediaTypeKey, MediaType.VIDEO, EncodingKey,
						"black", FrameRateKey, Rational.valueOf(30)), null);
	} catch (Exception e) {
		throw new RuntimeException(e);
	}

}
 
开发者ID:bharathkumar-gopalan,项目名称:grid-video-recorder,代码行数:22,代码来源:MonteScreenRecorder.java


示例2: updateImage

import org.monte.media.math.Rational; //导入依赖的package包/类
private void updateImage() {
    final Movie movie = getMovie();
    if (movie == null) {
        return;
    }

    execute(new Worker<BufferedImage>() {

        @Override
        protected BufferedImage construct() throws Exception {
            Rational time=movie.getInsertionPoint(); 
            
            
            return null;
        }

        @Override
        protected void done(BufferedImage value) {
            imagePanel.setImage(value);
        }
        
    });
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:24,代码来源:MovieConverterPanel.java


示例3: ScreenRecorder

import org.monte.media.math.Rational; //导入依赖的package包/类
/**
 * Creates a screen recorder.
 *
 * @param cfg Graphics configuration of the capture screen.
 */
public ScreenRecorder(GraphicsConfiguration cfg) throws IOException, AWTException {
    this(cfg, null,
            // the file format
            new Format(MediaTypeKey, MediaType.FILE,
            MimeTypeKey, MIME_QUICKTIME),
            //
            // the output format for screen capture
            new Format(MediaTypeKey, MediaType.VIDEO,
            EncodingKey, ENCODING_QUICKTIME_ANIMATION,
            CompressorNameKey, COMPRESSOR_NAME_QUICKTIME_ANIMATION,
            DepthKey, 24, FrameRateKey, new Rational(15, 1)),
            //
            // the output format for mouse capture 
            new Format(MediaTypeKey, MediaType.VIDEO,
            EncodingKey, ENCODING_BLACK_CURSOR,
            FrameRateKey, new Rational(30, 1)),
            //
            // the output format for audio capture 
            new Format(MediaTypeKey, MediaType.AUDIO,
            EncodingKey, ENCODING_QUICKTIME_TWOS_PCM,
            FrameRateKey, new Rational(48000, 1),
            SampleSizeInBitsKey, 16,
            ChannelsKey, 2, SampleRateKey, new Rational(48000, 1),
            SignedKey, true, ByteOrderKey, ByteOrder.BIG_ENDIAN));
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:31,代码来源:ScreenRecorder.java


示例4: getDuration

import org.monte.media.math.Rational; //导入依赖的package包/类
@Override
public Rational getDuration() {
    try {
        ensureRealized();
    } catch (IOException ex) {
        ex.printStackTrace();
        return new Rational(0, 1);
    }
    if (movieDuration == null) {
        Rational maxDuration = new Rational(0, 1);
        for (Track tr : tracks) {
            Rational trackDuration = new Rational((tr.length * tr.scale + tr.startTime), tr.rate);
            if (maxDuration.compareTo(trackDuration) < 0) {
                maxDuration = trackDuration;
            }
        }
        movieDuration = maxDuration;
    }
    return movieDuration;
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:21,代码来源:AVIReader.java


示例5: timeToSample

import org.monte.media.math.Rational; //导入依赖的package包/类
@Override
public long timeToSample(int track, Rational time) {
    Track tr = tracks.get(track);
    // This only works, if all samples contain only one sample!
    // FIXME - We foolishly assume that only audio tracks have more than one
    // sample in a frame.
    // FIXME - We foolishly assume that all samples have a sampleDuration != 0.
    long index = time.getNumerator() * tr.rate / time.getDenominator() / tr.scale - tr.startTime;
    if (tr.mediaType == AVIMediaType.AUDIO) {
        int count = 0;
        // FIXME This is very inefficient, perform binary search with sample.timestamp
        // this will work for all media types!
        for (int i = 0, n = tr.samples.size(); i < n; i++) {
            long d = tr.samples.get(i).duration * tr.scale; // foolishly assume that sampleDuration = sample count
            if (count + d > index) {
                index = i;
                break;
            }
            count += d;

        }
    }

    return max(0, min(index, tr.samples.size()));
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:26,代码来源:AVIReader.java


示例6: videoToString

import org.monte.media.math.Rational; //导入依赖的package包/类
private static String videoToString(Format f) {
    StringBuilder buf = new StringBuilder();
    buf.append(f.get(EncodingKey))//
            .append(", ")//
            .append(f.get(WidthKey))//
            .append("x")//
            .append(f.get(HeightKey))//
            .append(", ")//
            .append(f.get(DepthKey))//
            .append("-bit, ")//
            .append(f.get(FrameRateKey,new Rational(0,0)))//
            .append(" fps")//
            .append(f.get(FixedFrameRateKey,false) ? ", fixed rate" : "")//
            .append(f.get(PixelAspectRatioKey,new Rational(1,1)).equals(new Rational(1, 1)) ? "" : ", " + f.get(PixelAspectRatioKey) + " pixel ratio")//
            .append("")//
            ;
    return buf.toString();
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:19,代码来源:FormatFormatter.java


示例7: mouseDragged

import org.monte.media.math.Rational; //导入依赖的package包/类
@Override
public void mouseDragged(MouseEvent e) {
    if (movie == null) {
        return;
    }
    if (pressedHandle != null) {
        Rational time = posToTime(e.getX());
        switch (pressedHandle) {
            case SelectionStart:
                time = Rational.min(time, movie.getSelectionEnd());
                movie.setSelectionStart(time);
                movie.setInsertionPoint(time);
                break;
            case SelectionEnd:
                time = Rational.max(movie.getSelectionStart(), time);
                movie.setSelectionEnd(time);
                movie.setInsertionPoint(time);
                break;
            case InsertionPoint:
                movie.setInsertionPoint(time);
                break;
        }

    }
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:26,代码来源:JTimelineEditor.java


示例8: updateTimeLabel

import org.monte.media.math.Rational; //导入依赖的package包/类
protected void updateTimeLabel() {
    Movie movie = getMovie();
    Rational time = movie == null ? new Rational(0,1) : movie.getInsertionPoint();
    int hours = (int) time.floor(1).getNumerator()/3600;
    int minutes = (int) (time.floor(1).getNumerator() / 60) % 60;
    int seconds = (int) (time.floor(1).getNumerator() % 60);
    int frame = movie == null ? 0 : (int) (movie.timeToSample(0, time) - movie.timeToSample(0, time.floor(1)));
    switch (labelMode) {
        case TIME:
            timeLabel.setText((hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes)
                    + ":" + (seconds < 10 ? "0" + seconds : seconds)
                    + "." + (frame < 10 ? "0" + frame : frame));

            break;
        case FRAME:
            timeLabel.setText(Long.toString(movie.timeToSample(0, movie.getInsertionPoint()) ));
            break;
    }
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:20,代码来源:JMovieControlPanel.java


示例9: reduceListRational

import org.monte.media.math.Rational; //导入依赖的package包/类
private static void reduceListRational(Rational value, InfGetter<Rational> g, ArrayList<AmigaDisplayInfo> infs) {
    ArrayList<AmigaDisplayInfo> bestInfs = new ArrayList<AmigaDisplayInfo>();
    bestInfs.add(infs.get(0));
    float bestCost = g.get(infs.get(0)).subtract(value).floatValue();
    bestCost *= bestCost;
    for (Iterator<AmigaDisplayInfo> i = infs.iterator(); i.hasNext();) {
        AmigaDisplayInfo inf = i.next();
        Rational iv = g.get(inf);
        if (iv.compareTo(value) != 0) {
            i.remove();
        }
        float icost = iv.subtract(value).floatValue();
        icost *= icost;
        if (icost < bestCost) {
            bestInfs.clear();
            bestCost = icost;
        } else if (icost == bestCost) {
            bestInfs.add(inf);
        }
    }
    if (infs.isEmpty()) {
        infs.addAll(bestInfs);
    }
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:25,代码来源:AmigaVideoFormatKeys.java


示例10: SpecializedScreenRecorder

import org.monte.media.math.Rational; //导入依赖的package包/类
public SpecializedScreenRecorder(GraphicsConfiguration cfg, String name,
		Configuration config) throws IOException, AWTException {
	super(cfg, new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey,
			config.getValue("video.format", MIME_QUICKTIME)), new Format(
			MediaTypeKey, MediaType.VIDEO, EncodingKey,
			config.getValue("video.encoding",
					ENCODING_QUICKTIME_CINEPAK),
			CompressorNameKey, config.getValue("video.compression",
					COMPRESSOR_NAME_QUICKTIME_CINEPAK), DepthKey,
			(int) 24, FrameRateKey, Rational.valueOf(Integer
					.parseInt(config.getValue("video.format.frameRate",
							"15"))), QualityKey, 1.0f, KeyFrameIntervalKey,
			(int) (15 * 60)), new Format(MediaTypeKey, MediaType.VIDEO,
			EncodingKey, "black", FrameRateKey, Rational.valueOf(30)), null);
	this.name = name;
	this.config = config;
	this.setMaxFileSize(Long.parseLong(config.getValue("maxFileSize",MAX_SIZE_DEFAULT_KB)));
	this.setMaxRecordingTime(Long.parseLong(config.getValue("maxRecordingTime",MAX_DURATION_DEFAULT_MS)));
}
 
开发者ID:sugarcrm,项目名称:candybean,代码行数:20,代码来源:SpecializedScreenRecorder.java


示例11: writeMovie

import org.monte.media.math.Rational; //导入依赖的package包/类
private static void writeMovie(File file, BufferedImage[] frames) throws IOException {
    MovieWriter out = Registry.getInstance().getWriter(file);

    Format format = new Format(MediaTypeKey, MediaType.VIDEO, //
            EncodingKey, ENCODING_AVI_MJPG,
            FrameRateKey, new Rational(30, 1),//
            WidthKey, frames[0].getWidth(), //
            HeightKey, frames[0].getHeight(),//
            DepthKey, 24
            );

    int track = out.addTrack(format);

    try {
        Buffer buf = new Buffer();
        buf.format = new Format(DataClassKey, BufferedImage.class);
        buf.sampleDuration = format.get(FrameRateKey).inverse();
        for (int i = 0; i < frames.length; i++) {
            buf.data = frames[i];
            out.write(track, buf);
        }
    } finally {
        out.close();
    }
}
 
开发者ID:sebkur,项目名称:montemedia,代码行数:26,代码来源:ReadWriteDemoMain.java


示例12: initScreen

import org.monte.media.math.Rational; //导入依赖的package包/类
/**
 * initializes a graphic configurations
 */
public static void initScreen() {
	// get the graphics configuration of the current screen
	GraphicsConfiguration gc = GraphicsEnvironment
			.getLocalGraphicsEnvironment()
			.getDefaultScreenDevice()
			.getDefaultConfiguration();

	// set screen recorder configuration
	try {
		screenLogger = new ScreenRecorder(gc, null,
				new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_AVI),
				new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
						CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
						DepthKey, 24, FrameRateKey, Rational.valueOf(15),
						QualityKey, 1.0f,
						KeyFrameIntervalKey, 15 * 60),
				new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black",
						FrameRateKey, Rational.valueOf(30)),
				null, new File(pathToFile));
	} catch (IOException ioe) {
		ioe.printStackTrace();
	} catch (AWTException awte) {
		awte.printStackTrace();
	}
}
 
开发者ID:atinfo,项目名称:at.info-knowledge-base,代码行数:29,代码来源:CaptureVideo.java


示例13: getScreenRecorder

import org.monte.media.math.Rational; //导入依赖的package包/类
private MonteScreenRecorder getScreenRecorder() {
    int frameRate = videoConfiguration.frameRate();

    Format fileFormat = new Format(MediaTypeKey, MediaType.VIDEO, MimeTypeKey, FormatKeys.MIME_AVI);
    Format screenFormat = new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey,
            ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
            CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
            DepthKey, 24, FrameRateKey, Rational.valueOf(frameRate),
            QualityKey, 1.0f,
            KeyFrameIntervalKey, 15 * 60);
    Format mouseFormat = new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black",
            FrameRateKey, Rational.valueOf(frameRate));

    Dimension screenSize = videoConfiguration.screenSize();
    int width = screenSize.width;
    int height = screenSize.height;

    Rectangle captureSize = new Rectangle(0, 0, width, height);

    return MonteScreenRecorderBuilder
            .builder()
            .setGraphicConfig(getGraphicConfig())
            .setRectangle(captureSize)
            .setFileFormat(fileFormat)
            .setScreenFormat(screenFormat)
            .setFolder(new File(videoConfiguration.folder()))
            .setMouseFormat(mouseFormat).build();
}
 
开发者ID:SergeyPirogov,项目名称:video-recorder-java,代码行数:29,代码来源:MonteRecorder.java


示例14: ScreenGrabber

import org.monte.media.math.Rational; //导入依赖的package包/类
public ScreenGrabber(ScreenRecorder recorder, long startTime) throws AWTException, IOException {
    this.recorder = recorder;
    this.captureArea = recorder.captureArea;
    this.robot = new Robot(recorder.captureDevice);
    this.mouseFormat = recorder.mouseFormat;
    this.mouseCaptures = recorder.mouseCaptures;
    this.sync = recorder.sync;
    this.cursorImg = recorder.cursorImg;
    this.cursorImgPressed = recorder.cursorImgPressed;
    this.cursorOffset = recorder.cursorOffset;
    this.videoTrack = recorder.videoTrack;
    this.prevScreenCaptureTime = new Rational(startTime, 1000);
    this.startTime = startTime;

    Format screenFormat = recorder.screenFormat;
    if (screenFormat.get(DepthKey, 24) == 24) {
        videoImg = new BufferedImage(this.captureArea.width, this.captureArea.height, BufferedImage.TYPE_INT_RGB);
    } else if (screenFormat.get(DepthKey) == 16) {
        videoImg = new BufferedImage(this.captureArea.width, this.captureArea.height, BufferedImage.TYPE_USHORT_555_RGB);
    } else if (screenFormat.get(DepthKey) == 8) {
        videoImg = new BufferedImage(this.captureArea.width, this.captureArea.height, BufferedImage.TYPE_BYTE_INDEXED, Colors.createMacColors());
    } else {
        throw new IOException("Unsupported color depth " + screenFormat.get(DepthKey));
    }
    videoGraphics = videoImg.createGraphics();
    videoGraphics.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
    videoGraphics.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED);
    videoGraphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:30,代码来源:ScreenRecorder.java


示例15: grabMouse

import org.monte.media.math.Rational; //导入依赖的package包/类
/**
 * Captures the mouse cursor.
 */
private void grabMouse() throws InterruptedException {
    long now = System.currentTimeMillis();
    if (now > getStopTime()) {
        future.cancel(false);
        return;
    }
    PointerInfo info = MouseInfo.getPointerInfo();
    Point p = info.getLocation();
    if (!info.getDevice().equals(captureDevice)
            || !captureArea.contains(p)) {
        // If the cursor is outside the capture region, we
        // assign Integer.MAX_VALUE to its location.
        // This ensures that all mouse movements outside of the
        // capture region get coallesced. 
        p.setLocation(Integer.MAX_VALUE, Integer.MAX_VALUE);
    }

    // Only create a new capture event if the location has changed
    if (!p.equals(prevCapturedMouseLocation) || mouseWasPressed != mousePressedRecorded) {
        Buffer buf = new Buffer();
        buf.format = format;
        buf.timeStamp = new Rational(now, 1000);
        buf.data = p;
        buf.header = mouseWasPressed;
        mousePressedRecorded = mouseWasPressed;
        mouseCaptures.put(buf);
        prevCapturedMouseLocation.setLocation(p);
    }
    if (!mousePressed) {
        mouseWasPressed = false;
    }
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:36,代码来源:ScreenRecorder.java


示例16: getDuration

import org.monte.media.math.Rational; //导入依赖的package包/类
/**
 * Returns the media duration of the track in seconds.
 */
@Override
public Rational getDuration(int track) {
    Track tr = tracks.get(track);
    long duration = getMediaDuration(track);
    return new Rational(duration * tr.scale, tr.rate);
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:10,代码来源:AVIWriter.java


示例17: addAudioTrack

import org.monte.media.math.Rational; //导入依赖的package包/类
/**
 * Adds an audio track.
 *
 * @param format The format of the track.
 * @return The track number.
 */
private int addAudioTrack(Format format) throws IOException {
    int waveFormatTag = 0x0001; // WAVE_FORMAT_PCM


    long timeScale = 1;
    long sampleRate = format.get(SampleRateKey, new Rational(41000, 0)).longValue();
    int numberOfChannels = format.get(ChannelsKey, 1);
    int sampleSizeInBits = format.get(SampleSizeInBitsKey, 16); //
    boolean isCompressed = false; // FIXME
    int frameDuration = 1;
    int frameSize = format.get(FrameSizeKey, (sampleSizeInBits + 7) / 8 * numberOfChannels);


    String enc = format.get(EncodingKey);
    if (enc == null) {
        waveFormatTag = 0x0001; // WAVE_FORMAT_PCM
    } else if (enc.equals(ENCODING_ALAW)) {
        waveFormatTag = 0x0001; // WAVE_FORMAT_PCM
    } else if (enc.equals(ENCODING_PCM_SIGNED)) {
        waveFormatTag = 0x0001; // WAVE_FORMAT_PCM
    } else if (enc.equals(ENCODING_PCM_UNSIGNED)) {
        waveFormatTag = 0x0001; // WAVE_FORMAT_PCM
    } else if (enc.equals(ENCODING_ULAW)) {
        waveFormatTag = 0x0001; // WAVE_FORMAT_PCM
    } else if (enc.equals(ENCODING_MP3)) {
        waveFormatTag = 0x0001; // WAVE_FORMAT_PCM - FIXME
    } else {
        waveFormatTag = RIFFParser.stringToID(format.get(EncodingKey)) & 0xffff;
    }

    return addAudioTrack(waveFormatTag, //
            timeScale, sampleRate, //
            numberOfChannels, sampleSizeInBits, //
            isCompressed, //
            frameDuration, frameSize);
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:43,代码来源:AVIWriter.java


示例18: readVideoSTRF

import org.monte.media.math.Rational; //导入依赖的package包/类
/**
 * </pre> //---------------------- // AVI Bitmap Info Header //
 * ---------------------- typedef struct { BYTE blue; BYTE green; BYTE red;
 * BYTE reserved; } RGBQUAD;
 *
 * // Values for this enum taken from: //
 * http://www.fourcc.org/index.php?http%3A//www.fourcc.org/rgb.php enum {
 * BI_RGB = 0x00000000, RGB = 0x32424752, // Alias for BI_RGB BI_RLE8 =
 * 0x01000000, RLE8 = 0x38454C52, // Alias for BI_RLE8 BI_RLE4 = 0x00000002,
 * RLE4 = 0x34454C52, // Alias for BI_RLE4 BI_BITFIELDS = 0x00000003, raw =
 * 0x32776173, RGBA = 0x41424752, RGBT = 0x54424752, cvid = "cvid" }
 * bitmapCompression;
 *
 * typedef struct { DWORD structSize; DWORD width; DWORD height; WORD
 * planes; WORD bitCount; FOURCC enum bitmapCompression compression; DWORD
 * imageSizeInBytes; DWORD xPelsPerMeter; DWORD yPelsPerMeter; DWORD
 * numberOfColorsUsed; DWORD numberOfColorsImportant; RGBQUAD colors[]; }
 * BITMAPINFOHEADER;
 * </pre>
 *
 *
 * @param tr
 * @param data
 * @throws java.io.IOException
 */
private void readVideoSTRF(VideoTrack tr, byte[] data) throws IOException {
    ByteArrayImageInputStream in = new ByteArrayImageInputStream(data, ByteOrder.LITTLE_ENDIAN);


    long structSize = in.readUnsignedInt();
    tr.width = in.readInt();
    tr.height = in.readInt();
    tr.planes = in.readUnsignedShort();
    tr.bitCount = in.readUnsignedShort();
    in.setByteOrder(ByteOrder.BIG_ENDIAN);
    tr.compression = intToType(in.readInt());
    in.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    long imageSizeInBytes = in.readUnsignedInt();
    tr.xPelsPerMeter = in.readUnsignedInt();
    tr.yPelsPerMeter = in.readUnsignedInt();
    tr.clrUsed = in.readUnsignedInt();
    tr.clrImportant = in.readUnsignedInt();
    if (tr.bitCount == 0) {
        tr.bitCount = (int) (imageSizeInBytes / tr.width / tr.height * 8);
    }

    tr.format = new Format(MimeTypeKey, MIME_AVI,
            MediaTypeKey, MediaType.VIDEO,
            EncodingKey, tr.compression,
            DataClassKey, byte[].class,
            WidthKey, tr.width,
            HeightKey, tr.height,
            DepthKey, tr.bitCount,
            PixelAspectRatioKey, new Rational(1, 1),
            FrameRateKey, new Rational(tr.rate, tr.scale),
            FixedFrameRateKey, true);
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:58,代码来源:AVIInputStream.java


示例19: getReadTime

import org.monte.media.math.Rational; //导入依赖的package包/类
@Override
public Rational getReadTime(int track) throws IOException {
    Track tr = tracks.get(track);
    if (tr.samples.size() > tr.readIndex) {
        Sample s = tr.samples.get((int) tr.readIndex);
        return new Rational((s.timeStamp + tr.startTime) * tr.scale, tr.rate);
    }
    return new Rational(0, 1);
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:10,代码来源:AVIReader.java


示例20: sampleToTime

import org.monte.media.math.Rational; //导入依赖的package包/类
@Override
public Rational sampleToTime(int track, long sampleIndex) throws IOException {
    ensureRealized();
    Track tr = tracks.get(track);
    Sample sample = tr.samples.get((int) max(0, min(tr.samples.size() - 1, sampleIndex)));
    long time = (tr.startTime + sample.timeStamp) * tr.scale;//
    if (sampleIndex >= tr.samples.size()) {
        time += sample.duration * tr.scale;
    }
    return new Rational(time, tr.rate);
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:12,代码来源:AVIReader.java



注:本文中的org.monte.media.math.Rational类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClassHistogramElement类代码示例发布时间:2022-05-22
下一篇:
Java AccessorProperty类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap